File: testdir

package info (click to toggle)
taskjuggler 2.3.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,764 kB
  • ctags: 3,700
  • sloc: cpp: 36,852; sh: 12,761; xml: 5,541; perl: 5,207; makefile: 269; python: 258; lisp: 67
file content (89 lines) | stat: -rwxr-xr-x 1,883 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#! /bin/sh

export LANG=en_US
export LC_ALL=en_US
export LC_COLLATE=POSIX

errors=0
export TASKJUGGLER=../../taskjuggler/taskjuggler
if test ! -x $TASKJUGGLER ; then
  export TASKJUGGLER=taskjuggler
else
  export TASKJUGGLER=../$TASKJUGGLER
fi

do_testing()
{
  f=$1
  op=$2
  echo "Running test $f" >> ../log
  $TASKJUGGLER --debug 1 $TJARGS $f 2>> ../log
  if [ $? $op 0 ] ; then
    errors=$(( $errors + 1 ))
    echo "Test $f failed!" | tee -a ../log
  fi
  checkscript=`echo $f | sed s/\\\\\(.*\\\\\).tjp/\\\1.sh/g`
  referenceFile=`echo $f | sed s/\\\\\(.*\\\\\).tjp/\\\1-Reference.tjp/g`
  exportFile=`echo $f | sed s/\\\\\(.*\\\\\).tjp/\\\1-Export.tjp/g`
  if [ -x $checkscript ] ; then
    ./$checkscript 2>&1 >> ../log 
    if [ $? -ne 0 ] ; then
      errors=$(( $errors + 1 ))
      echo "Test $f failed (check script)!" | tee -a ../log
    fi
  fi
  if [ -f $referenceFile ] ; then
    cmp $exportFile $referenceFile 2>> ../log
    if [ $? -ne 0 ] ; then
      errors=$(( $errors + 1 ))
      echo "Test $f failed (Reference file differs)!" | tee -a ../log
      diff -u $referenceFile $exportFile | head -n 20 | tee -a ../log
    else
      rm $exportFile
    fi
  fi
}

test_file()
{
  if [ -f ignorelist ] ; then
    grep -c $f ignorelist > /dev/null
    if [ $? -ne 0 ] ; then
      do_testing $1 $2
    fi
  else  
    do_testing $1 $2
  fi  
}

rm -f log
touch log

touch .timeStamp
sleep 1

TJARGS=""
if [ -f .tjargs ] ; then
  TJARGS=`cat .tjargs`
fi

cd Correct
echo "*** Running tests in Correct..." >> ../log
for f in *.tjp ; do
  test_file $f -ne
done
cd ../Errors
echo "*** Running tests in Errors..." >> ../log
for f in *.tjp ; do
  test_file $f -eq
done
cd ..

# remove all HTML files that are newer than the .timeStamp file
if [ $errors -eq 0 ] ; then
  find . -name "*.html" -newer .timeStamp | xargs /bin/rm -f
fi
/bin/rm -f .timeStamp
 
exit $errors