Skip to content

Commit

Permalink
meson: Wire up test-suite
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Jan 31, 2024
1 parent c66012a commit 6405271
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand All @@ -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,
)
13 changes: 13 additions & 0 deletions tests/run.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 6405271

Please sign in to comment.