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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
#!/bin/csh -f
#
# SCTEST - test SCORE
#
#1
#2
set System = `../manager/system-id`
set BinDir = ../dev/$System/bin
set ERROR = "FALSE"
set FAIL = "NO"
set status = 0
source ../manager/env-$System
if (-e ../dev/$System/include/scstd.h) then
touch test.error
rm -f sctest.debug
echo `../manager/pwhich pact` >& sctest.debug
echo `../manager/pwhich cc` >>& sctest.debug
echo "BinDir = $BinDir" >>& sctest.debug
echo ""
echo "SCORE TEST..."
echo ""
echo -n " Building SCORE Tests ....."
pact compre >& test.error
if ($status != 0) then
echo ""
cat test.error
echo " Can't build SCORE Test Programs"
set ERROR = "TRUE"
else
echo " DONE"
echo ""
echo -n " SCORE Test #1 ....."
$BinDir/tscctl > tscctl.res
if ($status == 0) then
echo " PASSED"
else
echo ""
echo " SCORE Test #1 ..... FAILED"
set ERROR = "TRUE"
endif
echo ""
echo -n " SCORE Test #2 ....."
$BinDir/tscctla > tscctla.res
if ($status == 0) then
echo " PASSED"
else
echo ""
echo " SCORE Test #2 ..... FAILED"
set ERROR = "TRUE"
endif
echo ""
echo -n " SCORE Test #3 ....."
$BinDir/tscstr > tscstr.res
if ($status == 0) then
echo " PASSED"
else
echo ""
echo " SCORE Test #3 ..... FAILED"
set ERROR = "TRUE"
endif
rm ts*.res
echo ""
echo " SCORE HASH Test ....."
pact ha >& test.error
if ($status != 0) then
echo " ERROR Building HASH Test Program"
cat test.error
echo " SCORE HASH Test ............. FAILED"
set ERROR = "TRUE"
else
$BinDir/scatst
if ($status == 0) then
echo " SCORE HASH Test ............. PASSED"
else
echo " SCORE HASH Test ............. FAILED"
set ERROR = "TRUE"
endif
endif
echo ""
echo -n " SCORE Lexical Scan Test ....."
pact scan >& test.error
if ($status != 0) then
echo ""
cat test.error
echo " ERROR Building Lexical Scan Tests"
echo " SCORE Lexical Scan Test ..... FAILED"
set ERROR = "TRUE"
else
$BinDir/sclsts sclsts.src > sclsts.res
diff sclsts.res sclsts.res.ref > sclsts.res.diff
set Files = `find . -name "sclsts.res.diff" -size 0 -print`
if ($#Files == 0) then
echo ""
echo " SCORE Lexical Scan Test ..... FAILED"
set ERROR = "TRUE"
else
echo " PASSED"
endif
rm -f sclsts.res.diff
endif
endif
rm test.error
echo ""
if ($ERROR == "TRUE") then
echo ""
echo "Debug:"
cat sctest.debug
echo ""
echo "SCORE TEST...FAILED"
else
echo "SCORE TEST...PASSED"
endif
echo ""
echo " --------------------------------------------------------"
endif
set xstatus = 0
if ($ERROR == "TRUE") then
set xstatus = 1
endif
exit($xstatus)
|