File tree 1 file changed +16
-5
lines changed
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -42,20 +42,31 @@ endif
42
42
43
43
default : $(BUILD_TARGETS )
44
44
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 \
48
48
if [ " $$ test_target" = " tests/test-tokenizer-0-llama" ]; then \
49
49
./$$ test_target $(CURDIR ) /models/ggml-vocab-llama.gguf; \
50
50
elif [ " $$ test_target" = " tests/test-tokenizer-0-falcon" ]; then \
51
51
continue ; \
52
52
elif [ " $$ test_target" = " tests/test-tokenizer-1" ]; then \
53
53
continue ; \
54
54
else \
55
+ echo " Running test $$ test_target..." ; \
55
56
./$$ test_target; \
56
57
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.'
59
70
60
71
all : $(BUILD_TARGETS ) $(TEST_TARGETS )
61
72
You can’t perform that action at this time.
0 commit comments