Fixed a unit testing bug

This commit is contained in:
george 2008-06-27 22:29:18 +00:00
parent 8ed7272548
commit fbb4ba6446
1 changed files with 12 additions and 12 deletions

View File

@ -21,9 +21,9 @@ ZT(ZARY,BAT,TST) ; private routine to add a test case to the ZARY array
. S $P(ZARY(BAT),"^",2)=II+1
I '$D(ZARY(BAT)) D ; FIRST TEST IN THIS BATTERY
. S ZARY(BAT)=CNT_"^"_CNT ; FIRST AND LAST TESTS IN BATTERY
. ; S ZARY("TESTS",BAT)="" ; PUT THE BATTERY IN THE TESTS INDEX
. S TN=$NA(ZARY("TESTS"))
. D PUSH^GPLXPATH(TN,BAT)
. S ZARY("TESTS",BAT)="" ; PUT THE BATTERY IN THE TESTS INDEX
. ; S TN=$NA(ZARY("TESTS"))
. ; D PUSH^GPLXPATH(TN,BAT)
S ZARY(0)=CNT ; update the array counter
Q
;
@ -47,20 +47,20 @@ ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
. . . S SECTION=$P($P(LINE,";;><",2),">",1) ; pull out name
. . I LINE?." "1";;>>".E D ; test case found
. . . D ZT(.@ZARY,SECTION,$P(LINE,";;>>",2)) ; put the test in the array
; S @ZARY@("ALL")="1"_"^"_@ZARY@(0) ; MAKE A BATTERY FOR ALL
S @ZARY@("ALL")="1"_"^"_@ZARY@(0) ; MAKE A BATTERY FOR ALL
Q
;
ZTEST(ZARY,WHICH) ; try out the tests using a passed array ZTEST
N I,ZX,ZR,ZP
S DEBUG=0
I WHICH="ALL" D Q ; RUN ALL THE TESTS
. W "DOING ALL",!
. N J,NT
. S NT=$NA(ZARY("TESTS"))
. W NT,@NT@(0),!
. F J=1:1:@NT@(0) D ;
. . W @NT@(J),!
. . D ZTEST^GPLUNIT(@ZARY,@NT@(J))
; I WHICH="ALL" D Q ; RUN ALL THE TESTS
; . W "DOING ALL",!
; . N J,NT
; . S NT=$NA(ZARY("TESTS"))
; . W NT,@NT@(0),!
; . F J=1:1:@NT@(0) D ;
; . . W @NT@(J),!
; . . D ZTEST^GPLUNIT(@ZARY,@NT@(J))
I '$D(ZARY(WHICH)) D ; TEST SECTION DOESN'T EXIST
. W "ERROR -- TEST SECTION DOESN'T EXIST -> ",WHICH,!
. Q ; EXIT