Skip to content

Commit

Permalink
Bug TW-1296
Browse files Browse the repository at this point in the history
- TW-1296 make test/run_all exit with non-zero code if a test fail (thanks to
          Jakub Wilk).
  • Loading branch information
pbeckingham committed Apr 5, 2014
1 parent 3d4cf63 commit 424405d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ the following people:
The following submitted code, packages or analysis, and deserve special thanks:

Pietro Cerutti
Jakub Wilk

Thanks to the following, who submitted detailed bug reports and excellent
suggestions:
Expand Down
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

1.0.0 ()
- TW-1296 make test/run_all exit with non-zero code if a test fail (thanks to
Jakub Wilk).
- Converted to MIT license.
- Bug: UTF8 strings were assumed to be ASCII and were incorrectly truncated
at the right margin.
Expand Down
9 changes: 6 additions & 3 deletions test/run_all
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /bin/sh

rc=0
if [ x"$1" = x"--verbose" ];
then
for i in ./*.t
Expand All @@ -8,10 +9,11 @@ then
$i > test.log 2>&1
while read LINE
do
echo $LINE
done < test.log
echo "$LINE"
done < test.log || rc=1
rm test.log
done
exit $rc
else
date > all.log

Expand All @@ -37,7 +39,7 @@ else
COUNT=`expr $COUNT + 1`
fi

$i >> all.log 2>&1
$i >> all.log 2>&1 || rc=1
done

if [ $BAR -eq 1 ]; then
Expand All @@ -53,4 +55,5 @@ else
printf "Fail: %5d\n" `grep -c '^not' all.log`
printf "Skipped: %5d\n" `grep -c '^skip' all.log`
printf "Runtime: %5d seconds\n" $RUNTIME
exit $rc
fi
5 changes: 3 additions & 2 deletions test/test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
// VITapi - UI helper library that controls Visuals, Input and Terminals.
//
// Copyright 2006 - 2014, Göteborg Bit Factory.
// Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -29,6 +28,7 @@
#include <iomanip>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <test.h>

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -85,6 +85,7 @@ UnitTest::~UnitTest ()
<< " skipped. "
<< std::setprecision (3) << percentPassed
<< "% passed.\n";
exit (_failed > 0);
}

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 424405d

Please sign in to comment.