Separated the test framework into the header. Test definitions should be placed in the test.c.
30 lines
326 B
C
30 lines
326 B
C
#include "test.h"
|
|
|
|
// INCLUDE PROJECT HEADERS
|
|
#include "hello_world.h"
|
|
|
|
|
|
// DEFINE TESTS
|
|
TEST(success){
|
|
return 0;
|
|
}
|
|
|
|
TEST(fail){
|
|
int i = 1;
|
|
assert(i == 0);
|
|
printf("after assert\n");
|
|
return i;
|
|
}
|
|
|
|
TEST(segfault){
|
|
int* x = NULL;
|
|
int y = *x;
|
|
return y;
|
|
}
|
|
|
|
// END OF TEST DEFINITIONS
|
|
|
|
int main(void){
|
|
return run_tests();
|
|
}
|