New testing
This commit is contained in:
19
Makefile
19
Makefile
@@ -26,10 +26,23 @@ dist: clean
|
||||
tar -czf $(DIST).tar.gz $(DIST)
|
||||
rm -rf $(DIST)
|
||||
|
||||
test:
|
||||
@./t/basic
|
||||
check:
|
||||
@failed=0; \
|
||||
for f in ./t/*; do \
|
||||
[ "$$f" = "./t/init.sh" ] && continue; \
|
||||
[ -f "$$f" ] || continue; \
|
||||
name=$$(basename "$$f"); \
|
||||
sh "$$f"; rc=$$?; \
|
||||
if [ $$rc -eq 0 ]; then \
|
||||
printf '\e[0;32mPASS\e[0m: t/%s\n' "$$name"; \
|
||||
else \
|
||||
printf '\e[0;31mFAIL\e[0m: t/%s\n' "$$name"; \
|
||||
failed=1; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ $$failed -ne 0 ]; then exit 1; fi
|
||||
|
||||
clean:
|
||||
rm -f $(SRC_OBJ) $(LIB_OBJ) $(BIN) *.gz
|
||||
|
||||
.PHONY: dist clean all
|
||||
.PHONY: dist clean all check
|
||||
|
||||
Reference in New Issue
Block a user