| 1 |
!============================<Start of Master Script>=========================== |
| 2 |
! |
| 3 |
! FUNNELWEB MASTER TEST SCRIPT |
| 4 |
! ============================ |
| 5 |
! This is the master FunnelWeb test script. |
| 6 |
! To test FunnelWeb: |
| 7 |
! 1. Create the following directory tree: |
| 8 |
! <anyname> |
| 9 |
! scripts - A directory containing .fws scripts. |
| 10 |
! tests - A directory containing .fw test files. |
| 11 |
! results - An empty directory to receive results of testing. |
| 12 |
! answers - A directory containing the correct answers. |
| 13 |
! 2. Modify the "root test directory" section of this script as described. |
| 14 |
! 3. Ensure that all of the directories and files are on Read/Write access. |
| 15 |
! 4. Set default to the "scripts" directory. |
| 16 |
! 5. Invoke FunnelWeb with the "+k" option. |
| 17 |
! 6. Give the command "execute master.fws". |
| 18 |
! 7. The test should last for a few minutes. |
| 19 |
! 8. Read the test summary on the console at the end of the test. |
| 20 |
! |
| 21 |
! Notes on Script Mechanics |
| 22 |
! ------------------------- |
| 23 |
! * FunnelWeb predefines "$/" to be the character that separates |
| 24 |
! directory specifications from file names on whatever machine it is |
| 25 |
! running on. (e.g. Mac=":", Sun="/", Vax="]", PC="\"). |
| 26 |
|
| 27 |
write "" |
| 28 |
write "FUNNELWEB TEST SCRIPT" |
| 29 |
write "=====================" |
| 30 |
write "This FunnelWeb shellscript applies FunnelWeb to a suite of test files." |
| 31 |
write "The result is a differences report comparing the result files of this" |
| 32 |
write "run with a predefined set of correct "answer" files." |
| 33 |
write "" |
| 34 |
write "Do not be alarmed by errors occurring during the testing as these" |
| 35 |
write "are a consequence of tests of FunnelWeb's detection of various errors." |
| 36 |
write "" |
| 37 |
write "This script cleans up files lying around before testing, so if" |
| 38 |
write "it fails for some reason, you can run it again without having." |
| 39 |
write "to worry about cleaning up after the results of the previous run." |
| 40 |
write "" |
| 41 |
write "This script takes about 10 minutes to run on a 1 MIP machine." |
| 42 |
write "Here we go!" |
| 43 |
write "" |
| 44 |
! |
| 45 |
! Define Symbol For The Root Test Directory |
| 46 |
! ----------------------------------------- |
| 47 |
! IMPORTANT: THIS DEFINITION IS ALL YOU HAVE TO CHANGE TO GET THIS |
| 48 |
! SCRIPT WORKING ON YOUR MACHINE. |
| 49 |
! The script substitution variable <dollar>R must point to the root |
| 50 |
! directory <anyname> (see above). Here are some examples of definitions |
| 51 |
! of <dollar>R on various machines onto which FunnelWeb has been ported. |
| 52 |
|
| 53 |
!SUN: define R "/usr2/users/ross/fwdir/" |
| 54 |
!VMS: define R "$$USERS:[ROSS.FWDIR." |
| 55 |
!PC : define R "\fwdir\" |
| 56 |
!Mac: define R "fatdisk:fwdir:" |
| 57 |
|
| 58 |
! Place your definition here. |
| 59 |
define R "current:cprogramming:funnelweb:" |
| 60 |
|
| 61 |
! Define Symbols for Test Directories |
| 62 |
! ----------------------------------- |
| 63 |
! S - The directory containing the .fws FunnelWeb test scripts. |
| 64 |
! I - The directory containing the .fw input files. |
| 65 |
! O - The directory where all the test output goes. |
| 66 |
! A - The directory containing all the correct answers. |
| 67 |
! D - The differences file. |
| 68 |
define S "$Rscripts$/" |
| 69 |
define I "$Rtests$/" |
| 70 |
define O "$Rresults$/" |
| 71 |
define A "$Ranswers$/" |
| 72 |
define D "$Rresults$/0testres.dif" |
| 73 |
|
| 74 |
! Set FunnelWeb Options Default |
| 75 |
! ----------------------------- |
| 76 |
! The following options remain as default for all the runs. |
| 77 |
! The only two options turned on are +c100 and +b7. |
| 78 |
! The sub-scripts turn on the options they need explicitly. |
| 79 |
! -f No input file specified. |
| 80 |
! -j No journal file. |
| 81 |
! =i..Include files come from the input directory. |
| 82 |
! -o No product file(s). |
| 83 |
! -t No typeset file. |
| 84 |
! -l No Listing file. |
| 85 |
! -d No deletion of output files. |
| 86 |
! +c100 No suppression of listing in listing file. |
| 87 |
! -q Messages to screen. |
| 88 |
! -x No default script file to execute. |
| 89 |
! -w No limit on product file line length imposed by command line. |
| 90 |
! -k No interactive mode. |
| 91 |
! -b1 No dump of input file map. |
| 92 |
! -b2 No dump of line list. |
| 93 |
! -b3 No dump of token list. |
| 94 |
! -b4 No dump of macro table. |
| 95 |
! -b5 No dump of document list. |
| 96 |
! -b6 No dump of timing results. |
| 97 |
! +b7 DONT write anything non-deterministic. |
| 98 |
set -f -j =i$I -o -t -l -d +c100 -q -x -w -k -b123456 +b7 |
| 99 |
|
| 100 |
! Delete any Old Differences File |
| 101 |
! ------------------------------- |
| 102 |
eneo $D |
| 103 |
|
| 104 |
! Zero the Difference Summary Counters |
| 105 |
! ------------------------------------ |
| 106 |
! This is necessary in case the user runs this script twice in one session. |
| 107 |
diffzero |
| 108 |
|
| 109 |
! Clean Test Scripts |
| 110 |
! ------------------ |
| 111 |
! When text files are copied from one machine to another, they can sometimes |
| 112 |
! end up with end-of-line characters that are incorrect for the target machine. |
| 113 |
! The following commands clean up the sub-scripts that we are about to invoke. |
| 114 |
fixeols $Stest_ld.fws |
| 115 |
fixeols $Stest_l.fws |
| 116 |
fixeols $Stest_lo.fws |
| 117 |
fixeols $Stest_lt.fws |
| 118 |
fixeols $Stest_lot.fws |
| 119 |
fixeols $Stest_lo2.fws |
| 120 |
|
| 121 |
! Generate Tricky Test Files |
| 122 |
! -------------------------- |
| 123 |
! This process is a bit messy and requires operations similar to those in the |
| 124 |
! other sub-scripts (test_ld.fws...), and so I have placed it all in |
| 125 |
! test_gen.fws. |
| 126 |
execute $Stest_gen.fws |
| 127 |
|
| 128 |
! Clean up the Include Files |
| 129 |
! -------------------------- |
| 130 |
! The test scripts all "purify" their file arguments by running them through |
| 131 |
! the "fixeols" command. However, the include files aren't automated in this |
| 132 |
! way, so we have to do them here explicitly. |
| 133 |
fixeols $Isc13a.fwi |
| 134 |
fixeols $Isc13b.fwi |
| 135 |
fixeols $Isc13c.fwi |
| 136 |
fixeols $Isc13d.fwi |
| 137 |
fixeols $Isc13e.fwi |
| 138 |
fixeols $Isc13f.fwi |
| 139 |
fixeols $Isc15a.fwi |
| 140 |
fixeols $Itg08a.fwi |
| 141 |
fixeols $Iex09a.fwi |
| 142 |
fixeols $Iex10a.fwi |
| 143 |
|
| 144 |
! Skip Some Tests |
| 145 |
! --------------- |
| 146 |
! If you are debugging some tests, you may wish to move the "here" command |
| 147 |
! further down in the testing so as to skip to the desired tests. |
| 148 |
! X must be defined because FunnelWeb expands command lines even while skipping |
| 149 |
! and generates a "leading spaces" error if X is not defined to be non-blank. |
| 150 |
define X "!" |
| 151 |
skipto |
| 152 |
here |
| 153 |
|
| 154 |
! Test Scanner and Parser |
| 155 |
! ----------------------- |
| 156 |
define X "execute $Stest_ld.fws" |
| 157 |
! Special cases: |
| 158 |
! sc01 does not exist (test of non-existence input file). |
| 159 |
! sc09 contains control characters that we don't want FIXEOLS to frob. |
| 160 |
$X sc01 ! |
| 161 |
$X sc02 |
| 162 |
$X sc03 |
| 163 |
$X sc04 |
| 164 |
$X sc05 |
| 165 |
$X sc06 |
| 166 |
$X sc07 |
| 167 |
$X sc08 |
| 168 |
$X sc09 ! |
| 169 |
$X sc10 |
| 170 |
$X sc11 |
| 171 |
$X sc12 |
| 172 |
$X sc13 |
| 173 |
$X sc14 |
| 174 |
$X sc15 |
| 175 |
$X sc16 |
| 176 |
$X sc17 |
| 177 |
$X sc18 |
| 178 |
$X sc19 |
| 179 |
$X sc20 |
| 180 |
$X sc21 |
| 181 |
$X sc22 |
| 182 |
$X sc23 |
| 183 |
$X sc24 |
| 184 |
$X sc25 |
| 185 |
$X sc26 |
| 186 |
$X sc27 |
| 187 |
$X sc28 |
| 188 |
$X sc29 |
| 189 |
|
| 190 |
$X pr01 |
| 191 |
$X pr02 |
| 192 |
$X pr03 |
| 193 |
$X pr04 |
| 194 |
$X pr05 |
| 195 |
$X pr06 |
| 196 |
$X pr07 |
| 197 |
$X pr08 |
| 198 |
$X pr09 |
| 199 |
$X pr10 |
| 200 |
$X pr11 |
| 201 |
|
| 202 |
! Test Analyser |
| 203 |
! ------------- |
| 204 |
define X "execute $Stest_l.fws" |
| 205 |
$X an01 |
| 206 |
$X an02 |
| 207 |
$X an03 |
| 208 |
$X an04 |
| 209 |
$X an05 |
| 210 |
|
| 211 |
! Test Tangle |
| 212 |
! ----------- |
| 213 |
define X "execute $Stest_lo.fws" |
| 214 |
$X tg01 |
| 215 |
$X tg02 |
| 216 |
$X tg03 |
| 217 |
$X tg04 |
| 218 |
$X tg05 |
| 219 |
$X tg06 |
| 220 |
$X tg07 |
| 221 |
$X tg08 |
| 222 |
$X tg09 |
| 223 |
$X tg10 |
| 224 |
|
| 225 |
! Test Weave |
| 226 |
! ---------- |
| 227 |
define X "execute $Stest_lt.fws" |
| 228 |
$X wv01 |
| 229 |
$X wv02 |
| 230 |
$X wv03 |
| 231 |
$X wv04 |
| 232 |
$X wv05 |
| 233 |
define X "execute $Stest_lt2.fws" |
| 234 |
$X wv06 |
| 235 |
define X "execute $Stest_lt.fws" |
| 236 |
$X wv07 |
| 237 |
|
| 238 |
! Examples in User Manual Tutorial |
| 239 |
! -------------------------------- |
| 240 |
define X "execute $Stest_lo.fws" |
| 241 |
$X ex01 |
| 242 |
$X ex02 |
| 243 |
define X "execute $Stest_l.fws" |
| 244 |
$X ex03 |
| 245 |
define X "execute $Stest_lo.fws" |
| 246 |
$X ex04 |
| 247 |
$X ex05 |
| 248 |
$X ex06 |
| 249 |
$X ex07 |
| 250 |
$X ex08 |
| 251 |
$X ex09 |
| 252 |
$X ex10 |
| 253 |
|
| 254 |
define X "execute $Stest_lt.fws" |
| 255 |
$X ex11 |
| 256 |
$X ex12 |
| 257 |
$X ex13 |
| 258 |
$X ex14 |
| 259 |
$X ex15 |
| 260 |
|
| 261 |
define X "execute $Stest_lot.fws" |
| 262 |
$X ex16 |
| 263 |
|
| 264 |
! Examples in Hints Chapter |
| 265 |
! ------------------------- |
| 266 |
define X "execute $Stest_lo.fws" |
| 267 |
$X hi01 |
| 268 |
$X hi02 |
| 269 |
$X hi03 |
| 270 |
$X hi04 |
| 271 |
$X hi05 |
| 272 |
define X "execute $Stest_lo2.fws" |
| 273 |
$X hi06 |
| 274 |
$X hi07 |
| 275 |
define X "execute $Stest_lo.fws" |
| 276 |
$X hi08 |
| 277 |
$X hi09 |
| 278 |
$X hi10 |
| 279 |
|
| 280 |
! Final Test Summary |
| 281 |
! ------------------ |
| 282 |
write "" |
| 283 |
write "" |
| 284 |
write "The FunnelWeb test suite script has successfully completed." |
| 285 |
write "" |
| 286 |
diffsummary |
| 287 |
write "" |
| 288 |
write "If the differences summary above gives Different=0, then FunnelWeb" |
| 289 |
write "has passed the test suite and is ready for use." |
| 290 |
write "" |
| 291 |
write "If not, you should examine the file" |
| 292 |
write " "$D"" |
| 293 |
write "to see what went wrong." |
| 294 |
write "" |
| 295 |
write "By the way, there should be 1 Severe, 291 Errors, and 12 Warnings." |
| 296 |
write "" |
| 297 |
!=============================<End of Master Script>============================ |
| 298 |
|