Skip to content

Commit 7c3c26a

Browse files
committed
runtests.sh: use plain Bourne shell
Ensure that the script can be used on any POSIX system.
1 parent c2e704b commit 7c3c26a

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LUA_FILTERS_TEST_IMAGE = tarleb/lua-filters-test
55
.PHONY: test show-args docker-test docker-test-image archive
66

77
test:
8-
bash runtests.sh $(FILTERS)
8+
sh runtests.sh $(FILTERS)
99

1010
archive: .build/lua-filters.tar.gz
1111

runtests.sh

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
# argument is list of filters
3-
43
FILTERS=$*
54

6-
ERRORS_COUNT=0
7-
PASSED_COUNT=0
8-
SKIPPED_COUNT=0
9-
EXPECTED_COUNT=0
10-
11-
let err=0
5+
errors_count=0
6+
passed_count=0
127

138
for d in $FILTERS; do
14-
let "EXPECTED_COUNT++"
159
make --no-print-directory -C $d test
1610
if [ $? -eq 0 ]; then
17-
let "PASSED_COUNT++"
18-
echo "$d"
11+
passed_count=$(($passed_count + 1))
12+
printf "$d\n"
1913
else
20-
let "ERRORS_COUNT++"
21-
echo "$d"
14+
errors_count=$(($errors_count + 1))
15+
printf "$d\n"
2216
fi
2317
done
2418

25-
echo ""
26-
echo "⚖ Summary"
27-
echo "${PASSED_COUNT} passed"
28-
[ ${ERRORS_COUNT} = 0 ] || echo "${ERRORS_COUNT} errors"
29-
exit ${ERRORS_COUNT}
19+
printf "\n"
20+
printf "⚖ Summary\n"
21+
printf "${passed_count} passed\n"
22+
[ ${errors_count} = 0 ] || printf "${errors_count} errors\n"
23+
exit ${errors_count}

0 commit comments

Comments
 (0)