cryptonas/bin/do_unittests.sh

75 lines
1.6 KiB
Bash
Raw Normal View History

2006-11-06 17:05:00 +01:00
#!/bin/sh
2006-11-06 17:05:00 +01:00
#
# run this script _before_ you do a commit and fix errors before uploading
#
# preparations:
# - add the following lines to /etc/super.tab:
# :global_options relative_path=y
# CryptoBoxRootActionsLocal ./CryptoBoxRootActions cryptobox
#
2006-11-06 17:05:00 +01:00
GETOPT="getopt"
BASE_DIR=$(cd "$(dirname $0)/.."; pwd)
export PYTHONPATH=$BASE_DIR/src
2008-04-06 18:08:34 +02:00
disable_filecheck()
{
sed -i "s/^OVERRIDE_FILECHECK = .*$/OVERRIDE_FILECHECK = True/" "$BASE_DIR/bin/CryptoBoxRootActions"
}
2008-04-06 18:08:34 +02:00
enable_filecheck()
{
sed -i "s/^OVERRIDE_FILECHECK = .*$/OVERRIDE_FILECHECK = False/" "$BASE_DIR/bin/CryptoBoxRootActions"
}
#Using getopt(1) would be the super-thorough way to do this; use the
#quick-and-dirty method instead
# case $1 in
# --clobber=*)
# TEST_DISK=`echo $1 | sed 's/[-a-zA-Z0-9]*=//'`
# ;;
# *)
# ;;
#
#esac
#parse out the remaining command line arguments
## now check that TEST_DISK is not empty and is a block device (more flexibility could possibly be added)
####################################################################3
##Attention!!! Don't check this in with the following variable set!
##
## the "/dev/" prefix is already assumed by the test classes
#CNAS_UTEST_CLOBBER="sdb"
CNAS_UTEST_CLOBBER=""
export CNAS_UTEST_CLOBBER
2006-11-06 17:05:00 +01:00
dest_files=""
while test $# -gt 0
do files="${files} $(cd $(dirname $1); pwd)/$(basename $1)"
shift
done
# chdir to 'bin' - all config settings depend on this
cd "${BASE_DIR}/bin"
disable_filecheck
if test -n "$files"
then # do the specified tests
for a in $files
do testoob -v "$a"
done
else # do all tests
for a in ${BASE_DIR}/src/cryptobox/tests/test.*.py
do testoob -v "$a"
done
fi
2006-11-06 17:05:00 +01:00
enable_filecheck