We want the meson test target to be self contained and having an
essential variables defined in the GitHub CI is heading the opposite
direction.
Create a wrapper that does this for us.
v2:
- add the script to the autotools tarball/EXTRA_DIST
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/179
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
git config --global --add safe.directory '*'
.github/print-kdir.sh >> "$GITHUB_ENV"
- echo "ASAN_OPTIONS=verify_asan_link_order=0:halt_on_error=1:abort_on_error=1:print_summary=1" >> "$GITHUB_ENV"
- name: configure (meson)
if: ${{ matrix.build == 'meson' }}
testsuite/meson.build \
scripts/build-scdoc.sh \
scripts/test-gtkdoc.sh \
+ scripts/test-wrapper.sh \
scripts/kmod-symlink.sh
AM_CPPFLAGS = \
setup_modules = find_program('scripts/setup-modules.sh')
setup_rootfs = find_program('scripts/setup-rootfs.sh')
top_include = include_directories('.')
+ test_wrapper = find_program('scripts/test-wrapper.sh')
subdir('testsuite')
endif
--- /dev/null
+#!/bin/bash
+
+set -euo pipefail
+
+if [[ ${ASAN_OPTIONS-} || ${UBSAN_OPTIONS-} || ${MSAN_OPTIONS-} ]]; then
+ ASAN_OPTIONS=verify_asan_link_order=0:halt_on_error=1:abort_on_error=1:print_summary=1
+ export ASAN_OPTIONS
+fi
+
+exec "$@"
foreach input : _testsuite
test(
input,
- executable(
+ test_wrapper,
+ args : executable(
input,
files('@0@.c'.format(input)),
include_directories : top_include,