mirror of https://github.com/ntop/n2n.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
838 B
41 lines
838 B
3 years ago
|
#!/bin/sh
|
||
|
#
|
||
|
# This expects to find the tests in the tools dir and the expected results
|
||
|
# in the tests dir.
|
||
|
|
||
|
TESTS="
|
||
3 years ago
|
tests-auth
|
||
3 years ago
|
tests-compress
|
||
|
tests-elliptic
|
||
|
tests-hashing
|
||
|
tests-transform
|
||
|
tests-wire
|
||
|
"
|
||
|
|
||
|
TOOLSDIR=tools
|
||
|
TESTDATA=tests
|
||
|
|
||
|
# Allow both dirs be overidden
|
||
|
[ -n "$1" ] && TOOLSDIR="$1"
|
||
|
[ -n "$2" ] && TESTDATA="$2"
|
||
|
|
||
|
# Confirm we have all the tools and data
|
||
|
for i in $TESTS; do
|
||
3 years ago
|
if [ ! -e "$TOOLSDIR/$i" ]; then
|
||
3 years ago
|
echo "Could not find test $TOOLSDIR/$i"
|
||
|
exit 1
|
||
|
fi
|
||
3 years ago
|
if [ ! -e "$TESTDATA/$i.expected" ]; then
|
||
3 years ago
|
echo "Could not find testdata $TESTDATA/$i.expected"
|
||
|
exit 1
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
# Actually run the tests
|
||
|
set -e
|
||
|
for i in $TESTS; do
|
||
|
echo "$TOOLSDIR/$i >$TESTDATA/$i.out"
|
||
3 years ago
|
"$TOOLSDIR/$i" >"$TESTDATA/$i.out"
|
||
|
cmp "$TESTDATA/$i.expected" "$TESTDATA/$i.out"
|
||
3 years ago
|
done
|