]> scripts.mit.edu Git - wizard.git/blob - tests/all-tests.sh
Move wizard.scripts module to plugins, added hooks accordingly.
[wizard.git] / tests / all-tests.sh
1 #!/bin/bash
2 # takes an app name and a version as arguments
3 cd `dirname $0`
4 bold="`tput -T${TERM:-dumb} bold`"
5 red="`tput -T${TERM:-dumb} setf 4`"
6 green="`tput -T${TERM:-dumb} setf 2`"
7 sgr0="`tput -T${TERM:-dumb} sgr0`"
8 APP="$1"
9 if [ "$APP" == "" ]; then
10     echo "Must specify application and version"
11     exit 1
12 fi
13 for i in $1-*-test.sh; do
14     ./$i "$2"
15
16     if [ $? -eq 0 ] || [ $? -eq 2 ];
17     then
18         echo "${bold}${green}OK${sgr0}"
19         wizard remove "testdir_$(echo "${i%-test.sh}" | tr - _)_$2"
20     else
21         echo "${bold}${red}FAIL${sgr0}"
22     fi
23     echo
24 done