diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/AllTests.c b/AllTests.c index 5c849ef..04129af 100644 --- a/AllTests.c +++ b/AllTests.c @@ -5,7 +5,7 @@ CuSuite* CuGetSuite(); CuSuite* CuStringGetSuite(); -void RunAllTests(void) +int RunAllTests(void) { CuString *output = CuStringNew(); CuSuite* suite = CuSuiteNew(); @@ -17,9 +17,10 @@ void RunAllTests(void) CuSuiteSummary(suite, output); CuSuiteDetails(suite, output); printf("%s\n", output->buffer); + return suite->failCount; } int main(void) { - RunAllTests(); + return RunAllTests(); } diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..58e2ee7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,10 @@ +project (cutest C) + +enable_testing() + +add_library (cutest CuTest.c) + +add_executable (AllTests AllTests.c CuTestTest.c) +target_link_libraries (AllTests cutest) + +add_test (cutest AllTests)