diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/74 file object | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/74 file object')
9 files changed, 71 insertions, 0 deletions
diff --git a/meson/test cases/common/74 file object/lib.c b/meson/test cases/common/74 file object/lib.c new file mode 100644 index 000000000..91800303c --- /dev/null +++ b/meson/test cases/common/74 file object/lib.c @@ -0,0 +1,3 @@ +int func(void) { + return 0; +} diff --git a/meson/test cases/common/74 file object/meson.build b/meson/test cases/common/74 file object/meson.build new file mode 100644 index 000000000..c3ecb7be9 --- /dev/null +++ b/meson/test cases/common/74 file object/meson.build @@ -0,0 +1,9 @@ +project('file object', 'c') + +prog0 = files('prog.c') +lib0 = files('lib.c') +test('fobj', executable('fobj', prog0, lib0)) + +subdir('subdir1') +subdir('subdir2') + diff --git a/meson/test cases/common/74 file object/prog.c b/meson/test cases/common/74 file object/prog.c new file mode 100644 index 000000000..78c6acc27 --- /dev/null +++ b/meson/test cases/common/74 file object/prog.c @@ -0,0 +1,13 @@ +#include<stdio.h> + +int func(void); /* Files in different subdirs return different values. */ + +int main(void) { + if(func() == 0) { + printf("Iz success.\n"); + } else { + printf("Iz fail.\n"); + return 1; + } + return 0; +} diff --git a/meson/test cases/common/74 file object/subdir1/lib.c b/meson/test cases/common/74 file object/subdir1/lib.c new file mode 100644 index 000000000..8c13c2126 --- /dev/null +++ b/meson/test cases/common/74 file object/subdir1/lib.c @@ -0,0 +1,3 @@ +int func(void) { + return 1; +} diff --git a/meson/test cases/common/74 file object/subdir1/meson.build b/meson/test cases/common/74 file object/subdir1/meson.build new file mode 100644 index 000000000..f5066f00f --- /dev/null +++ b/meson/test cases/common/74 file object/subdir1/meson.build @@ -0,0 +1,7 @@ +prog1 = files('prog.c') +lib1 = files('lib.c') + +test('subdir0', executable('subdir0', prog0, lib1), should_fail : true) +test('subdir1', executable('subdir1', prog1, lib0), should_fail : true) + +test('subdir2', executable('subdir2', prog1, lib1))
\ No newline at end of file diff --git a/meson/test cases/common/74 file object/subdir1/prog.c b/meson/test cases/common/74 file object/subdir1/prog.c new file mode 100644 index 000000000..38d13d242 --- /dev/null +++ b/meson/test cases/common/74 file object/subdir1/prog.c @@ -0,0 +1,13 @@ +#include<stdio.h> + +int func(void); + +int main(void) { + if(func() == 1) { + printf("Iz success.\n"); + } else { + printf("Iz fail.\n"); + return 1; + } + return 0; +} diff --git a/meson/test cases/common/74 file object/subdir2/lib.c b/meson/test cases/common/74 file object/subdir2/lib.c new file mode 100644 index 000000000..8e2b4ebfb --- /dev/null +++ b/meson/test cases/common/74 file object/subdir2/lib.c @@ -0,0 +1,3 @@ +int func(void) { + return 2; +} diff --git a/meson/test cases/common/74 file object/subdir2/meson.build b/meson/test cases/common/74 file object/subdir2/meson.build new file mode 100644 index 000000000..588651019 --- /dev/null +++ b/meson/test cases/common/74 file object/subdir2/meson.build @@ -0,0 +1,7 @@ +prog2 = files('prog.c') +lib2 = files('lib.c') + +test('subdir3', executable('subdir3', prog1, lib2), should_fail : true) +test('subdir4', executable('subdir4', prog2, lib1), should_fail : true) + +test('subdir4', executable('subdir5', prog2, lib2))
\ No newline at end of file diff --git a/meson/test cases/common/74 file object/subdir2/prog.c b/meson/test cases/common/74 file object/subdir2/prog.c new file mode 100644 index 000000000..8a8f0d016 --- /dev/null +++ b/meson/test cases/common/74 file object/subdir2/prog.c @@ -0,0 +1,13 @@ +#include<stdio.h> + +int func(void); + +int main(void) { + if(func() == 2) { + printf("Iz success.\n"); + } else { + printf("Iz fail.\n"); + return 1; + } + return 0; +} |