Skip to content

Commit

Permalink
make : improve test target (ggerganov#3031)
Browse files Browse the repository at this point in the history
  • Loading branch information
cebtenzzre authored Sep 7, 2023
1 parent 5ffab08 commit 4fa2cc1
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,31 @@ endif

default: $(BUILD_TARGETS)

test:
@echo "Running tests..."
@for test_target in $(TEST_TARGETS); do \
test: $(TEST_TARGETS)
@failures=0; \
for test_target in $(TEST_TARGETS); do \
if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \
./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \
elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \
continue; \
elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \
continue; \
else \
echo "Running test $$test_target..."; \
./$$test_target; \
fi; \
done
@echo "All tests have been run."
if [ $$? -ne 0 ]; then \
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)

Expand Down

0 comments on commit 4fa2cc1

Please sign in to comment.