Created a unit-testing system using perl's prove
This commit is contained in:
parent
26ef76349e
commit
c228335bca
9
Makefile
9
Makefile
@ -81,6 +81,15 @@ doc: $(BUILTMAN)
|
||||
%.3: %.3.sh
|
||||
sh $< >$@
|
||||
|
||||
TESTSOURCES=$(wildcard t/*.c)
|
||||
TESTFILES=$(TESTSOURCES:.c=.t)
|
||||
|
||||
t/%.t: t/%.c $(LIBRARY)
|
||||
$(LIBTOOL) --mode=link --tag=CC gcc -o $@ $^
|
||||
|
||||
test: $(TESTFILES)
|
||||
prove -e ""
|
||||
|
||||
clean: clean-built
|
||||
|
||||
clean-built:
|
||||
|
20
t/01base.c
Normal file
20
t/01base.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include "termkey.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TermKey *tk;
|
||||
|
||||
printf("1..2\n");
|
||||
|
||||
tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS);
|
||||
|
||||
printf(tk ? "" : "not ");
|
||||
printf("ok 1 - termkey_new\n");
|
||||
|
||||
termkey_destroy(tk);
|
||||
|
||||
printf("ok 2 - termkey_free\n");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user