auto scripts
This commit is contained in:
parent
2b254e5e67
commit
4b19798b58
2 changed files with 29 additions and 25 deletions
17
test/README
17
test/README
|
|
@ -1,8 +1,9 @@
|
||||||
Some test cases:
|
This directory contains testing code for clixon and the example
|
||||||
With and without xmldb_rpc:
|
routing application:
|
||||||
set a list entry
|
clixon A top-level script clones clixon in /tmp and starts all.sh
|
||||||
set a nested entry
|
You can _copy_ this file (review it) and place as cron script
|
||||||
Completion
|
all.sh Run through all tests named 'test*.sh' in this directory.
|
||||||
validate with missing mandatory variable
|
Therefore, if you place a test in this directory matching
|
||||||
commit
|
'test*.sh' it will be run automatically.
|
||||||
delete all
|
test1.sh First test
|
||||||
|
test2.sh Second test,...
|
||||||
|
|
|
||||||
37
test/clixon
37
test/clixon
|
|
@ -1,55 +1,58 @@
|
||||||
#!/bin/sh
|
#!/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 to working dir
|
||||||
cd /tmp
|
cd /tmp
|
||||||
if [ $# -ne 0 ]; then
|
if [ $# -ne 0 ]; then
|
||||||
echo "usage: $0"
|
err "usage: $0" 0
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
rm -rf clixon
|
rm -rf clixon
|
||||||
git clone https://github.com/clicon/clixon.git
|
git clone https://github.com/clicon/clixon.git
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in git clone"
|
err "git clone" 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
cd clixon
|
cd clixon
|
||||||
CFLAGS=-Werror ./configure
|
CFLAGS=-Werror ./configure
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in configure"
|
err "configure" 2
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
make
|
make
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in make"
|
err "make" 3
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
sudo make install
|
sudo make install
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in make install"
|
err "make install" 4
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
sudo make install-include
|
sudo make install-include
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in make install-include"
|
err "make install include" 5
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cd example
|
cd example
|
||||||
make
|
make
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in make"
|
err "make example" 6
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
sudo make install
|
sudo make install
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error in make install"
|
err "make install example" 7
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
cd ../test
|
cd ../test
|
||||||
#./all.sh
|
#./all.sh
|
||||||
(cd /home/olof/src/clixon/test; ./all.sh)
|
(cd /home/olof/src/clixon/test; ./all.sh)
|
||||||
errcode=$?
|
errcode=$?
|
||||||
if [ $errcode -ne 0 ]; then
|
if [ $errcode -ne 0 ]; then
|
||||||
echo "test error"
|
err "test" $errcode
|
||||||
exit $errcode
|
|
||||||
fi
|
fi
|
||||||
cd ../..
|
cd ../..
|
||||||
rm -rf clixon
|
rm -rf clixon
|
||||||
|
logger "CLIXON: tests OK"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue