Skip to content

Commit 4fa2cc1

Browse files
authored
make : improve test target (ggml-org#3031)
1 parent 5ffab08 commit 4fa2cc1

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Makefile

+16-5
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,31 @@ endif
4242

4343
default: $(BUILD_TARGETS)
4444

45-
test:
46-
@echo "Running tests..."
47-
@for test_target in $(TEST_TARGETS); do \
45+
test: $(TEST_TARGETS)
46+
@failures=0; \
47+
for test_target in $(TEST_TARGETS); do \
4848
if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \
4949
./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \
5050
elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \
5151
continue; \
5252
elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \
5353
continue; \
5454
else \
55+
echo "Running test $$test_target..."; \
5556
./$$test_target; \
5657
fi; \
57-
done
58-
@echo "All tests have been run."
58+
if [ $$? -ne 0 ]; then \
59+
printf 'Test $$test_target FAILED!\n\n' $$test_target; \
60+
failures=$$(( failures + 1 )); \
61+
else \
62+
printf 'Test %s passed.\n\n' $$test_target; \
63+
fi; \
64+
done; \
65+
if [ $$failures -gt 0 ]; then \
66+
printf '\n%s tests failed.\n' $$failures; \
67+
exit 1; \
68+
fi
69+
@echo 'All tests passed.'
5970

6071
all: $(BUILD_TARGETS) $(TEST_TARGETS)
6172

0 commit comments

Comments
 (0)