diff --git a/test/Kyuafile b/test/Kyuafile new file mode 100644 index 0000000..3bcbdef --- /dev/null +++ b/test/Kyuafile @@ -0,0 +1,6 @@ +syntax(2) + +test_suite('rk65c02-tests') + +atf_test_program{name='test_bus'} + diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..7794178 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,11 @@ +CFLAGS=-Wall -I../src +LDFLAGS=-L../src/ -latf-c -lrk65c02 +#-Wl,-R../src/ + +test_bus : test_bus.o + $(CC) -o test_bus $(LDFLAGS) $< + +%.o : %.c + $(CC) $(CFLAGS) -c $< + + diff --git a/test/test_bus.c b/test/test_bus.c new file mode 100644 index 0000000..e8333f7 --- /dev/null +++ b/test/test_bus.c @@ -0,0 +1,33 @@ +#include + +#include +#include + +#include "bus.h" + +ATF_TC_WITHOUT_HEAD(bus__init); +ATF_TC_BODY(bus__init, tc) +{ + bus_t b; + + b = bus_init(); + + ATF_CHECK(b.space != NULL); + + bus_finish(&b); +} + +ATF_TC_WITHOUT_HEAD(bus__foo); +ATF_TC_BODY(bus__foo, tc) +{ + bus_t b; +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, bus__init); + ATF_TP_ADD_TC(tp, bus__foo); + + return (atf_no_error()); +} +