Unit Tests
- Added direct TAP support to run_all via the '--verbose' option. - Disabled regex tests that use \b for Cygwin.
This commit is contained in:
2
AUTHORS
2
AUTHORS
@@ -7,7 +7,7 @@ contributions of the following people:
|
|||||||
John Florian (Contributing Author)
|
John Florian (Contributing Author)
|
||||||
Cory Donnelly (Contributing Author)
|
Cory Donnelly (Contributing Author)
|
||||||
Johannes Schlatow (Contributing Author)
|
Johannes Schlatow (Contributing Author)
|
||||||
Dirk Deimeke (Technical Advisor & Marketing)
|
Dirk Deimeke (Technical Advisor & Evangelist)
|
||||||
Wim Schuermann (Contributing Author)
|
Wim Schuermann (Contributing Author)
|
||||||
Owen Clarke (Contributing Author)
|
Owen Clarke (Contributing Author)
|
||||||
Louis-Claude Canon (Contributing Author)
|
Louis-Claude Canon (Contributing Author)
|
||||||
|
|||||||
58
test/run_all
58
test/run_all
@@ -1,22 +1,35 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
date > all.log
|
if [ x"$1" = x"--verbose" ];
|
||||||
|
then
|
||||||
|
for i in *.t *.t.exe
|
||||||
|
do
|
||||||
|
echo '#' $i
|
||||||
|
./$i > test.log 2>&1
|
||||||
|
while read LINE
|
||||||
|
do
|
||||||
|
echo $LINE
|
||||||
|
done < test.log
|
||||||
|
rm test.log
|
||||||
|
done
|
||||||
|
else
|
||||||
|
date > all.log
|
||||||
|
|
||||||
# Perl is used here to get the time in seconds
|
# Perl is used here to get the time in seconds
|
||||||
# because 'date +%s' isn't supported on Solaris.
|
# because 'date +%s' isn't supported on Solaris.
|
||||||
STARTEPOCH=`perl -e 'print time'`
|
STARTEPOCH=`perl -e 'print time'`
|
||||||
|
|
||||||
VRAMSTEG=`which vramsteg`
|
VRAMSTEG=`which vramsteg`
|
||||||
BAR=0
|
BAR=0
|
||||||
if [ -x "$VRAMSTEG" ]; then
|
if [ -x "$VRAMSTEG" ]; then
|
||||||
BAR=1
|
BAR=1
|
||||||
COUNT=0
|
COUNT=0
|
||||||
TOTAL=`ls *.t | wc -l`
|
TOTAL=`ls *.t | wc -l`
|
||||||
START=`$VRAMSTEG --now`
|
START=`$VRAMSTEG --now`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in *.t *.t.exe
|
for i in *.t *.t.exe
|
||||||
do
|
do
|
||||||
echo '#' $i >>all.log
|
echo '#' $i >>all.log
|
||||||
|
|
||||||
if [ $BAR -eq 1 ]; then
|
if [ $BAR -eq 1 ]; then
|
||||||
@@ -25,18 +38,19 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
./$i >> all.log 2>&1
|
./$i >> all.log 2>&1
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $BAR -eq 1 ]; then
|
if [ $BAR -eq 1 ]; then
|
||||||
$VRAMSTEG --remove
|
$VRAMSTEG --remove
|
||||||
|
fi
|
||||||
|
|
||||||
|
date >> all.log
|
||||||
|
|
||||||
|
ENDEPOCH=`perl -e 'print time'`
|
||||||
|
RUNTIME=`expr $ENDEPOCH - $STARTEPOCH`
|
||||||
|
|
||||||
|
printf "Pass: %5d\n" `grep -c '^ok' all.log`
|
||||||
|
printf "Fail: %5d\n" `grep -c '^not' all.log`
|
||||||
|
printf "Skipped: %5d\n" `grep -c '^skip' all.log`
|
||||||
|
printf "Runtime: %5d seconds\n" $RUNTIME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
date >> all.log
|
|
||||||
|
|
||||||
ENDEPOCH=`perl -e 'print time'`
|
|
||||||
RUNTIME=`expr $ENDEPOCH - $STARTEPOCH`
|
|
||||||
|
|
||||||
printf "Pass: %5d\n" `grep -c '^ok' all.log`
|
|
||||||
printf "Fail: %5d\n" `grep -c '^not' all.log`
|
|
||||||
printf "Skipped: %5d\n" `grep -c '^skip' all.log`
|
|
||||||
printf "Runtime: %5d seconds\n" $RUNTIME
|
|
||||||
|
|||||||
@@ -88,13 +88,12 @@ int main (int argc, char** argv)
|
|||||||
ut.ok (r9.match (start, end, text), "e there are matches");
|
ut.ok (r9.match (start, end, text), "e there are matches");
|
||||||
ut.is (start.size (), (size_t) 6, "e == 6 matches");
|
ut.is (start.size (), (size_t) 6, "e == 6 matches");
|
||||||
|
|
||||||
#ifdef DARWIN
|
#if defined(DARWIN) || defined(CYGWIN)
|
||||||
text = "this is the end.";
|
text = "this is the end.";
|
||||||
ut.pass (text + " =~ /\\bthe/");
|
ut.pass (text + " =~ /\\bthe/");
|
||||||
ut.pass (text + " =~ /the\\b/");
|
ut.pass (text + " =~ /the\\b/");
|
||||||
ut.pass (text + " =~ /\\bthe\\b/");
|
ut.pass (text + " =~ /\\bthe\\b/");
|
||||||
#else
|
#elif defined(SOLARIS)
|
||||||
#ifdef SOLARIS
|
|
||||||
RX r10 ("\\<the");
|
RX r10 ("\\<the");
|
||||||
text = "this is the end.";
|
text = "this is the end.";
|
||||||
ut.ok (r10.match (text), text + " =~ /\\<the/");
|
ut.ok (r10.match (text), text + " =~ /\\<the/");
|
||||||
@@ -114,7 +113,6 @@ int main (int argc, char** argv)
|
|||||||
|
|
||||||
RX r12 ("\\bthe\\b");
|
RX r12 ("\\bthe\\b");
|
||||||
ut.ok (r12.match (text), text + " =~ /\\bthe\\b/");
|
ut.ok (r12.match (text), text + " =~ /\\bthe\\b/");
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user