|
Revision 1469, 1.3 kB
(checked in by dsugar, 2 years ago)
|
Updates based on relocation of stuff with the merge back into trunk
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
#!/bin/bash |
|---|
| 2 |
|
|---|
| 3 |
STARTDIR=`pwd` |
|---|
| 4 |
|
|---|
| 5 |
INFO=0 |
|---|
| 6 |
|
|---|
| 7 |
for PARAM in $@; do |
|---|
| 8 |
case $PARAM in |
|---|
| 9 |
("-i") |
|---|
| 10 |
INFO=1;; |
|---|
| 11 |
("-h") |
|---|
| 12 |
echo |
|---|
| 13 |
echo Usage: $0 |
|---|
| 14 |
echo -i display info about each test |
|---|
| 15 |
echo -h help; |
|---|
| 16 |
echo; |
|---|
| 17 |
exit; |
|---|
| 18 |
;; |
|---|
| 19 |
esac |
|---|
| 20 |
done; |
|---|
| 21 |
|
|---|
| 22 |
if [ $INFO -eq 0 ]; then |
|---|
| 23 |
# build command line test program if it doesn't exist |
|---|
| 24 |
#if [ ! -e build/com/tresys/framework/compiler/Compiler.java ]; then |
|---|
| 25 |
# make -C libapoljava |
|---|
| 26 |
make -C framework-plugin/libselinuxjava |
|---|
| 27 |
ant -q -f compilerbuild.xml compile |
|---|
| 28 |
#fi; |
|---|
| 29 |
fi; |
|---|
| 30 |
|
|---|
| 31 |
LIBSELINUX=`pwd`/framework-plugin/libselinuxjava/libselinuxjava.so |
|---|
| 32 |
|
|---|
| 33 |
# list of all tests |
|---|
| 34 |
ALLTESTS=`ls test | egrep test[0-9]{4}` |
|---|
| 35 |
declare -a ERRORTESTS |
|---|
| 36 |
|
|---|
| 37 |
# loop through each test directory |
|---|
| 38 |
for TEST in $ALLTESTS; do |
|---|
| 39 |
DIR=test/$TEST |
|---|
| 40 |
echo -n Test: $TEST " " |
|---|
| 41 |
|
|---|
| 42 |
if [ $INFO -eq 0 ]; then |
|---|
| 43 |
if [ ! -e $DIR/test.sh ]; then |
|---|
| 44 |
echo - skipping test |
|---|
| 45 |
ERRORTESTS[${#ERRORTESTS[*]}]=$TEST |
|---|
| 46 |
continue |
|---|
| 47 |
fi; |
|---|
| 48 |
|
|---|
| 49 |
cd $DIR |
|---|
| 50 |
source test.sh |
|---|
| 51 |
cd $STARTDIR |
|---|
| 52 |
if [ $RESULT -ne 0 ]; then |
|---|
| 53 |
ERRORTESTS[${#ERRORTESTS[*]}]=$TEST |
|---|
| 54 |
fi; |
|---|
| 55 |
fi; |
|---|
| 56 |
if [ $INFO -eq 1 ]; then |
|---|
| 57 |
echo -n ",\"" |
|---|
| 58 |
if [ -e $DIR/README ]; then |
|---|
| 59 |
cat $DIR/README |
|---|
| 60 |
else |
|---|
| 61 |
echo -n Missing! |
|---|
| 62 |
fi; |
|---|
| 63 |
echo -n "\"" |
|---|
| 64 |
echo |
|---|
| 65 |
fi; |
|---|
| 66 |
done; |
|---|
| 67 |
|
|---|
| 68 |
if [ $INFO -eq 0 ]; then |
|---|
| 69 |
echo |
|---|
| 70 |
echo |
|---|
| 71 |
# report each test that failed |
|---|
| 72 |
if [ ${#ERRORTESTS} -gt 0 ]; then |
|---|
| 73 |
echo The following tests have errors |
|---|
| 74 |
echo ${ERRORTESTS[@]} |
|---|
| 75 |
else |
|---|
| 76 |
echo All tests ran successfully |
|---|
| 77 |
fi; |
|---|
| 78 |
fi; |
|---|