From 751cbf21e738eb4bbc593da1d461862abfafa6be Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Wed, 21 Dec 2022 12:08:44 +0100 Subject: Add unit tests for the BPF filter generation The test-filter verifies that the create_bfp_program builds the filter correctly. The test suite includes the tests for checking a filter with: * a single instruction * a single instruction with arguments * 2 instructions * multiple instructions * multiple instructions with arguments * multiple instructions with multiple instance of the same instruction Signed-off-by: Alice Frosi --- tests/unit/Makefile | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/unit/Makefile (limited to 'tests/unit/Makefile') diff --git a/tests/unit/Makefile b/tests/unit/Makefile new file mode 100644 index 0000000..3270052 --- /dev/null +++ b/tests/unit/Makefile @@ -0,0 +1,5 @@ +CFLAGS += -lcheck + +test: test-filter.c + $(CC) $(CFLAGS) -o test-filter ../../filter.c ../../disasm.c test-filter.c + ./test-filter -- cgit v1.2.3