diff --git a/tests/meson.build b/tests/meson.build index 48fe7b1..f5b89d0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -177,9 +177,8 @@ foreach test_name: unit_tests link_with: test_utils, ) test(test_name, - find_program('test-runner.sh'), + test_exe, suite: ['unit-tests'], - args: [test_exe], env: envs, ) endforeach @@ -193,11 +192,17 @@ test('udev-hwdb', gdb = find_program('gdb', required: false) if gdb.found() + libfprint_wrapper = [ + gdb.path(), + '-batch', + '-ex', 'run', + '--args', + ] add_test_setup('gdb', timeout_multiplier: 1000, + exe_wrapper: libfprint_wrapper, env: [ - 'LIBFPRINT_TEST_WRAPPER=@0@ --args'.format( - gdb.path()) + 'LIBFPRINT_TEST_WRAPPER=' + ' '.join(libfprint_wrapper), ]) endif @@ -207,13 +212,19 @@ if valgrind.found() glib_suppressions = glib_share + '/valgrind/glib.supp' python_suppressions = '@0@/@1@'.format(meson.source_root(), files('valgrind-python.supp')[0]) + libfprint_wrapper = [ + valgrind.path(), + '--tool=memcheck', + '--leak-check=full', + '--suppressions=' + glib_suppressions, + '--suppressions=' + python_suppressions, + ] add_test_setup('valgrind', timeout_multiplier: 10, + exe_wrapper: libfprint_wrapper, env: [ 'G_SLICE=always-malloc', 'UNDER_VALGRIND=1', - ('LIBFPRINT_TEST_WRAPPER=@0@ --tool=memcheck --leak-check=full ' + - '--suppressions=@1@ --suppressions=@2@').format( - valgrind.path(), glib_suppressions, python_suppressions) + 'LIBFPRINT_TEST_WRAPPER=' + ' '.join(libfprint_wrapper), ]) endif diff --git a/tests/test-runner.sh b/tests/test-runner.sh deleted file mode 100755 index 18b038b..0000000 --- a/tests/test-runner.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -exec $LIBFPRINT_TEST_WRAPPER $@ diff --git a/tests/virtual-device.py b/tests/virtual-device.py index 46fedba..d604639 100644 --- a/tests/virtual-device.py +++ b/tests/virtual-device.py @@ -22,14 +22,6 @@ except Exception as e: FPrint = None -# Re-run the test with the passed wrapper if set -wrapper = os.getenv('LIBFPRINT_TEST_WRAPPER') -if wrapper: - wrap_cmd = wrapper.split(' ') + [sys.executable, os.path.abspath(__file__)] + \ - sys.argv[1:] - os.unsetenv('LIBFPRINT_TEST_WRAPPER') - sys.exit(subprocess.check_call(wrap_cmd)) - ctx = GLib.main_context_default() diff --git a/tests/virtual-image.py b/tests/virtual-image.py index 2ee376d..7605b58 100755 --- a/tests/virtual-image.py +++ b/tests/virtual-image.py @@ -21,14 +21,6 @@ except Exception as e: FPrint = None -# Re-run the test with the passed wrapper if set -wrapper = os.getenv('LIBFPRINT_TEST_WRAPPER') -if wrapper: - wrap_cmd = wrapper.split(' ') + [sys.executable, os.path.abspath(__file__)] + \ - sys.argv[1:] - os.unsetenv('LIBFPRINT_TEST_WRAPPER') - sys.exit(subprocess.check_call(wrap_cmd)) - def load_image(img): png = cairo.ImageSurface.create_from_png(img)