Can specify a working directory for tests. Closes #326.
parent
d5bdfb5906
commit
23c6de3461
7 changed files with 40 additions and 5 deletions
@ -0,0 +1,6 @@ |
||||
project('test workdir', 'c') |
||||
|
||||
exe = executable('opener', 'opener.c') |
||||
|
||||
test('basic', exe, workdir : meson.source_root()) |
||||
test('shouldfail', exe, should_fail : true) |
@ -0,0 +1,12 @@ |
||||
// This test only succeeds if run in the source root dir.
|
||||
|
||||
#include<stdio.h> |
||||
|
||||
int main(int arg, char **argv) { |
||||
FILE *f = fopen("opener.c", "r"); |
||||
if(f) { |
||||
fclose(f); |
||||
return 0; |
||||
} |
||||
return 1; |
||||
} |
@ -0,0 +1,4 @@ |
||||
project('nonabs workdir', 'c') |
||||
|
||||
exe = executable('simple', 'simple.c') |
||||
test('simple', exe, workdir : '.') |
@ -0,0 +1,3 @@ |
||||
int main(int argc, char **argv) { |
||||
return 0; |
||||
} |
Loading…
Reference in new issue