mirror of
https://github.com/tmux/tmux.git
synced 2026-07-03 09:22:22 +00:00
Make output nicer for tests.
This commit is contained in:
@@ -3,8 +3,31 @@ TESTS!= echo *.sh
|
||||
.PHONY: all $(TESTS)
|
||||
.NOTPARALLEL: all $(TESTS)
|
||||
|
||||
all: $(TESTS)
|
||||
all:
|
||||
@failed=0; failures=; \
|
||||
for test in $(TESTS); do \
|
||||
printf '%-40s ' "$$test"; \
|
||||
start=$$(date +%s); \
|
||||
if sh "$$test" >/dev/null 2>&1; then \
|
||||
end=$$(date +%s); \
|
||||
echo "PASS ($$((end - start))s)"; \
|
||||
else \
|
||||
end=$$(date +%s); \
|
||||
echo "FAIL ($$((end - start))s)"; \
|
||||
failed=1; \
|
||||
failures="$$failures $$test"; \
|
||||
fi; \
|
||||
sleep 1; \
|
||||
done; \
|
||||
if [ "$$failed" -ne 0 ]; then \
|
||||
echo; \
|
||||
echo "failures:"; \
|
||||
for test in $$failures; do \
|
||||
echo " $$test"; \
|
||||
done; \
|
||||
fi; \
|
||||
exit $$failed
|
||||
|
||||
$(TESTS):
|
||||
sh $*.sh
|
||||
sh $@
|
||||
sleep 1
|
||||
|
||||
Reference in New Issue
Block a user