mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-12 21:56:34 -04:00
Break out some common test code to a separate file.
Next step to refactor remaining tests.
This commit is contained in:
parent
81e4e8bba5
commit
6db23c03b5
19
tests/simple-test.sh
Executable file
19
tests/simple-test.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$srcdir" ]; then
|
||||
srcdir=`dirname $0`
|
||||
fi
|
||||
|
||||
TEST_RESULT=$srcdir/$1
|
||||
shift
|
||||
|
||||
../examples/"$@" 2>&1 | tee tmp.out
|
||||
|
||||
if cmp -s tmp.out $TEST_RESULT.out; then
|
||||
echo "OK"
|
||||
exit 0
|
||||
else
|
||||
echo "FAIL"
|
||||
diff tmp.out $TEST_RESULT.out
|
||||
exit 1
|
||||
fi
|
@ -1,11 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
# success
|
||||
../examples/test1 -r -n mike > tmp.out 2>&1
|
||||
|
||||
if cmp -s tmp.out $srcdir/test1.out; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./simple-test.sh test1 `basename $0 .sh` -r -n mike
|
||||
|
Loading…
x
Reference in New Issue
Block a user