comparison gpf/BIN/runalltc.bat @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 @echo off
2 iff x%RUNALLTC_NO_SETLOCAL% == x then
3 setlocal
4 endiff
5 loadbtm on
6 rem ---------------------------------------------------------------------------
7 rem Project :
8 rem Modul : runalltc.bat
9 rem ---------------------------------------------------------------------------
10 rem Copyright 2002 Texas Instruments Berlin, AG
11 rem All rights reserved.
12 rem
13 rem This file is confidential and a trade secret of Texas
14 rem Instruments Berlin, AG
15 rem The receipt of or possession of this file does not convey
16 rem any rights to reproduce or disclose its contents or to
17 rem manufacture, use, or sell anything it may describe, in
18 rem whole, or in part, without the specific written consent of
19 rem Texas Instruments Berlin, AG.
20 rem ---------------------------------------------------------------------------
21 rem Purpose : Runs all test cases belonging to a given test specification
22 rem ---------------------------------------------------------------------------
23 pushd
24 if x%_4ver% == x goto Need4NT
25
26 rem Check %PROST
27 iff x%PROST == x then
28 echo Which Protocol Stack shall be tested?
29 echo set the environment variable PROST to the name of the stack.
30 echo e.g. set PROST=gsm or set PROST=g23net will work
31 goto end
32 endiff
33
34 iff %PROST == gprs then
35 iff x%PS_EXE% == x then
36 set rtc_psexe=%TESTROOT%\ms\bin\g23_smi_gprs.exe
37 else
38 set rtc_psexe=%PS_EXE%
39 endiff
40 elseiff %PROST == gsm then
41 iff x%PS_EXE% == x then
42 set rtc_psexe=%TESTROOT%\ms\bin\MS_TI_VC.exe
43 else
44 set rtc_psexe=%PS_EXE%
45 endiff
46 elseiff %PROST% == g23net .OR. %PROST% == g23n then
47 iff x%PS_EXE% == x then
48 set rtc_psexe=%TESTROOT%\bin\nucwin\g23net.exe
49 else
50 set rtc_psexe=%PS_EXE%
51 endiff
52 elseiff %PROST% == generic then
53 iff x%PS_EXE% == x then
54 set rtc_psexe=%TESTROOT%\bin\teststack.exe
55 else
56 set rtc_psexe=%PS_EXE%
57 endiff
58 else
59 text
60 Unknown project. Set environment variable PROST to gsm, gprs, g23net,
61 or generic (i.e. use \GPF\initvars.bat).
62 endtext
63 goto end
64 endiff
65
66 set rtc_tcfailed=0
67 set ret_iboe=0
68 set tc_firsttc=
69 set tc_lasttc=
70 set rtc_tappara=
71 set rtc_oldtappara=H
72 set rtc_pspara=/INV
73 set rtc_summary=0
74 set rtc_tee=
75 set rtc_delay=5
76 set rtc_tapexe=
77 set rtc_bindir=%GPF%/BIN
78 set rtc_showtrc=0
79 set rtc_pcolog=1
80 set rtc_startstack=1
81 set rtc_starttst=1
82 set rtc_exitsoon=0
83 set rtc_testenv=unknown
84 set rtc_allin1=0
85 set rtc_exec_suites=0
86 set rtc_exec_tc=1
87 set rtc_suifilehdl=-1
88 set rtc_doasif=0
89 set rtc_enti=
90 set rtc_prefix=
91 set rtc_rangeset=0
92 set rtc_blacklist=
93 set rtc_retry=0
94 set rtc_try=0
95 set rtc_tap_exitcode=
96 set rtc_tccount=0
97 set rtc_tc_executed=
98 set rtc_echo=
99 set rtc_case=
100 set rtc_monthlist=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
101 set rtc_enverror=Can't mix option -oe with -n, -b, -v, -e, -pcon, -oth, -notst, -wtmo, -stmo, -l, -ctb, -cr, -pref or -q
102
103 :check_options
104 rem Check Parameters
105 if "x%1" == "x" goto How2Use
106 iff "%1" == "-debug" then
107 echo on
108 shift 1
109 goto check_options
110 elseiff "%1" == "-r" then
111 if "x%2" == "x" (echo Missing range for "-r" & goto How2Use)
112 set tc_dash=%@INDEX[%2,-]
113 iff %tc_dash == -1 then
114 set tc_firsttc=%2
115 set tc_lasttc=%2
116 else
117 set tc_firsttc=%@INSTR[0,%tc_dash,%2]
118 set tc_lasttc=%@SUBSTR[%2,%@eval[1+%tc_dash%]]
119 endiff
120 set rtc_rangeset=1
121 shift 2
122 goto check_options
123 elseiff "%1" == "-t" then
124 if "x%2" == "x" (echo Missing name of tap-exe for "-t" & goto How2Use)
125 set rtc_tapexe=%2
126 shift 2
127 goto check_options
128 elseiff "%1" == "-b" then
129 iff %rtc_testenv% == old then
130 echo Error: %rtc_enverror%
131 goto How2Use
132 endiff
133 set rtc_testenv=new
134 if "x%2" == "x" (echo Missing name of bin directory for "-b" & goto How2Use)
135 set rtc_bindir=%2
136 shift 2
137 goto check_options
138 elseiff "%1" == "-p" then
139 if "x%2" == "x" (echo Missing name of ps-exe for "-p" & goto How2Use)
140 set rtc_psexe=%2
141 shift 2
142 goto check_options
143 elseiff "%1" == "-n" then
144 iff %rtc_testenv% == old then
145 echo Error: %rtc_enverror%
146 goto How2Use
147 endiff
148 set rtc_doasif=1
149 set rtc_testenv=new
150 set rtc_pcolog=0
151 set rtc_tappara=%rtc_tappara% %1 -v
152 set rtc_startstack=0
153 shift 1
154 goto check_options
155 elseiff "%1" == "-q" then
156 iff %rtc_testenv% == old then
157 echo Error: %rtc_enverror%
158 goto How2Use
159 endiff
160 set rtc_testenv=new
161 set rtc_pcolog=0
162 shift 1
163 goto check_options
164 elseiff "%1" == "-s" then
165 set rtc_exec_suites=1
166 set rtc_exec_tc=0
167 shift 1
168 goto check_options
169 elseiff "%1" == "+s" then
170 set rtc_exec_suites=1
171 shift 1
172 goto check_options
173 elseiff "%1" == "-st" then
174 set rtc_oldtappara=T
175 set rtc_showtrc=1
176 shift 1
177 goto check_options
178 elseiff "%1" == "-sp" then
179 set rtc_pspara=
180 shift 1
181 goto check_options
182 elseiff "%1" == "-ib" then
183 set rtc_iboe=1
184 shift 1
185 goto check_options
186 elseiff "%1" == "-e" then
187 iff %rtc_testenv% == old then
188 echo Error: %rtc_enverror%
189 goto How2Use
190 endiff
191 set rtc_testenv=new
192 if "x%2" == "x" (echo Missing name of entity for "-e" & goto How2Use)
193 set rtc_tappara=%rtc_tappara% %1 %2
194 set rtc_enti=%2
195 shift 2
196 goto check_options
197 elseiff "%1" == "-pref" then
198 iff %rtc_testenv% == old then
199 echo Error: %rtc_enverror%
200 goto How2Use
201 endiff
202 set rtc_testenv=new
203 if "x%2" == "x" (echo Missing prefix of entity for "-pref" & goto How2Use)
204 set rtc_prefix=%2
205 shift 2
206 goto check_options
207 elseiff "%1" == "-echo" then
208 set rtc_echo=echo
209 set rtc_startstack=0
210 set rtc_pcolog=0
211 set rtc_starttst=0
212 shift 1
213 goto check_options
214 elseiff "%1" == "-pcon" then
215 iff %rtc_testenv% == old then
216 echo Error: %rtc_enverror%
217 goto How2Use
218 endiff
219 set rtc_testenv=new
220 set rtc_tappara=%rtc_tappara% -pcon
221 shift 1
222 goto check_options
223 elseiff "%1" == "-ctb" then
224 iff %rtc_testenv% == old then
225 echo Error: %rtc_enverror%
226 goto How2Use
227 endiff
228 set rtc_testenv=new
229 set rtc_tappara=%rtc_tappara% -ctb
230 shift 1
231 goto check_options
232 elseiff "%1" == "-cr" then
233 iff %rtc_testenv% == old then
234 echo Error: %rtc_enverror%
235 goto How2Use
236 endiff
237 set rtc_testenv=new
238 set rtc_tappara=%rtc_tappara% -cr
239 shift 1
240 goto check_options
241 elseiff "%1" == "-oth" then
242 iff %rtc_testenv% == old then
243 echo Error: %rtc_enverror%
244 goto How2Use
245 endiff
246 set rtc_testenv=new
247 set rtc_tappara=%rtc_tappara% -oth
248 shift 1
249 goto check_options
250 elseiff "%1" == "-v" then
251 iff %rtc_testenv% == old then
252 echo Error: %rtc_enverror%
253 goto How2Use
254 endiff
255 set rtc_testenv=new
256 set rtc_tappara=%rtc_tappara% -v
257 shift 1
258 goto check_options
259 elseiff "%1" == "-sum" then
260 set rtc_summary=1
261 shift 1
262 goto check_options
263 elseiff "%1" == "-notst" then
264 iff %rtc_testenv% == old then
265 echo Error: %rtc_enverror%
266 goto How2Use
267 endiff
268 set rtc_starttst=0
269 shift 1
270 goto check_options
271 elseiff "%1" == "-nop" then
272 set rtc_startstack=0
273 shift 1
274 goto check_options
275 elseiff "%1" == "-d" then
276 if "x%2" == "x" (echo Missing delay for "-d" & goto How2Use)
277 set rtc_delay=%2
278 shift 2
279 goto check_options
280 elseiff "%1" == "-c" then
281 if "x%2" == "x" (echo Missing name for "-c" & goto How2Use)
282 set rtc_case=%2
283 shift 2
284 goto check_options
285 elseiff "%1" == "-retry" then
286 if "x%2" == "x" (echo Missing repetitions for "-retry" & goto How2Use)
287 set rtc_retry=%2
288 shift 2
289 goto check_options
290 elseiff "%1" == "-stmo" then
291 iff %rtc_testenv% == old then
292 echo Error: %rtc_enverror%
293 goto How2Use
294 endiff
295 set rtc_testenv=new
296 if "x%2" == "x" (echo Missing timeout for "-stmo" & goto How2Use)
297 set rtc_tappara=%rtc_tappara% -tsync %@eval[%2*1000]
298 shift 2
299 goto check_options
300 elseiff "%1" == "-l" then
301 iff %rtc_testenv% == old then
302 echo Error: %rtc_enverror%
303 goto How2Use
304 endiff
305 set rtc_testenv=new
306 if "x%2" == "x" (echo Missing ccddata_dll for "-l" & goto How2Use)
307 if NOT exist %2 (echo %2 not found & goto end)
308 set rtc_tappara=%rtc_tappara% -l %@FULL[%2]
309 shift 2
310 goto check_options
311 elseiff "%1" == "-wtmo" then
312 iff %rtc_testenv% == old then
313 echo Error: %rtc_enverror%
314 goto How2Use
315 endiff
316 set rtc_testenv=new
317 if "x%2" == "x" (echo Missing timeout for "-wtmo" & goto How2Use)
318 set rtc_tappara=%rtc_tappara% -t %@eval[%2*1000]
319 shift 2
320 goto check_options
321 elseiff "%1" == "-tp" then
322 shift
323 :tap_param
324 iff x"%1" == x"" then
325 goto How2use
326 elseiff "%1" == "--" then
327 shift
328 goto check_options
329 else
330 set rtc_tappara=%rtc_tappara% %1
331 shift
332 goto tap_param
333 endiff
334 elseiff "%1" == "-oe" then
335 iff %rtc_testenv% == new then
336 echo Error: %rtc_enverror%
337 goto How2Use
338 endiff
339 set rtc_testenv=old
340 shift 1
341 goto check_options
342 elseiff "%1" == "-xf" then
343 if "x%2" == "x" (echo Missing file for "-xf" & goto How2Use)
344 set rtc_blacklist=%2
345 shift 2
346 goto check_options
347 endiff
348
349 iff %rtc_testenv% == unknown then
350 iff "x%rtc_tapexe%" == "x" then
351 iff exist %GPF%\BIN\tap2_%PROST%.exe then
352 set rtc_tapexe=%GPF%\BIN\tap2_%PROST%.exe
353 set rtc_testenv=old
354 else
355 set rtc_tapexe=tap2.exe
356 set rtc_testenv=new
357 endiff
358 else
359 iff %@INDEX[%rtc_tapexe%,%PROST%] == -1 then
360 set rtc_testenv=new
361 else
362 set rtc_testenv=old
363 endiff
364 endiff
365 echo Guess %rtc_testenv test environment
366 else
367 iff %rtc_testenv% == new then
368 iff "x%rtc_tapexe%" == "x" then
369 set rtc_tapexe=tap2.exe
370 endiff
371 else
372 iff "x%rtc_tapexe%" == "x" then
373 set rtc_tapexe=%GPF%\BIN\tap2_%PROST%.exe
374 endiff
375 endiff
376 echo Use %rtc_testenv test environment
377 endiff
378
379 iff %rtc_testenv% == new .AND. %rtc_showtrc == 1 then
380 echo Option -st is not supported in this version for new test environment
381 set rtc_showtrc=0
382 endiff
383
384 if "%@INSTR[0,1,%1]" == "-" goto unknown_option
385 if %#% GT 1 goto How2Use
386
387 set rtc_localdir=%_CWD
388 if %rtc_testenv% == new cdd %rtc_bindir%
389
390 iff NOT exist %rtc_tapexe% then
391 echo %rtc_tapexe%: not found
392 goto end
393 endiff
394 iff NOT exist %rtc_psexe% .AND. %rtc_startstack% != 0 then
395 echo %rtc_psexe%: not found
396 goto end
397 endiff
398 set rtc_psexe=%@FULL[%rtc_psexe%]
399
400 set ENTI=%1
401 if x"%rtc_enti%" == x"" set rtc_enti=%ENTI%
402 if x"%rtc_prefix%" == x"" set rtc_prefix=%ENTI%
403
404 rem Stack-Specifics
405 iff "x%TCDIR%" == "x" then
406 iff "%PROST" == "WARP" then
407 set TCDIR=%BINDIR%
408 else
409 set TCDIR=%TESTROOT%\%SIDE%\TEST
410 endiff
411 endiff
412
413 %TESTDRIVE%
414
415 rem check if test case directory is substructured
416 iff "x%TCNOTSUBSTRUCT" == "x" then
417 set TESTDLLDIR=%TCDIR%\%ENTI%_test
418 iff NOT exist %TESTDLLDIR%\*.dll then
419 set TESTDLLDIR=%TCDIR%\TEST_%ENTI%
420 endiff
421 else
422 set TESTDLLDIR=%TCDIR%
423 endiff
424
425 iff NOT exist %TESTDLLDIR% then
426 echo %TESTDLLDIR% does not exist
427 goto end
428 endiff
429
430 rem check for blacklist
431 iff "x%rtc_blacklist%" != "x" then
432 iff %@INSTR[0,1,%rtc_blacklist%] == \ .OR. %@INSTR[1,1,%rtc_blacklist%] == : then
433 iff exist %rtc_blacklist% then
434 set rtc_blacklist=%@FULL["%rtc_blacklist%"]
435 else
436 echo Cannot open %rtc_blacklist%
437 goto end
438 endiff
439 elseiff %@INDEX[%rtc_blacklist%,\] != -1 then
440 iff exist %rtc_localdir%\%rtc_blacklist% then
441 set rtc_blacklist=%rtc_localdir%\%rtc_blacklist%
442 else
443 echo Cannot open %rtc_blacklist%
444 goto end
445 endiff
446 else
447 iff exist %rtc_localdir%\%rtc_blacklist% then
448 set rtc_blacklist=%rtc_localdir%\%rtc_blacklist%
449 elseiff exist %TESTDLLDIR%\%rtc_blacklist% then
450 set rtc_blacklist=%TESTDLLDIR%\%rtc_blacklist%
451 elseiff exist %TCDIR%\%rtc_blacklist% then
452 set rtc_blacklist=%TCDIR%\%rtc_blacklist%
453 else
454 echo Cannot open %rtc_blacklist%
455 goto end
456 endiff
457 endiff
458 endiff
459
460 iff %rtc_testenv% == new then
461 set rtc_tappara=%rtc_tappara% -tb %ENTI%
462 set tcerr=TEST_TAP.prt
463 else
464 cdd %TESTDLLDIR%
465 set tcerr=Test_%ENTI%.prt
466 endiff
467
468 iff NOT exist %TESTDLLDIR%\*.dll then
469 echo no testcases in %TESTDLLDIR%
470 goto end
471 endiff
472
473 set grep=%GPF%\tools\bin\grep.exe
474 iff NOT exist %grep% then
475 echo You need %grep% to execute runalltc
476 goto end
477 endiff
478 set clickbtn=%GPF%\BIN\clickbtn.exe
479 iff NOT exist %clickbtn% then
480 echo You need %clickbtn% to execute runalltc
481 goto end
482 endiff
483 iff exist %TESTDLLDIR%\%ENTI%.dll .AND. %rtc_exec_tc% == 1 then
484 set rtc_allin1=1
485 set gawk=%GPF%\tools\bin\gawk.exe
486 iff NOT exist %gawk% then
487 echo You need %gawk% to run allin1 tests
488 goto end
489 endiff
490 set dumpbin=%@SEARCH[dumpbin.exe]
491 iff NOT exist %dumpbin% then
492 echo You need dumpbin.exe to run allin1 tests
493 goto end
494 endiff
495 set rtc_expfile=%TESTDLLDIR%\%ENTI%_exp.txt
496 "%dumpbin%" /EXPORTS %TESTDLLDIR%\%ENTI%.dll | %gawk% "/ +[0-9]+ +[0-9A-F]+ [0-9A-F]+ %@UPPER[%rtc_prefix%]/ {print $4}" > %rtc_expfile%
497 endiff
498 iff %rtc_exec_suites% == 1 .AND. %rtc_allin1% != 1 then
499 set gawk=%GPF%\tools\bin\gawk.exe
500 iff NOT exist %gawk% then
501 echo You need %gawk% to run suites
502 goto end
503 endiff
504 endiff
505 rem Check ranges
506 iff %rtc_exec_tc% == 1 then
507 iff %rtc_allin1% == 1 then
508 set rtc_filehdl=%@FILEOPEN[%rtc_expfile%,read]
509 set tc_exmp=%@FILEREAD[%rtc_filehdl%]
510 set tcase=%tc_exmp
511 else
512 set tc_exmp_=%@FINDFIRST[%TESTDLLDIR%\*.dll]
513 set tc_exmp=%@NAME[%tc_exmp_]
514 set tc_exmp_=%@FINDCLOSE[%TESTDLLDIR%\*.dll]
515 endiff
516 set tc_ords=%@SUBSTR[%tc_exmp,%@LEN[%rtc_prefix%]]
517 set tc_len=%@LEN[%tc_ords]
518 if %@NUMERIC[%tc_ords] == 0 set tc_len=%@DEC[%tc_len%]
519 iff x%tc_firsttc% == x then
520 iff %tc_len% == 5 then
521 set tc_firsttc=00000
522 elseiff %tc_len% == 4 then
523 set tc_firsttc=0000
524 else
525 set tc_firsttc=000
526 endiff
527 else
528 set tc_len_=%@LEN[%tc_firsttc]
529 if %@NUMERIC[%tc_firsttc] == 0 set tc_len_=%@DEC[%tc_len_%]
530 if %tc_len != %tc_len_ echo Warning: your range "%tc_firsttc" is ambigious (there are not only %tc_len_%-digit test cases)
531 endiff
532 iff x%tc_lasttc == x then
533 iff %tc_len% == 5 then
534 set tc_lasttc=99999Z
535 elseiff %tc_len% == 4 then
536 set tc_lasttc=9999Z
537 else
538 set tc_lasttc=999Z
539 endiff
540 else
541 set tc_len_=%@LEN[%tc_lasttc]
542 if %@NUMERIC[%tc_lasttc] == 0 set tc_len_=%@DEC[%tc_len_%]
543 if %tc_len != %tc_len_ echo Warning: your range "%tc_lasttc" is ambigious (there are not only %tc_len_%-digit test cases)
544 endiff
545 endiff
546
547 iff %rtc_summary% == 1 then
548 set rtc_sumfile=%@FULL[%ENTI%.txt]
549 echo Start testing of %ENTI% on %@WORD[%@DEC[%_MONTH],%rtc_monthlist%] %_DAY% %_YEAR% at %_TIME >%rtc_sumfile%
550 set rtc_tee=%=|tee /a %rtc_sumfile%
551 endiff
552
553 on break gosub on_break
554
555 iff %rtc_exec_suites% == 1 .AND. not exist %TESTDLLDIR%\%ENTI%.sui then
556 echo No suites file %TESTDLLDIR%\%ENTI%.sui
557 set rtc_exec_suites=0
558 if %rtc_exec_tc% == 0 goto end
559 endiff
560
561 iff %rtc_testenv% == new .AND. %rtc_starttst == 1 then
562 start /MIN tst sim
563 delay 2
564 iff %rtc_pcolog% == 1 then
565 start /MIN /LOW pco_srv
566 delay 2
567 else
568 set rtc_showtrc=0
569 endiff
570 rem iff %rtc_showtrc% == 1 then
571 rem start /LOW pco_view.exe
572 rem endiff
573 endiff
574
575 iff x"%rtc_case" != x"" then
576 set tcase=%rtc_case%
577 gosub run_test
578 goto epilogue
579 endiff
580
581 iff %rtc_exec_tc% == 1 then
582 iff %rtc_allin1% == 1 then
583 do while %tcase% != **EOF**
584 gosub run_test
585 iff %rtc_tcfailed% == 1 then
586 echo Testcase failed: exiting.
587 goto end
588 endiff
589 iff %rtc_tap_exitcode% == 8 .AND. %rtc_retry% != 0 then
590 set rtc_try=%@INC[%rtc_try%]
591 if %rtc_try% LE %rtc_retry% ITERATE
592 iff %rtc_tccount% == 0 then
593 echo Stack synchronization error on 1. test case in %rtc_try% retries - giving up %rtc_tee%
594 goto epilogue
595 endiff
596 endiff
597 if %rtc_exitsoon% == 1 goto epilogue
598 set tcase=%@FILEREAD[%rtc_filehdl%]
599 set rtc_try=0
600 if %rtc_tc_executed% == 1 set rtc_tccount=%@INC[%rtc_tccount%]
601 enddo
602 else
603 FOR %tcase IN (%TESTDLLDIR%\*.dll) do (
604 gosub run_test
605 iff %rtc_tcfailed% == 1 then
606 echo Testcase failed: exiting.
607 goto end
608 endiff
609 if %rtc_exitsoon% == 1 goto epilogue
610 )
611 endiff
612 endiff
613
614 iff %rtc_exec_suites% == 1 then
615 set rtc_suilist=%TESTDLLDIR%\%ENTI%_sui_list.txt
616 set sed=%GPF%\tools\bin\sed.exe
617 iff NOT exist %sed% then
618 echo You need %sed% to execute suites with runalltc
619 goto end
620 endiff
621 gosub mk_sui_list
622 iff %@FILESIZE[%rtc_suilist%,b] == 0 then
623 echo No suites in %TESTDLLDIR%\%ENTI%.sui
624 goto epilogue
625 endiff
626 set rtc_suifilehdl=%@FILEOPEN[%rtc_suilist%,read]
627 set tcase=#%@FILEREAD[%rtc_suifilehdl%]
628 do while %tcase% != #**EOF**
629 gosub run_test
630 if %rtc_exitsoon% == 1 goto epilogue
631 set tcase=#%@FILEREAD[%rtc_suifilehdl%]
632 enddo
633 endiff
634 goto epilogue
635
636 :mk_sui_list
637 %grep% "SUI_.*:" %TESTDLLDIR%\%ENTI%.sui | %sed% -e "s/\(SUI_[a-zA-Z0-9_]*\):/\1/g" | %gawk% -- " /SUI_/ {print $1 } " > %rtc_suilist%
638 return
639
640 :epilogue
641 iff %rtc_testenv% == new then
642 iff %rtc_pcolog% == 1 then
643 pcoc exit > nul
644 delay 2
645 pkill pco_srv > nul
646 rem pkill pco_view > nul
647 endiff
648 if %rtc_starttst == 1 pkill tst > nul
649 iff %rtc_summary% == 1 then
650 echo End testing of %ENTI% on %@WORD[%@DEC[%_MONTH],%rtc_monthlist%] %_DAY% %_YEAR% at %_TIME >>%rtc_sumfile%
651 move /q %rtc_sumfile% %TESTDLLDIR%
652 endiff
653 iff %rtc_allin1% == 1 then
654 set rtc_filehdl=%@FILECLOSE[%rtc_filehdl%]
655 del /q %rtc_expfile%
656 endiff
657 iff %rtc_exec_suites% == 1 then
658 if %rtc_suifilehdl% != -1 set rtc_suifilehdl=%@FILECLOSE[%rtc_suifilehdl%]
659 del /q %rtc_suilist%
660 endiff
661 endiff
662
663 goto end
664
665 :run_test
666 iff %@INSTR[0,1,%tcase%] == # then
667 set rtc_issuite=#
668 set tcase=%@SUBSTR[%tcase%,1]
669 else
670 set rtc_issuite=
671 endiff
672 set tcname=%@NAME[%tcase]
673 set tc_ords=%@SUBSTR[%tcname,%@LEN[%rtc_prefix%]]
674 iff %rtc_rangeset% == 0 then
675 set rtc_inrange=1
676 else iff %tc_ords% GE %tc_firsttc% .AND. %tc_ords% LE %tc_lasttc% then
677 set rtc_inrange=1
678 else
679 set rtc_inrange=0
680 endiff
681 iff %rtc_inrange% == 1 .AND. "x%rtc_blacklist%" != "x" then
682 %grep% -w %tcname% %rtc_blacklist% > nul
683 iff %? == 0 then
684 set rtc_inrange=0
685 echo Test case %tcname% excluded by %rtc_blacklist% %rtc_tee%
686 endiff
687 endiff
688 set rtc_tc_executed=0
689 iff x%rtc_issuite% == x# .OR. %rtc_inrange == 1 then
690 iff x"%rtc_echo%" == x"" .AND. not exist %TESTDLLDIR%\%tcname% then
691 mkdir %TESTDLLDIR%\%tcname%
692 endiff
693 iff %rtc_testenv% == new then
694 rem start /MIN tst sim
695 rem delay 2
696 iff %rtc_pcolog% == 1 then
697 pcoc spath %TESTDLLDIR%\%tcname% > nul
698 pcoc start %tcname% > nul
699 endiff
700 rem iff %rtc_showtrc% == 1 then
701 rem start /LOW pco_view.exe
702 rem delay 2
703 rem endiff
704 else
705 cd %tcname%
706 endiff
707 iff %rtc_startstack% == 1 then
708 start %rtc_pspara% %rtc_psexe%
709 delay %rtc_delay%
710 endiff
711 iff %rtc_testenv% == new then
712 iff "%rtc_doasif%" == "1" then
713 %rtc_echo% %rtc_tapexe% %rtc_tappara% %TESTDLLDIR% %rtc_issuite%%tcname > %TESTDLLDIR%\%tcname%\%ENTI%.dbg
714 else
715 %rtc_echo% %rtc_tapexe% %rtc_tappara% %TESTDLLDIR% %rtc_issuite%%tcname
716 endiff
717 else
718 %rtc_tapexe% Test 1 2 N %enti %TESTDLLDIR% %rtc_issuite%%tcname %rtc_oldtappara%
719 endiff
720 iff x"%rtc_echo%" == x"" then
721 set rtc_tap_exitcode=%?
722 set rtc_tc_executed=1
723 if %rtc_tap_exitcode% != 0 .AND. %rtc_iboe% == 1 set rtc_tcfailed=1
724 iff exist %ENTI%.dbg then
725 move /q %ENTI%.dbg %TESTDLLDIR%\%tcname%
726 endiff
727 iff exist %TESTDLLDIR%\%tcerr% then
728 move /q %TESTDLLDIR%\%tcerr% %TESTDLLDIR%\%tcname%
729 rem Check for stack sync error (exit code 8)
730 iff %rtc_tap_exitcode% != 8 .OR. %rtc_try% == %rtc_retry% then
731 %grep% -i %tcname% %TESTDLLDIR%\%tcname%\%tcerr% %rtc_tee%
732 endiff
733 endiff
734 endiff
735 if %rtc_tcfailed% == 1 return
736 iff %rtc_startstack% == 1 then
737 %clickbtn% "%@FILENAME[%rtc_psexe%] - Application Error" OK > nul
738 iff %? == 0 then
739 echo Testcase %tcname% Failed: %rtc_psexe% crashed. %rtc_tee%
740 else
741 pkill %@NAME[%rtc_psexe%] > nul
742 endiff
743 endiff
744 iff %rtc_testenv% == new then
745 rem kill p TST RCV EXTR > nul
746 rem kill q PQTST STQTST PQRCV STQRCV > nul
747 rem pkill tst > nul
748 rem delay 1
749 iff %rtc_pcolog% == 1 then
750 pcoc stop > nul
751 endiff
752 rem iff %rtc_showtrc% == 1 then
753 rem kill r data_ > nul
754 rem pkill pco_view > nul
755 rem endiff
756 rem delay 1
757 else
758 cd ..
759 endiff
760 endiff
761 return
762
763 :on_break
764 set rtc_exitsoon=1
765 Echo Will exit after the next test case
766 return
767
768 :Need4NT
769 echo "Error: 4DOS or 4NT is needed
770 goto end
771
772 :unknown_option
773 echo Unknown Option: %1
774
775 :How2Use
776 text
777 runalltc : Run test cases
778 Usage : runalltc [-r [<first>]-[<last>]] [-p <ps_exe>] [-t <tap_exe>] [-sp]
779 [-st] [-sum] [-d <delay_time>] [-b <dir>] [-v] [-pcon]
780 [-q] [-e <entity>] [-notst] [-wtmo <time>] [-stmo <time>]
781 [-ib] [-n] [-l <ccddata>] [-ctb] [-tp ... --] [-c <tcase>]
782 [-xf <file>] [-pref <prefix>] [-retry <#retries>] testname
783 Example : runalltc GMM - runs all existing test cases for GMM
784 with -r : run range from <first> to <last>
785 with +s : run all test cases including suites
786 with -s : run (only) all suites
787 with -p : take <ps_exe> as protocol stack
788 with -t : take <tap_exe> as tap
789 with -tp --: pass all options between -tp and -- to tap
790 with -nop : don't start protocol stack
791 with -notst: don't start tst.exe
792 with -sp : show window of protocol stack (default: don't show)
793 with -st : show trace windows (default: don't show)
794 with -sum : write summary for each test case in <testname>.txt
795 with -wtmo : set Tap's default wait timeout to <time> seconds
796 with -stmo : set Tap's initial synchronization timeout to <time> seconds
797 with -d : set <delay_time> (in seconds) after protocal stack starting
798 with -b : set <dir> as directory for binaries to start
799 with -v : let Tap be verbose on execution
800 with -n : let Tap only should what should happen without executing test case
801 with -l : load <ccddata> instead of the default one
802 with -pcon : use pcon for primitive conversion
803 with -ctb : let Tap enable common timer base
804 with -cr : let Tap check ranges of base type
805 with -oth : let Tap configure TST to use the old header format
806 with -e : set <entity> name; necessary e.g. for suites
807 with -q : quick execution: don't log with pco
808 with -ib : immediate break on error (without stopping anything, e.g. stack)
809 with -oe : use old frame test environment
810 with -c : execute only test case <tcase>
811 with -xf : don't execute test cases that are listed in <file>
812 with -pref : testcase names are named <prefix> + number
813 with -retry: set number of retries for stack synchronization error
814 endtext
815
816 :end
817 iff x%RUNALLTC_NO_SETLOCAL% == x then
818 endlocal
819 endiff
820 popd