1*ebfedea0SLionel Sambuc$! 2*ebfedea0SLionel Sambuc$! Analyze bntest output file. 3*ebfedea0SLionel Sambuc$! 4*ebfedea0SLionel Sambuc$! Exit status = 1 (success) if all tests passed, 5*ebfedea0SLionel Sambuc$! 0 (warning) if any test failed. 6*ebfedea0SLionel Sambuc$! 7*ebfedea0SLionel Sambuc$! 2011-02-20 SMS. Added code to skip "#" comments in the input file. 8*ebfedea0SLionel Sambuc$! 9*ebfedea0SLionel Sambuc$! 2010-04-05 SMS. New. Based (loosely) on perl code in bntest-vms.sh. 10*ebfedea0SLionel Sambuc$! 11*ebfedea0SLionel Sambuc$! Expect data like: 12*ebfedea0SLionel Sambuc$! test test_name1 13*ebfedea0SLionel Sambuc$! 0 14*ebfedea0SLionel Sambuc$! [...] 15*ebfedea0SLionel Sambuc$! test test_name2 16*ebfedea0SLionel Sambuc$! 0 17*ebfedea0SLionel Sambuc$! [...] 18*ebfedea0SLionel Sambuc$! [...] 19*ebfedea0SLionel Sambuc$! 20*ebfedea0SLionel Sambuc$! Some tests have no following "0" lines. 21*ebfedea0SLionel Sambuc$! 22*ebfedea0SLionel Sambuc$ result_file_name = f$edit( p1, "TRIM") 23*ebfedea0SLionel Sambuc$ if (result_file_name .eqs. "") 24*ebfedea0SLionel Sambuc$ then 25*ebfedea0SLionel Sambuc$ result_file_name = "bntest-vms.out" 26*ebfedea0SLionel Sambuc$ endif 27*ebfedea0SLionel Sambuc$! 28*ebfedea0SLionel Sambuc$ fail = 0 29*ebfedea0SLionel Sambuc$ passed = 0 30*ebfedea0SLionel Sambuc$ tests = 0 31*ebfedea0SLionel Sambuc$! 32*ebfedea0SLionel Sambuc$ on control_c then goto tidy 33*ebfedea0SLionel Sambuc$ on error then goto tidy 34*ebfedea0SLionel Sambuc$! 35*ebfedea0SLionel Sambuc$ open /read result_file 'result_file_name' 36*ebfedea0SLionel Sambuc$! 37*ebfedea0SLionel Sambuc$ read_loop: 38*ebfedea0SLionel Sambuc$ read /end = read_loop_end /error = tidy result_file line 39*ebfedea0SLionel Sambuc$ t1 = f$element( 0, " ", line) 40*ebfedea0SLionel Sambuc$! 41*ebfedea0SLionel Sambuc$! Skip "#" comment lines. 42*ebfedea0SLionel Sambuc$ if (f$extract( 0, 1, f$edit( line, "TRIM")) .eqs. "#") then - 43*ebfedea0SLionel Sambuc goto read_loop 44*ebfedea0SLionel Sambuc$! 45*ebfedea0SLionel Sambuc$ if (t1 .eqs. "test") 46*ebfedea0SLionel Sambuc$ then 47*ebfedea0SLionel Sambuc$ passed = passed+ 1 48*ebfedea0SLionel Sambuc$ tests = tests+ 1 49*ebfedea0SLionel Sambuc$ fail = 1 50*ebfedea0SLionel Sambuc$ t2 = f$extract( 5, 1000, line) 51*ebfedea0SLionel Sambuc$ write sys$output "verify ''t2'" 52*ebfedea0SLionel Sambuc$ else 53*ebfedea0SLionel Sambuc$ if (t1 .nes. "0") 54*ebfedea0SLionel Sambuc$ then 55*ebfedea0SLionel Sambuc$ write sys$output "Failed! bc: ''line'" 56*ebfedea0SLionel Sambuc$ passed = passed- fail 57*ebfedea0SLionel Sambuc$ fail = 0 58*ebfedea0SLionel Sambuc$ endif 59*ebfedea0SLionel Sambuc$ endif 60*ebfedea0SLionel Sambuc$ goto read_loop 61*ebfedea0SLionel Sambuc$ read_loop_end: 62*ebfedea0SLionel Sambuc$ write sys$output "''passed'/''tests' tests passed" 63*ebfedea0SLionel Sambuc$! 64*ebfedea0SLionel Sambuc$ tidy: 65*ebfedea0SLionel Sambuc$ if f$trnlnm( "result_file", "LNM$PROCESS_TABLE", , "SUPERVISOR", , "CONFINE") 66*ebfedea0SLionel Sambuc$ then 67*ebfedea0SLionel Sambuc$ close result_file 68*ebfedea0SLionel Sambuc$ endif 69*ebfedea0SLionel Sambuc$! 70*ebfedea0SLionel Sambuc$ if ((tests .gt. 0) .and. (tests .eq. passed)) 71*ebfedea0SLionel Sambuc$ then 72*ebfedea0SLionel Sambuc$ exit 1 73*ebfedea0SLionel Sambuc$ else 74*ebfedea0SLionel Sambuc$ exit 0 75*ebfedea0SLionel Sambuc$ endif 76*ebfedea0SLionel Sambuc$! 77