tests/syntax/identifier/runtests
author greg
Fri, 05 Dec 2008 16:22:15 +0100
changeset 156 6b16b7f8b527
parent 108 f9e001952488
child 258 d7d92b2f87e9
permissions -rwxr-xr-x
Warning conditions on win32 fixed
108
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     1
#!/bin/bash
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     2
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     3
# assume no error to start with...
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     4
error=0
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     5
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     6
for ff in `ls *.test`
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     7
do
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     8
  for id in `cat $ff | grep "^#" | sed "s/#[^ ]*//g"`
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
     9
  do
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    10
	sed s/XXXX/$id/g $ff > $ff"_"$id.iec
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    11
	if `../../../iec2iec $ff"_"$id.iec -I ../../../lib > $ff"_"$id.out 2>$ff"_"$id.err`
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    12
		# TODO before deciding test is success [OK]
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    13
		#       - test whether xxx.out has size <> 0
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    14
		#       - test whether xxx.err has size == 0
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    15
		#       - (?) test whether xxx.out2 is identical to xxx.out
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    16
		#       - (?) test whether xxx.err2 has size == 0
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    17
		#       - perhaps produce a [WARN] instead of [ERROR] in cases of (?)
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    18
	  then echo "[ O K ]   " $ff "->" $id
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    19
	  else echo "[ERROR]   " $ff "->" $id; error=1
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    20
	fi
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    21
#	../../../iec2iec $ff"_"$id.out -I ../../../lib > $ff"_"$id.out2 2>$ff"_"$id.err2
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    22
  done
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    23
done
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    24
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    25
echo
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    26
if `test $error = 1`
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    27
  then echo "FAILURE -> At least one of the tests failed!"
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    28
  else echo "SUCCESS -> All tests passed!"
f9e001952488 Regression tests. Test correct parsing of identifiers.
mario
parents:
diff changeset
    29
fi