test check
This commit is contained in:
parent
9669b96e47
commit
ec4a0e1b75
3 changed files with 37 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ circular-buffer
|
|||
bit-fuckery
|
||||
bit-fuckery2
|
||||
ncurses-pong
|
||||
checkcheck
|
||||
|
|
5
Makefile
5
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
|
||||
|
|
32
checkcheck.c
Normal file
32
checkcheck.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <check.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue