diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2005-12-01 01:05:12 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2005-12-01 01:05:12 +0000 |
commit | f9c07ec61cb09dde465e02ea35b3cc9f832b369c (patch) | |
tree | af3b2b3cf16e4d121605a92a81a1fce6cb6e40c1 /config_test | |
parent | e5b45d0e143bd3dbfb870cbe9fd33977db1a2b19 (diff) | |
download | monitoring-plugins-f9c07ec61cb09dde465e02ea35b3cc9f832b369c.tar.gz |
Run longer test on redhat for spopen/pthread problem. Allow enable/disable of
pthread fix via configure option
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1292 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'config_test')
-rw-r--r-- | config_test/Makefile | 6 | ||||
-rwxr-xr-x | config_test/run_tests | 40 |
2 files changed, 31 insertions, 15 deletions
diff --git a/config_test/Makefile b/config_test/Makefile index 295696e9..1064d569 100644 --- a/config_test/Makefile +++ b/config_test/Makefile @@ -1,9 +1,11 @@ -all: child_test.c +all: child_test + +child_test: child_test.c gcc -o child_test child_test.c test: - ./run_tests 10 + ./run_tests 10 100 > /dev/null clean: rm -f child_test diff --git a/config_test/run_tests b/config_test/run_tests index e41db232..e7db3cae 100755 --- a/config_test/run_tests +++ b/config_test/run_tests @@ -1,16 +1,30 @@ #!/bin/ksh +# $1 is the number of iterations to run +# If $2 is specified, this is the number of times you run each iteration +# If there is a fail at run, exit 1 +# Prints to stdout # of successes and passes +# Prints to stderr a dot for each run -i=0 -success=0 -fail=0 -while [[ $i -lt $1 ]] ; do - ./child_test - if [[ $? -eq 0 ]] ; then - success=$(($success+1)) - else - fail=$((fail+1)) - fi - i=$(($i+1)) +total_runs=$2 +[[ -z $total_runs ]] && total_runs=1 +run=1 +while [[ $run -le $total_runs ]] ; do + i=0 + success=0 + fail=0 + while [[ $i -lt $1 ]] ; do + ./child_test + if [[ $? -eq 0 ]] ; then + success=$(($success+1)) + else + fail=$((fail+1)) + fi + i=$(($i+1)) + done + print "Success=$success Fail=$fail" + [[ $fail -gt 0 ]] && exit 1 + run=$(($run+1)) + [[ $total_runs -gt 1 ]] && print -u2 -n "." done -print "Success=$success Fail=$fail" -[[ $fail -gt 0 ]] && exit 1 +[[ $total_runs -gt 1 ]] && print -u2 +exit 0 |