Made file object testing a bit more thorough.
This commit is contained in:
parent
2ac6c9cbcc
commit
6354b5f54a
|
@ -0,0 +1,3 @@
|
||||||
|
int func() {
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -1,4 +1,9 @@
|
||||||
project('file object', 'c')
|
project('file object', 'c')
|
||||||
|
|
||||||
fileobj = file('prog.c')
|
prog0 = file('prog.c')
|
||||||
test('fobj', executable('fobj', fileobj))
|
lib0 = file('lib.c')
|
||||||
|
test('fobj', executable('fobj', prog0, lib0))
|
||||||
|
|
||||||
|
subdir('subdir1')
|
||||||
|
subdir('subdir2')
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
#include<stdio.h>
|
#include<stdio.h>
|
||||||
|
|
||||||
|
int func(); /* Files in different subdirs return different values. */
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
if(func() == 0) {
|
||||||
printf("Iz success.\n");
|
printf("Iz success.\n");
|
||||||
|
} else {
|
||||||
|
printf("Iz fail.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
int func() {
|
||||||
|
return 1;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
prog1 = file('prog.c')
|
||||||
|
lib1 = file('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))
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
int func();
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
if(func() == 1) {
|
||||||
|
printf("Iz success.\n");
|
||||||
|
} else {
|
||||||
|
printf("Iz fail.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
int func() {
|
||||||
|
return 2;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
prog2 = file('prog.c')
|
||||||
|
lib2 = file('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))
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
int func();
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
if(func() == 2) {
|
||||||
|
printf("Iz success.\n");
|
||||||
|
} else {
|
||||||
|
printf("Iz fail.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue