From 82c77b22605d691884be4c4e1e6bae8d66598d02 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 10 Aug 2025 21:37:15 +0300 Subject: make tests actually useful + Apparently quite a few components are currently broken, didn't even remember --- tests/simple_mesh3d/sim.c | 4 ++-- tests/simple_mesh3d/source.mk | 25 +++++++++---------------- 2 files changed, 11 insertions(+), 18 deletions(-) (limited to 'tests/simple_mesh3d') diff --git a/tests/simple_mesh3d/sim.c b/tests/simple_mesh3d/sim.c index f1663ef..768e9ef 100644 --- a/tests/simple_mesh3d/sim.c +++ b/tests/simple_mesh3d/sim.c @@ -82,8 +82,8 @@ static stat build_mesh3d(struct clock_domain *clk, uint8_t x, uint8_t y, struct component *imem = create_simple_mem(4096); init_simple_mem(imem, 0, - build_tests_simple_mesh3d_test_bin_len, - build_tests_simple_mesh3d_test_bin); + build_tests_simple_mesh3d_test_inc_bin_len, + build_tests_simple_mesh3d_test_inc_bin); uint64_t rcv = mesh3d_addr(i, j, k, 0, 0); struct component *rv64 = create_simple_riscv64(rcv, 0, diff --git a/tests/simple_mesh3d/source.mk b/tests/simple_mesh3d/source.mk index 30aea2c..36c2556 100644 --- a/tests/simple_mesh3d/source.mk +++ b/tests/simple_mesh3d/source.mk @@ -1,18 +1,11 @@ -MESH3D_TEST_OBJ != ./scripts/gen-deps --sources "tests/simple_mesh3d/sim.c" -TEST_PROGS += build/tests/simple_mesh3d/sim +SIMPLE_MESH3D := tests/simple_mesh3d +SIMPLE_MESH3D_SIM := $(SIMPLE_MESH3D)/sim.c -build/tests/simple_mesh3d/test.inc: tests/simple_mesh3d/test.c - riscv64-unknown-elf-gcc -O2 -Wall -Wextra -ffreestanding -nostdlib \ - -march=rv64i -mabi=lp64 \ - -o build/tests/simple_mesh3d/test \ - tests/simple_mesh3d/test.c - riscv64-unknown-elf-objcopy -Obinary \ - build/tests/simple_mesh3d/test \ - build/tests/simple_mesh3d/test.bin - xxd -i build/tests/simple_mesh3d/test.bin \ - > build/tests/simple_mesh3d/test.inc +TESTS += $(SIMPLE_MESH3D)/sim -build/tests/simple_mesh3d/sim.o: build/tests/simple_mesh3d/test.inc - -build/tests/simple_mesh3d/sim: $(MESH3D_TEST_OBJ) $(OBJS) - $(COMPILE) $(MESH3D_TEST_OBJ) $(OBJS) -o $@ +.PHONY: $(SIMPLE_MESH3D)/sim +$(SIMPLE_MESH3D)/sim: $(SIMPLE_MESH3D_SIM) libgran.a + mkdir -p build/$(SIMPLE_MESH3D) + ./scripts/gen-rv64-fw -d build -o $(SIMPLE_MESH3D)/test.inc $(SIMPLE_MESH3D)/test.c + $(COMPILE_TEST) $(SIMPLE_MESH3D_SIM) libgran.a -o build/$@ + ./scripts/gen-report -d build $@ -- cgit v1.3