test: improve posix sh compatibility

cute-signatures
Alex Xu (Hello71) 2021-08-07 08:33:23 -04:00 committed by Timo Teräs
parent 984cd3e0b6
commit a278d11287
3 changed files with 5 additions and 5 deletions

View File

@ -50,9 +50,9 @@ repos.stamp: $(repos)
fi; \
if ! APK="$(APK)" ROOT="$(testroot)" SYSREPO="$(SYSREPO)" sh -ex ./$< > $(basename $@).out 2>&1; then\
echo " FAIL";\
printf "------------- output -------------\n" >&2;\
printf '%s\n' "------------- output -------------" >&2;\
cat $(basename $@).out >&2;\
printf "----------------------------------\n" >&2;\
printf '%s\n' "----------------------------------" >&2;\
exit 1;\
fi ;\
echo " OK" ;\

View File

@ -10,9 +10,9 @@ TEST_TO_RUN="$@"
fail=0
pass=0
for test in ${TEST_TO_RUN:-*.test}; do
get_block ARGS < $test | xargs $APK_TEST &> .$test.got
get_block ARGS < $test | xargs $APK_TEST > .$test.got 2>&1
if ! get_block EXPECT < $test | cmp .$test.got &> /dev/null; then
if ! get_block EXPECT < $test | cmp .$test.got > /dev/null 2>&1; then
fail=$((fail+1))
echo "FAIL: $test"
get_block EXPECT < $test | diff -ru - .$test.got

View File

@ -9,7 +9,7 @@ cat version.data | while read a result b rest ; do
fi
done
if [ "$fail" == "0" ]; then
if [ "$fail" = "0" ]; then
echo "OK: version checking works"
fi