diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 15:39:57 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 15:39:57 -0700 |
commit | 035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (patch) | |
tree | 7e40f5a790eae329a8c5d3e59f046451767956ff /Tests/TestDriver | |
download | cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.tar.gz cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.tar.bz2 cmake-035c7fabc3b82cbc9a346c11abe2e9462b4c0379.zip |
Imported Upstream version 2.8.9upstream/2.8.9
Diffstat (limited to 'Tests/TestDriver')
-rw-r--r-- | Tests/TestDriver/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/TestDriver/subdir/test3.cxx | 8 | ||||
-rw-r--r-- | Tests/TestDriver/test1.cxx | 25 | ||||
-rw-r--r-- | Tests/TestDriver/test2.cxx | 8 | ||||
-rw-r--r-- | Tests/TestDriver/testArgs.h | 20 | ||||
-rw-r--r-- | Tests/TestDriver/testExtraStuff.cxx | 4 | ||||
-rw-r--r-- | Tests/TestDriver/testExtraStuff2.cxx | 4 | ||||
-rw-r--r-- | Tests/TestDriver/testExtraStuff3.cxx | 4 |
8 files changed, 88 insertions, 0 deletions
diff --git a/Tests/TestDriver/CMakeLists.txt b/Tests/TestDriver/CMakeLists.txt new file mode 100644 index 000000000..bd5e97414 --- /dev/null +++ b/Tests/TestDriver/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required (VERSION 2.6) +PROJECT(TestDriverTest) + +SET(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx ) +SET(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx ) +INCLUDE_DIRECTORIES(${TestDriverTest_SOURCE_DIR}) +CREATE_TEST_SOURCELIST(testSrcs + TestDriverTest.cxx + test1.cxx + test2.cxx + subdir/test3.cxx + EXTRA_INCLUDE testArgs.h FUNCTION testProccessArgs) + +ADD_EXECUTABLE(TestDriverTest ${testSrcs} ${Extra_SRCS}) + diff --git a/Tests/TestDriver/subdir/test3.cxx b/Tests/TestDriver/subdir/test3.cxx new file mode 100644 index 000000000..976d6ebaa --- /dev/null +++ b/Tests/TestDriver/subdir/test3.cxx @@ -0,0 +1,8 @@ +#include <stdio.h> +int subdir_test3(int ac, char*av[]) +{ + printf("test3\n"); + for(int i =0; i < ac; i++) + printf("arg %d is %s\n", ac, av[i]); + return 0; +} diff --git a/Tests/TestDriver/test1.cxx b/Tests/TestDriver/test1.cxx new file mode 100644 index 000000000..ac82f8ae9 --- /dev/null +++ b/Tests/TestDriver/test1.cxx @@ -0,0 +1,25 @@ +#include <stdio.h> +int testExtraStuff3(); +int testExtraStuff(); +int testExtraStuff2(); + +int test1(int ac, char* av[]) +{ + if(!testExtraStuff2()) + { + return -1; + } + if(!testExtraStuff()) + { + return -1; + } + if(!testExtraStuff3()) + { + return -1; + } + + printf("test1\n"); + for(int i =0; i < ac; i++) + printf("arg %d is %s\n", ac, av[i]); + return 0; +} diff --git a/Tests/TestDriver/test2.cxx b/Tests/TestDriver/test2.cxx new file mode 100644 index 000000000..69f0fff17 --- /dev/null +++ b/Tests/TestDriver/test2.cxx @@ -0,0 +1,8 @@ +#include <stdio.h> +int test2(int ac, char*av[]) +{ + printf("test2\n"); + for(int i =0; i < ac; i++) + printf("arg %d is %s\n", ac, av[i]); + return 0; +} diff --git a/Tests/TestDriver/testArgs.h b/Tests/TestDriver/testArgs.h new file mode 100644 index 000000000..04893660b --- /dev/null +++ b/Tests/TestDriver/testArgs.h @@ -0,0 +1,20 @@ +void testProccessArgs(int* ac, char***av) +{ + char** argv = *av; + if(*ac < 2) + { + return; + } + if(strcmp(argv[1], "--with-threads") == 0) + { + printf("number of threads is %s\n", argv[2]); + *av +=2; + *ac -=2; + } + else if (strcmp(argv[1], "--without-threads") == 0) + { + printf("no threads\n"); + *av += 1; + *ac -= 1; + } +} diff --git a/Tests/TestDriver/testExtraStuff.cxx b/Tests/TestDriver/testExtraStuff.cxx new file mode 100644 index 000000000..bfd073c9a --- /dev/null +++ b/Tests/TestDriver/testExtraStuff.cxx @@ -0,0 +1,4 @@ +int testExtraStuff() +{ + return 1; +} diff --git a/Tests/TestDriver/testExtraStuff2.cxx b/Tests/TestDriver/testExtraStuff2.cxx new file mode 100644 index 000000000..e755dbe02 --- /dev/null +++ b/Tests/TestDriver/testExtraStuff2.cxx @@ -0,0 +1,4 @@ +int testExtraStuff2() +{ + return 1; +} diff --git a/Tests/TestDriver/testExtraStuff3.cxx b/Tests/TestDriver/testExtraStuff3.cxx new file mode 100644 index 000000000..9c239d42a --- /dev/null +++ b/Tests/TestDriver/testExtraStuff3.cxx @@ -0,0 +1,4 @@ +int testExtraStuff3() +{ + return 1; +} |