add cmake configuration

This commit is contained in:
Enno Rehling 2012-06-02 23:59:41 -07:00
parent c4e7ef9755
commit d00bb596fa
3 changed files with 14 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*~

View File

@ -5,7 +5,7 @@
CuSuite* CuGetSuite(); CuSuite* CuGetSuite();
CuSuite* CuStringGetSuite(); CuSuite* CuStringGetSuite();
void RunAllTests(void) int RunAllTests(void)
{ {
CuString *output = CuStringNew(); CuString *output = CuStringNew();
CuSuite* suite = CuSuiteNew(); CuSuite* suite = CuSuiteNew();
@ -17,9 +17,10 @@ void RunAllTests(void)
CuSuiteSummary(suite, output); CuSuiteSummary(suite, output);
CuSuiteDetails(suite, output); CuSuiteDetails(suite, output);
printf("%s\n", output->buffer); printf("%s\n", output->buffer);
return suite->failCount;
} }
int main(void) int main(void)
{ {
RunAllTests(); return RunAllTests();
} }

10
CMakeLists.txt Normal file
View File

@ -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)