Skip to content

Commit

Permalink
added --reuse-env and --help to runtests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
fivethreeo committed Dec 4, 2010
1 parent cc39694 commit ee813b5
Showing 1 changed file with 42 additions and 17 deletions.
59 changes: 42 additions & 17 deletions runtests.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@
#!/bin/bash
cd tests
echo "setting up test environment (this might take a while)..."
python bootstrap.py
if [ $? != 0 ]; then
echo "bootstrap.py failed"
exit 1
fi
./bin/buildout
if [ $? != 0 ]; then
echo "bin/buildout failed"
exit 1
fi

args=("$@")
num_args=${#args[@]}
index=0

reuse_env=false

while [ "$index" -lt "$num_args" ]
do
if [ "${args[$index]}" = "--failfast" ]; then
failfast="--failfast"

else
suite="cms.${args[$index]}"
fi
case "${args[$index]}" in
"--failfast")
failfast="--failfast"
;;

"--reuse-env")
reuse_env=true
;;

"--help")
echo ""
echo "usage:"
echo " runtests.sh"
echo " or runtests.sh [flags] [testcase]"
echo ""
echo "flags:"
echo " --failfast - abort at first failing test"
echo " --reuse-env - don't run builout, use last built environment"
exit 1
;;

*)
suite="cms.${args[$index]}"
esac
let "index = $index + 1"
done

if [ $reuse_env == false ]; then
echo "setting up test environment (this might take a while)..."
python bootstrap.py
if [ $? != 0 ]; then
echo "bootstrap.py failed"
exit 1
fi
./bin/buildout
if [ $? != 0 ]; then
echo "bin/buildout failed"
exit 1
fi
else
echo "reusing current buildout environment"
fi

if [ "$failfast" ]; then
echo "--failfast supplied, not using xmlrunner."
fi
Expand Down

0 comments on commit ee813b5

Please sign in to comment.