[go: up one dir, main page]

File: dotest

package info (click to toggle)
chpp 0.3.4-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,228 kB
  • ctags: 5,154
  • sloc: ansic: 30,186; cpp: 575; sh: 500; makefile: 314; yacc: 265; asm: 261; lex: 64
file content (41 lines) | stat: -rwxr-xr-x 610 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# -*- ksh -*-

someerror=0

for testname in `cat tests`
do
  cd $testname
  rm -f actual.out actual.err
  ../../../chpp $testname.txt >actual.out 2>actual.err

  error=0
  diff expected.out actual.out >/dev/null
  if [ $? -ne 0 ] 
  then
    error=1
  fi
  diff expected.err actual.err >/dev/null
  if [ $? -ne 0 ]
  then
    error=1
  fi

  if [ $error -eq 0 ]
  then
    echo test $testname passed
    rm -f actual.out actual.err
  else
    echo test $testname failed
    someerror=1
  fi

  cd ..
done

if [ $someerror -eq 0 ]
then
  echo --- all tests passed
else
  echo --- some tests failed
fi