From 640527167dac51bf109c7e722a8f27be2e5a6e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 31 Jan 2024 12:29:35 +0100 Subject: [PATCH] meson: Wire up test-suite --- tests/meson.build | 13 ++++++++++--- tests/run.py | 13 +++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100755 tests/run.py diff --git a/tests/meson.build b/tests/meson.build index cbe57a35ea..005ca80952 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -96,7 +96,7 @@ if host_os in ['ios', 'watchos', 'tvos'] extra_link_args += ['-Wl,-framework,Foundation'] endif -runner = executable(runner_name, runner_sources + [test_data_stamp], +raw_runner = executable(runner_name, runner_sources + [test_data_stamp], link_with: link_targets, dependencies: [gum_dep, gum_heap_dep, gum_prof_dep, tls_provider_dep, threads_dep] + extra_test_deps, link_args: extra_link_args, @@ -105,9 +105,9 @@ runner = executable(runner_name, runner_sources + [test_data_stamp], ) if host_os_family == 'darwin' - custom_target('gum-tests-signed', + runner = custom_target('gum-tests-signed', input: [ - runner, + raw_runner, 'gum-tests.xcent', ], output: 'gum-tests', @@ -119,4 +119,11 @@ if host_os_family == 'darwin' ], build_by_default: true, ) +else + runner = raw_runner endif + +test('gum', find_program('./run.py'), + args: runner.full_path(), + timeout: 120, +) diff --git a/tests/run.py b/tests/run.py new file mode 100755 index 0000000000..cd72a63857 --- /dev/null +++ b/tests/run.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import subprocess +import sys + + +def main(): + exit_status = subprocess.run(sys.argv[1:]).returncode + sys.exit(exit_status) + + +if __name__ == "__main__": + main()