diff --git a/test/README b/test/README index 0c34d561..e65ab4c3 100644 --- a/test/README +++ b/test/README @@ -1,8 +1,9 @@ -Some test cases: -With and without xmldb_rpc: -set a list entry -set a nested entry -Completion -validate with missing mandatory variable -commit -delete all \ No newline at end of file +This directory contains testing code for clixon and the example +routing application: + clixon A top-level script clones clixon in /tmp and starts all.sh + You can _copy_ this file (review it) and place as cron script + all.sh Run through all tests named 'test*.sh' in this directory. + Therefore, if you place a test in this directory matching + 'test*.sh' it will be run automatically. + test1.sh First test + test2.sh Second test,... diff --git a/test/clixon b/test/clixon index 2fc9be73..749d754c 100755 --- a/test/clixon +++ b/test/clixon @@ -1,55 +1,58 @@ #!/bin/sh +# Top-level cron scripts. Add this to (for example) /etc/cron.daily + +err(){ + testname=$1 + errcode=$2 + echo "Error in [$testname]" + logger "CLIXON: Error in [$testname]" + exit $errcode +} + # cd to working dir cd /tmp if [ $# -ne 0 ]; then - echo "usage: $0" - exit 1 + err "usage: $0" 0 fi rm -rf clixon git clone https://github.com/clicon/clixon.git if [ $? -ne 0 ]; then - echo "Error in git clone" - exit 1 + err "git clone" 1 fi cd clixon CFLAGS=-Werror ./configure if [ $? -ne 0 ]; then - echo "Error in configure" - exit 1 + err "configure" 2 fi make if [ $? -ne 0 ]; then - echo "Error in make" - exit 1 + err "make" 3 fi sudo make install if [ $? -ne 0 ]; then - echo "Error in make install" - exit 1 + err "make install" 4 fi sudo make install-include if [ $? -ne 0 ]; then - echo "Error in make install-include" + err "make install include" 5 exit 1 fi cd example make if [ $? -ne 0 ]; then - echo "Error in make" - exit 1 + err "make example" 6 fi sudo make install if [ $? -ne 0 ]; then - echo "Error in make install" - exit 1 + err "make install example" 7 fi cd ../test #./all.sh (cd /home/olof/src/clixon/test; ./all.sh) errcode=$? if [ $errcode -ne 0 ]; then - echo "test error" - exit $errcode + err "test" $errcode fi cd ../.. rm -rf clixon +logger "CLIXON: tests OK"