diff --git a/.gitignore b/.gitignore index b4e1f13..97503de 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ circular-buffer bit-fuckery bit-fuckery2 ncurses-pong +checkcheck diff --git a/Makefile b/Makefile index d10bc25..3d8d3b0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CFLAGS=-std=c99 -Wall -g -O2 INDENTOPTS=-kr --no-tabs --braces-on-func-def-line --indent-level2 -TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs ncurses-pong bit-fuckery bit-fuckery2 +TARGETS=approximate-pi linked-list mandelbrot threads circular-buffer structs ncurses-pong bit-fuckery bit-fuckery2 checkcheck .PHONY: all all: $(TARGETS) @@ -25,3 +25,6 @@ threads: threads.c ncurses-pong: ncurses-pong.c $(CC) $(CFLAGS) -o $@ $< -lncurses + +checkcheck: checkcheck.c + $(CC) $(CFLAGS) -o $@ $< -lcheck diff --git a/checkcheck.c b/checkcheck.c new file mode 100644 index 0000000..b96d0bb --- /dev/null +++ b/checkcheck.c @@ -0,0 +1,32 @@ +#include +#include +#include + +START_TEST(test_check) { + ck_assert(true); + ck_assert(false == true); +} +END_TEST + +Suite* test_suite(void) { + Suite *s = suite_create("Money"); + + TCase *tc_core = tcase_create("Core"); + tcase_add_test(tc_core, test_check); + suite_add_tcase(s, tc_core); + + return s; +} + + +int main (void) { + int number_failed; + + Suite *s = test_suite(); + SRunner *sr = srunner_create(s); + srunner_run_all(sr, CK_NORMAL); + number_failed = srunner_ntests_failed(sr); + srunner_free (sr); + + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +}