Added simple test case for subproject. Now to make it pass...

pull/15/head
Jussi Pakkanen 11 years ago
parent 641b627906
commit b8b608a2a1
  1. 9
      test cases/common/49 subproject/meson.build
  2. 6
      test cases/common/49 subproject/sublib/include/subdefs.h
  3. 6
      test cases/common/49 subproject/sublib/meson.build
  4. 5
      test cases/common/49 subproject/sublib/simpletest.c
  5. 5
      test cases/common/49 subproject/sublib/sublib.c
  6. 16
      test cases/common/49 subproject/user.c

@ -0,0 +1,9 @@
project('subproj user', 'c')
sub = subproject('sublib')
inc = sub.get_variable('i')
lib = sub.get_variable('l')
e = executable('user.c', include_dirs : inc, link_with : lib)
test('subdirtest', e)

@ -0,0 +1,6 @@
#ifndef SUBDEFS_H_
#define SUBDEFS_H_
int subfunc();
#endif

@ -0,0 +1,6 @@
project('subproject', 'c')
i = include_directories('include')
l = shared_library('sublib', 'sublib.c', include_dirs : i, install : true)
t = executable('simpletest', 'simpletest.c', include_dirs : i, link_with : l)
test('plain', t)

@ -0,0 +1,5 @@
#include<subdefs.h>
int main(int argc, char **argv) {
return subfunc() == 42 ? 0 : 1;
}

@ -0,0 +1,5 @@
#include<subdefs.h>
int subfunc() {
return 42;
}

@ -0,0 +1,16 @@
#include<subdefs.h>
#include<stdio.h>
int main(int argc, char **argv) {
int res;
printf("Calling into sublib now.\n");
res = subfunc();
if(res == 42) {
printf("Everything is fine.\n");
return 0;
} else {
printf("Something went wrong.\n");
return 1;
}
}
Loading…
Cancel
Save