Basic tests implemented using cmocka

This commit is contained in:
Imbus 2024-12-25 14:05:22 +01:00
parent 1e76066400
commit bfffbb9211
2 changed files with 108 additions and 1 deletions

View file

@ -27,6 +27,9 @@ ASMS = $(C_SOURCES:.c=.s)
all: $(OBJECTS)
test: test/test.elf
./test/test.elf
%.o: %.c $(C_HEADERS)
@echo "CC $<"
@$(CC) $(CFLAGS) -c $< -o $@
@ -41,6 +44,9 @@ driver: $(OBJECTS)
run: driver
@./driver
test/test.elf: test/test_ringbuf.o ringbuf.o
@$(CC) $(CFLAGS) $^ -o $@ -lpthread -lcmocka
lib: $(OBJECTS)
@ar rcs librbuf.a ringbuf.o
@ -64,4 +70,4 @@ tidy:
format:
clang-format -i $(C_SOURCES) $(C_HEADERS)
.PHONY: all clean format asm
.PHONY: all clean format asm test