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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
|
#!/bin/csh -f
#
# PCTEST - test PPC
#
# Source Version: 2.0
# Software Release #92-0043
#
# include "cpyright.h"
#
set FrontEnd = ""
set DPE = `which pact-dpe`
if ("$DPE" != "") then
if (-e "$DPE[1]") then
source $DPE
endif
endif
if (-e ../manager/noipc) exit(0)
set System = `../manager/system-id`
set BinDir = ../dev/$System/bin
set ERROR = "FALSE"
set FAIL = "NO"
set status = 0
set PCEXEC = "$FrontEnd $BinDir/pcexec"
source ../manager/env-$System
if (-e ../dev/$System/include/ppc.h) then
touch test.error
rm -f pctest.debug
echo `../manager/pwhich pact` >& pctest.debug
echo `../manager/pwhich cc` >>& pctest.debug
echo $BinDir >>& pctest.debug
echo ""
echo "PPC TEST..."
echo ""
echo -n " Building PPC Test Programs ..... "
pact Cstd >& test.error
# START of large loop ++++++++++++++++++++++++++++++++++++++++++++++++++
if ($status != 0) then
echo ""
cat test.error
echo " Can't build Standard PPC Test Programs"
set ERROR = "TRUE"
# ELSE of large loop +++++++++++++++++++++++++++++++++++++++++++++++++++
else
echo "DONE"
unalias ls
set TEST = "cat DISCLAIMER"
echo ""
echo -n " PPC Pipe Test ........."
rm -f pcexec.refi pcexec.refp
$PCEXEC -c 30 -i -p $TEST > pcexec.refp
set PipeStatP = $status
if ($PipeStatP != 0) then
echo ""
echo " Polling test died ($PipeStatP)"
set FAIL = "YES"
endif
$PCEXEC -c 30 -p $TEST > pcexec.refi
set PipeStatI = $status
if ($PipeStatI != 0) then
echo ""
echo " Interrupt driven test died ($PipeStatI)"
set FAIL = "YES"
endif
if ($FAIL == "YES") then
echo " PPC Pipe Test ..... FAILED"
set ERROR = "TRUE"
else
echo " PASSED"
endif
set FAIL = "NO"
echo ""
echo -n " PPC Socket Test ......."
rm -f pcexec.sockp pcexec.socki
$PCEXEC -c 30 -i -s $TEST > pcexec.sockp
set SockStatP = $status
if ($SockStatP != 0) then
echo ""
echo " Polling test died ($SockStatP)"
set FAIL = "YES"
endif
$PCEXEC -c 30 -s $TEST > pcexec.socki
set SockStatI = $status
if ($SockStatI != 0) then
echo ""
echo " Interrupt driven test died ($SockStatI)"
set FAIL = "YES"
endif
if ($FAIL == "YES") then
echo " PPC Socket Test ..... FAILED"
set ERROR = "TRUE"
else
diff pcexec.refi pcexec.socki > pcexec.diffi
set Files = `find . -name "pcexec.diffi" -size 0c -print`
diff pcexec.refp pcexec.sockp > pcexec.diffp
set Files = `find . -name "pcexec.diffp" -size 0c -print`
if ($#Files == 0) then
echo " PPC Socket Test ..... FAILED"
set ERROR = "TRUE"
else
echo " PASSED"
rm pcexec.diff* pcexec.sock*
endif
endif
set FAIL = "NO"
set IsOSF = `uname -s | grep OSF`
set IsParagon = `uname -s | grep Paragon`
set IsSolaris = `grep SOLARIS ../dev/$System/include/scconfig.h`
if (("$IsOSF" == "") && ("$IsParagon" == "") && ("$IsSolaris" == "")) then
echo ""
echo -n " PPC PTY Test .........."
rm -f pcexec.ptyi pcexec.ptyp
$PCEXEC -c 30 -i -t $TEST | tr -d "\015" > pcexec.ptyp
set PtyStatP = $status
if ($PtyStatP != 0) then
if ($PtyStatP != 123) then
echo ""
echo " Polling test died ($PtyStatP)"
else
echo ""
echo " Polling test timed out ($PtyStatP)"
endif
endif
$PCEXEC -c 30 -t $TEST | tr -d "\015" > pcexec.ptyi
set PtyStatI = $status
if ($PtyStatI != 0) then
if ($PtyStatI != 123) then
echo ""
echo " Interrupt driven test died ($PtyStatI)"
else
echo ""
echo " Interrupt driven test timed out ($PtyStatI)"
endif
endif
# NOTE: timeout = exit(123)
# don't consider a timeout a failure
if ((($PtyStatP != 0) && ($PtyStatP != 123)) || \
(($PtyStatI != 0) && ($PtyStatI != 123)) || ) then
echo " PPC PTY Test ..... FAILED"
stty sane
set ERROR = "TRUE"
else if (($PtyStatI == 123) || ($PtyStatP == 123)) then
echo " PPC PTY Test ..... PASSED"
else
diff pcexec.refi pcexec.ptyi > pcexec.diffi
set Files = `find . -name "pcexec.diffi" -size 0c -print`
diff pcexec.refp pcexec.ptyp > pcexec.diffp
set Files = `find . -name "pcexec.diffp" -size 0c -print`
if ($#Files == 0) then
echo ""
echo " File Differences"
echo " PPC PTY Test ..... FAILED"
set ERROR = "TRUE"
else
echo " PASSED"
rm -f pcexec.diff* pcexec.pty* pcexec.ref*
endif
endif
endif
set FAIL = "NO"
echo ""
echo -n " PPC Binary Test ......."
rm -rf pcbtst.res
(echo "hello" ; echo "end") | $BinDir/pcbtst > pcbtst.res
set BinaryStat = $status
if ($BinaryStat != 0) then
if ($BinaryStat != 123) then
echo ""
echo " Binary test died ($BinaryStat)"
else
echo ""
echo " Binary test timed out ($BinaryStat)"
endif
endif
# don't consider a timeout a failure
if ($BinaryStat != 0 && $BinaryStat != 123) then
echo " PPC Binary Test ..... FAILED"
set ERROR = "TRUE"
else if ($BinaryStat == 123) then
echo " PPC Binary Test ..... PASSED"
else
echo " PASSED"
endif
set FAIL = "NO"
echo ""
echo -n " PPC Multiple Test ....."
rm -rf pcmtst.resp
(echo "1 a" ; \
echo "2 b" ; \
echo "3 c" ; \
echo "3 end" ; \
echo "1 end" ; \
echo "2 d" ; \
echo "2 end" ) | $BinDir/pcmtst -c 30 -i -n 3 > pcmtst.resp
set MultipleStatP = $status
if ($MultipleStatP != 0) then
if ($MultipleStatP != 123) then
echo ""
echo " Polling test died ($MultipleStatP)"
else
echo ""
echo " Polling test timed out ($MultipleStatP)"
endif
endif
rm -rf pcmtst.resi
(echo "1 a" ; \
echo "2 b" ; \
echo "3 c" ; \
echo "3 end" ; \
echo "1 end" ; \
echo "2 d" ; \
echo "2 end" ) | $BinDir/pcmtst -c 30 -n 3 > pcmtst.resi
set MultipleStatI = $status
if ($MultipleStatI != 0) then
if ($MultipleStatI != 123) then
echo ""
echo " Interrupt driven test died ($MultipleStatI)"
else
echo ""
echo " Interrupt driven test timed out ($MultipleStatI)"
endif
endif
# NOTE: timeout = exit(123)
# don't consider a timeout a failure
if ((($MultipleStatI != 0) && ($MultipleStatI != 123)) || \
(($MultipleStatP != 0) && ($MultipleStatP != 123)) || ) then
echo " PPC Multiple Test ..... FAILED"
set ERROR = "TRUE"
else if (($MultipleStatI == 123) || ($MultipleStatP == 123)) then
echo " PPC Multiple Test ..... PASSED"
else
echo " PASSED"
rm pcmtst.resi pcmtst.resp
endif
# END of large loop ++++++++++++++++++++++++++++++++++++++++++++++++++++
endif
rm test.error
echo ""
if ($ERROR == "TRUE") then
echo ""
echo "Debug:"
echo " (Which PACT; which CC; current BinDir)"
cat pctest.debug
echo ""
echo "PPC TEST...FAILED"
else
echo "PPC TEST...PASSED"
endif
echo ""
echo " --------------------------------------------------------"
endif
set xstatus = 0
if ($ERROR == "TRUE") then
set xstatus = 1
endif
exit($xstatus)
|