source: trunk/client/servlet/test/src/webservice/run.sh @ 4371

Last change on this file since 4371 was 4371, checked in by olle, 11 years ago

Refs #788. Unix/Linux *.sh shell scripts have the shebang line changed from "#!/bin/sh" to "#!/bin/bash", in order to make the scripts work on Ubunto Linux without explicitly defining the shell.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 992 bytes
Line 
1#!/bin/bash
2. ./config.sh
3
4arg1=$1
5arg2=$2
6
7test()
8{
9 test_file=$1
10 file_name=${test_file##*/}
11 test_name=${file_name%%.*}
12  if [ -e $test_file ]; then
13  title=`head -1 $test_file`
14   test=$title
15 fi
16 case $arg2 in
17    "-v")
18        echo ""
19        echo "TEST [$1] $title"
20      ;;
21     *)
22            ;;
23  esac
24 if [ -e $test_file ]; then
25  if [ -d $test_name ]; then
26   rm -rf $test_name
27  fi
28  mkdir $test_name
29  cd $test_name
30  . ../$test_file
31  cd ..
32 fi
33}
34
35clean()
36{
37    for dir in t*
38    do
39      if [ -d $dir ] && [ "$dir" != "tests" ]; then
40         echo "rm -rf $dir"
41        rm -rf $dir
42      fi
43    done
44}
45
46case $arg1 in
47  clean)
48     clean
49    exit
50    ;;
51  all)
52    for ttt in ./tests/*.sh
53    do
54      test $ttt 
55      sleep 0.5
56    done
57    ;;
58  list)
59    for t in tests/*
60    do 
61      c=`head -1 $t`
62     echo $t $c
63    done
64    ;;
65  *)
66   if [ -e ./tests/t${arg1}.sh ]; then
67     test ./tests/t${arg1}.sh
68   else
69    cat <<EOF
70Usage: $0 [TESTID|all|clean|list] [-v]
71EOF
72   fi
73esac
74
75
76
Note: See TracBrowser for help on using the repository browser.