interpreter: disallow RunTarget in test
Fixes the following error in the testcase: File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 548, in generate self.generate_tests() File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 1093, in generate_tests self.serialize_tests() File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 567, in serialize_tests self.write_test_file(datafile) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 943, in write_test_file self.write_test_serialisation(self.build.get_tests(), datafile) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1017, in write_test_serialisation pickle.dump(self.create_test_serialisation(tests), datafile) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1002, in create_test_serialisation cmd_args.append(self.construct_target_rel_path(a, t.workdir)) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1021, in construct_target_rel_path return self.get_target_filename(a) File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 253, in get_target_filename assert(isinstance(t, build.BuildTarget))
This commit is contained in:
parent
0bc0905210
commit
36c390e08e
|
@ -192,7 +192,7 @@ known_build_target_kwargs = (
|
|||
)
|
||||
|
||||
TEST_KWARGS: T.List[KwargInfo] = [
|
||||
KwargInfo('args', ContainerTypeInfo(list, (str, mesonlib.File, build.Target)),
|
||||
KwargInfo('args', ContainerTypeInfo(list, (str, mesonlib.File, build.BuildTarget, build.CustomTarget)),
|
||||
listify=True, default=[]),
|
||||
KwargInfo('should_fail', bool, default=False),
|
||||
KwargInfo('timeout', int, default=30),
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
project('trivial test', 'c')
|
||||
exe = executable('trivialprog', 'trivial.c')
|
||||
runt = run_target('invalid', command: ['echo', 'run_target'])
|
||||
test('runtest', exe, args: runt)
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"stdout": [
|
||||
{
|
||||
"line": "test cases/failing/116 run_target in test/meson.build:4:0: ERROR: test keyword argument 'args' was of type 'list' but should have been list[str,File,BuildTarget,CustomTarget]"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#include<stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("Trivial test is working.\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue