Skip to content

Commit

Permalink
Improved test.sh usability.
Browse files Browse the repository at this point in the history
  • Loading branch information
gildor2 committed Feb 21, 2017
1 parent 908e33e commit 6980f71
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ platform=win32

noorig=0
noasm=0
noc=0
nodll=0
extraargs="--delete --compact"
dllname=zlibwapi32.dll
Expand All @@ -19,12 +20,25 @@ for arg in "$@"; do # using quoted $@ will allow to correctly separate argument
--noasm)
noasm=1
;;
--noc)
noc=1
;;
--noorig)
noorig=1
;;
--nodll)
nodll=1
;;
--c)
noasm=1
nodll=1
noorig=1
;;
--asm)
noc=1
nodll=1
noorig=1
;;
--win64)
platform=win64
dllname=zlibwapi64.dll
Expand All @@ -36,7 +50,15 @@ for arg in "$@"; do # using quoted $@ will allow to correctly separate argument
if [ -d "$arg" ]; then
dir="$arg"
else
echo "Usage: test.sh [path] [--noasm] [--noorig] [--nodll] [--win64] [--level=X]"
cat <<EOF
Usage: test.sh [path] [options]
Options:
--no[asm|c|orig|dll] disable particular target
--c test only C implementation
--asm test only Asm implementation
--win64 test for 64-bit Windows
--level=X select compression level
EOF
exit
fi
esac
Expand All @@ -45,6 +67,7 @@ done
# build all targets with hiding build output
target=vc-$platform
[ "$platform" == "unix" ] && target=linux # shame, "unix" vs "linux"
[ "$platform" == "win64" ] && noasm=1

if ! ./build.sh $target > /dev/null 2>&1; then
echo "Build failed!"
Expand All @@ -67,10 +90,12 @@ function DoTests
fi
fi

if [ "$platform" != "win64" ] && [ $noasm == 0 ]; then
if [ $noasm == 0 ]; then
obj/bin/test-Asm-$platform "$dir" $extraargs $*
fi
obj/bin/test-C-$platform "$dir" $extraargs $*
if [ $noc == 0 ]; then
obj/bin/test-C-$platform "$dir" $extraargs $*
fi
if [ $nodll == 0 ]; then
obj/bin/test-Orig-$platform "$dir" $extraargs --dll=test/dll/$dllname $*
fi
Expand Down

0 comments on commit 6980f71

Please sign in to comment.