Skip to content
Snippets Groups Projects
Commit a278d112 authored by Alex Xu (Hello71)'s avatar Alex Xu (Hello71) Committed by Timo Teräs
Browse files

test: improve posix sh compatibility

parent 984cd3e0
No related branches found
No related tags found
No related merge requests found
Pipeline #92286 passed
......@@ -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" ;\
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment