You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
509 B
30 lines
509 B
#!/bin/bash
|
|
|
|
abort(){
|
|
echo "Run unittest failed" 1>&2
|
|
echo "Please check your code" 1>&2
|
|
exit 1
|
|
}
|
|
|
|
unittest(){
|
|
cd $1 > /dev/null
|
|
if [ -f "setup.sh" ]; then
|
|
sh setup.sh
|
|
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
|
fi
|
|
if [ $? != 0 ]; then
|
|
exit 1
|
|
fi
|
|
find . -name 'tests' -type d -print0 | \
|
|
xargs -0 -I{} -n1 bash -c \
|
|
'python -m unittest discover -v -s {}'
|
|
cd - > /dev/null
|
|
}
|
|
|
|
trap 'abort' 0
|
|
set -e
|
|
|
|
unittest .
|
|
|
|
trap : 0
|