diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-09-04 04:50:15 -0400 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-09-04 14:45:20 +0200 |
commit | fa5c2363eb1dd94058aac1a4045d2ab546eed7b9 (patch) | |
tree | eb28e49113496ac423b5cee05e8c603d6e111e49 /test cases | |
parent | 0b0873c7438471732e5237b1c667e5a3b3fe3c82 (diff) | |
download | meson-fa5c2363eb1dd94058aac1a4045d2ab546eed7b9.zip meson-fa5c2363eb1dd94058aac1a4045d2ab546eed7b9.tar.gz meson-fa5c2363eb1dd94058aac1a4045d2ab546eed7b9.tar.bz2 |
introspect: add test dependencies info to test/benchmark JSON
Add the ids of any target that needs to be rebuilt before running the
tests as computed by the backend, to the introspection data for tests and benchmarks.
This also includes anything that appears on the test's command line.
Without this information, IDEs must update the entire build before running
any test. They can now instead selectively build the test executable
itself and anything that is needed to run it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/unit/57 introspection/cp.py | 5 | ||||
-rw-r--r-- | test cases/unit/57 introspection/meson.build | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test cases/unit/57 introspection/cp.py b/test cases/unit/57 introspection/cp.py new file mode 100644 index 0000000..cb09cf3 --- /dev/null +++ b/test cases/unit/57 introspection/cp.py @@ -0,0 +1,5 @@ +#! /usr/bin/env python3 + +import sys +from shutil import copyfile +copyfile(*sys.argv[1:]) diff --git a/test cases/unit/57 introspection/meson.build b/test cases/unit/57 introspection/meson.build index 5d4dd02..3a3db10 100644 --- a/test cases/unit/57 introspection/meson.build +++ b/test cases/unit/57 introspection/meson.build @@ -26,6 +26,9 @@ var1 = '1' var2 = 2.to_string() var3 = 'test3' +cus = custom_target('custom target test', output: 'file2', input: 'cp.py', + command: [find_program('cp.py'), '@INPUT@', '@OUTPUT@']) + t1 = executable('test' + var1, ['t1.cpp'], link_with: [sharedlib], install: not false, build_by_default: get_option('test_opt2')) t2 = executable('test@0@'.format('@0@'.format(var2)), sources: ['t2.cpp'], link_with: [staticlib]) t3 = executable(var3, 't3.cpp', link_with: [sharedlib, staticlib], dependencies: [dep1]) @@ -44,8 +47,8 @@ osmesa_lib_name = osmesa_lib_name + osmesa_bits message(osmesa_lib_name) # Infinite recursion gets triggered here when the parameter osmesa_lib_name is resolved test('test case 1', t1) -test('test case 2', t2) -benchmark('benchmark 1', t3) +test('test case 2', t2, depends: t3) +benchmark('benchmark 1', t3, args: cus) ### Stuff to test the AST JSON printer foreach x : ['a', 'b', 'c'] |