mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 10:54:36 +00:00
make : improve test target (#3031)
This commit is contained in:
parent
5ffab089a5
commit
4fa2cc1750
21
Makefile
21
Makefile
@ -42,9 +42,9 @@ endif
|
|||||||
|
|
||||||
default: $(BUILD_TARGETS)
|
default: $(BUILD_TARGETS)
|
||||||
|
|
||||||
test:
|
test: $(TEST_TARGETS)
|
||||||
@echo "Running tests..."
|
@failures=0; \
|
||||||
@for test_target in $(TEST_TARGETS); do \
|
for test_target in $(TEST_TARGETS); do \
|
||||||
if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \
|
if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \
|
||||||
./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \
|
./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \
|
||||||
elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \
|
elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \
|
||||||
@ -52,10 +52,21 @@ test:
|
|||||||
elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \
|
elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \
|
||||||
continue; \
|
continue; \
|
||||||
else \
|
else \
|
||||||
|
echo "Running test $$test_target..."; \
|
||||||
./$$test_target; \
|
./$$test_target; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
if [ $$? -ne 0 ]; then \
|
||||||
@echo "All tests have been run."
|
printf 'Test $$test_target FAILED!\n\n' $$test_target; \
|
||||||
|
failures=$$(( failures + 1 )); \
|
||||||
|
else \
|
||||||
|
printf 'Test %s passed.\n\n' $$test_target; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
if [ $$failures -gt 0 ]; then \
|
||||||
|
printf '\n%s tests failed.\n' $$failures; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
@echo 'All tests passed.'
|
||||||
|
|
||||||
all: $(BUILD_TARGETS) $(TEST_TARGETS)
|
all: $(BUILD_TARGETS) $(TEST_TARGETS)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user