Skip to content

Commit

Permalink
make test scripts fail when a test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Mar 27, 2013
1 parent 0eff35b commit ef114dd
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/integration/matlab_and_octave/test_all.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

DATAPATH='../data'
exitcode=0

function test_all () {
datapath="$1"
Expand Down Expand Up @@ -31,6 +32,7 @@ function test_all () {

# thanks to matlab, 1 means ok and 0 means error
if [ "$?" -ne 0 -o "${ans}" -eq 0 ]; then
exitcode=1
echo ERROR
echo ${output}
else
Expand All @@ -55,3 +57,4 @@ else
test_all "$i/*.m"
done
fi
exit $exitcode
4 changes: 2 additions & 2 deletions tests/integration/octave_modular/regression.m
Expand Up @@ -18,8 +18,8 @@

lab=Labels(regression_labels);

if strcmp(regression_name, 'KRR')==1
regression=KRR(regression_tau, kernel, lab);
if strcmp(regression_name, 'KernelRidgeRegression')==1
regression=KernelRidgeRegression(regression_tau, kernel, lab);

elseif strcmp(regression_name, 'LibSVR')==1
regression=LibSVR(regression_C, regression_epsilon, kernel, lab);
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/octave_modular/test_all.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

DATAPATH='../data'
exitcode=0

function test_all () {
datapath=${1}
Expand All @@ -23,6 +24,7 @@ function test_all () {

# thanks to matlab, 1 means ok and 0 means error
if [ ${ans} -eq 0 ]; then
exitcode=1
echo ERROR
# remove octave banner
echo ${output} | grep -v 'GNU Octave'
Expand All @@ -41,3 +43,4 @@ else
test_all "${i}/*.m"
done
fi
exit $exitcode
3 changes: 3 additions & 0 deletions tests/integration/perl_modular/test_all.sh
Expand Up @@ -6,6 +6,7 @@ then
fi

DATAPATH='../data'
exitcode=0

function test_all () {
datapath="$1"
Expand All @@ -27,6 +28,7 @@ function test_all () {
echo 'OK'
else
echo 'ERROR'
exitcode=1
echo $output
fi
done
Expand All @@ -41,3 +43,4 @@ else
test_all "$i/*.m"
done
fi
exit $exitcode
3 changes: 3 additions & 0 deletions tests/integration/python_modular/test_all.sh
Expand Up @@ -6,6 +6,7 @@ then
fi

DATAPATH='../data'
exitcode=0

function test_all () {
datapath="$1"
Expand All @@ -27,6 +28,7 @@ function test_all () {
if [ $ret -eq 0 ] ; then
echo 'OK'
else
exitcode=1
echo 'ERROR'
echo $output
fi
Expand All @@ -42,3 +44,4 @@ else
test_all "$i/*.m"
done
fi
exit $exitcode
4 changes: 4 additions & 0 deletions tests/integration/python_static/test_all.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

DATAPATH='../data'
exitcode=0

[ -z "$PYTHON" ] && PYTHON=python

Expand All @@ -24,6 +25,7 @@ function test_all () {
if [ $ret -eq 0 ] ; then
echo 'OK'
else
exitcode=1
echo 'ERROR'
echo $output
fi
Expand All @@ -39,3 +41,5 @@ else
test_all "$i/*.m"
done
fi

exit $exitcode
3 changes: 3 additions & 0 deletions tests/integration/r_modular/test_all.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

DATAPATH='../data'
exitcode=0

function test_all () {
datapath=${1}
Expand All @@ -22,6 +23,7 @@ function test_all () {

output=`R --no-save --no-restore --no-readline --slave ${file} < test_one.R`
if [ $? -ne 0 ]; then
exitcode=1
echo ERROR
echo ${output}
else
Expand All @@ -40,3 +42,4 @@ else
test_all "${i}/*.m"
done
fi
exit $exitcode
3 changes: 3 additions & 0 deletions tests/integration/r_static/test_all.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

DATAPATH='../data'
exitcode=0

function test_all () {
datapath=${1}
Expand All @@ -23,6 +24,7 @@ function test_all () {

output=`R --no-save --no-restore --no-readline --slave ${file} < test_one.R`
if [ $? -ne 0 ]; then
exitcode=1
echo ERROR
echo ${output}
else
Expand All @@ -42,3 +44,4 @@ else
test_all "${i}/*.m"
done
fi
exit $exitcode

0 comments on commit ef114dd

Please sign in to comment.