Changeset 42058
- Timestamp:
- Feb 24, 2022, 2:36:09 PM (4 years ago)
- Location:
- branches/eam_branches/ipp-20211108/ippTests/ippCheck
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20211108/ippTests/ippCheck/ippCheck
r42056 r42058 224 224 end 225 225 226 # The ippCheck class specifies the group of validation table to use for the analysis. 227 # When comparing a specific processing, planned or expected deviations from previous 228 # results can be encoded uniquely in the class 229 macro init.class 230 231 if (not($?IPPCHECK_CLASS)) 232 $IPPCHECK_CLASS = default 233 end 234 235 # look for command-line argument of the form -class () 236 local i 237 238 # for i 0 $argv:n 239 # NOTE: the opihi for-loop construct evaluates the loop conditions 240 # only once before the loop starts. Changing the value of argv:n 241 # during the loop will cause problems in that context. Also, we 242 # need to avoid incrementing $i when we strip off arguments 243 244 # the opihi 'while' loop correctly reevaluates the condition on each loop 245 246 $i = 0 247 while ($i < $argv:n) 248 if ("$argv:$i" == "-class") 249 if ($argv:n < $i + 2) 250 echo "ERROR: incorrect usage: -class is missing classname: -class (classname)" 251 break 252 end 253 list argv -del -class 254 $IPPCHECK_CLASS = $argv:$i 255 list argv -del $IPPCHECK_CLASS 256 else 257 $i ++ 258 end 259 end 260 261 # class-specific macros to define the class tables 262 # should be listed in ~/.ippcheckrc 263 ippcheck.class.$IPPCHECK_CLASS 264 end 265 226 266 macro init.stage 227 267 if ($0 < 2) … … 230 270 end 231 271 232 if (("$1" == "cam") || ("$1" == "camera")) 233 init.camera 234 return 235 end 236 if (("$1" == "wrp") || ("$1" == "warp")) 237 init.warp 238 return 239 end 240 if (("$1" == "dif") || ("$1" == "diff")) 241 init.diff 242 return 243 end 272 if (("$1" == "cam") || ("$1" == "camera")) init.camera 273 if (("$1" == "wrp") || ("$1" == "warp")) init.warp 274 if (("$1" == "dif") || ("$1" == "diff")) init.diff 244 275 245 echo "ERROR : invalid stage $1" 246 break 276 if (not($?PSF_FIELDS)) 277 echo "ERROR : invalid stage $1 or PSF_FIELDS not defined" 278 break 279 end 280 if (not($?PSF_KEYS)) 281 echo "ERROR : PSF_KEYS not defined" 282 break 283 end 284 if (not($?HDR_KEYS)) 285 echo "ERROR : HDR_KEYS not defined" 286 break 287 end 288 289 # Load PASS/FAIL criteria definitions 290 smf.compare.parse.book $PSF_FIELDS psfFields 291 smf.compare.parse.book $PSF_KEYS psfKeys 292 smf.compare.parse.book $HDR_KEYS hdrKeys 293 294 # determine the number of tests per chip and cmf/smf file 295 local Nfields 296 book npages psfFields -var Nfields 297 $NTESTS_CHIP = $Nfields + 4 298 $NTESTS_CMF = $NTESTS_CHIP * $NCHIPS + 2 247 299 end 248 300 … … 270 322 end 271 323 324 # loads the requested class (finds and removes -class CLASSNAME) argument 325 init.class 326 327 # arguments to the script are given as $argv:0 - $argv:n 328 # argument lists are passed to macros called below with $arglist 272 329 list argv -join arglist -start 1 273 330 … … 294 351 echo " EG: ippCheck smf camera (cctest) neb:///gpc1/ipc/o6370g0351o.2133651.smf neb:///gpc1/ipc/o6370g0351o.2497362.smf [+plot]" 295 352 echo " EG: ippCheck cmf warp (wwtest) neb:///gpc1/ipc/o6370g0351o.wrp.2109044.skycell.1278.000.cmf neb:///gpc1/ipc/o6370g0351o.wrp.2465875.skycell.1278.000.cmf [+plot]" 353 exit 2 296 354 end 297 355 … … 299 357 list argv -join arglist -start 2 300 358 359 # If we run on a single file, define the TAP test plan here. The 360 # value of NTESTS_CHIP is set by the init.stage call based on psfFields 361 # The number of chips depends on the camera and stage 362 # For warps and diffs, the number of chips is 1 since a single cmf holds a single table 363 # there are 2 tests at the end of smf.compare.all.extensions 364 tap.plan $NTESTS_CMF 301 365 smf.compare.all.extensions $arglist 366 tap.done 367 302 368 exit 0 303 369 end -
branches/eam_branches/ipp-20211108/ippTests/ippCheck/smfcheck.pro
r42056 r42058 180 180 get.camera.metadata.by.datagroup $CAMERA $expname $dgrp2; $smfBase2 = $camPath 181 181 182 tap.plan $NTESTS_CMF 183 182 184 $options = 183 185 setargs +plot BOOL $SAVEPLOT … … 185 187 echo smf.compare.all.extensions $output $smfBase1.smf $smfBase2.smf $options 186 188 smf.compare.all.extensions $output $smfBase1.smf $smfBase2.smf $options 189 tap.done 187 190 end 188 191 … … 223 226 end 224 227 228 tap.plan {$npages1 * $NTESTS_CMF} 229 225 230 for i 0 $npages1 226 231 book getpage warpBook1 $i -var mypage1 … … 238 243 echo smf.compare.all.extensions $output.$skycellID $cmfBase1.cmf $cmfBase2.cmf $options 239 244 smf.compare.all.extensions $output.$skycellID $cmfBase1.cmf $cmfBase2.cmf $options 240 end 241 242 book delete warpBook1 243 book delete warpBook2 245 end 246 247 book delete warpBook1 248 book delete warpBook2 249 250 tap.done 244 251 end 245 252 … … 279 286 end 280 287 288 tap.plan {2 * $npages1 * $NTESTS_CMF} 289 281 290 for i 0 $npages1 282 291 book getpage diffBook1 $i -var mypage1 … … 299 308 echo smf.compare.all.extensions $output.$skycellID.inv $cmfBase1.inv.cmf $cmfBase2.inv.cmf $options 300 309 smf.compare.all.extensions $output.$skycellID.inv $cmfBase1.inv.cmf $cmfBase2.inv.cmf $options 310 else 311 tap.skip $NTESTS_CMF 301 312 end 302 313 end … … 329 340 if ("$smf1" == "") 330 341 echo "ERROR: missing smf/cmf file : $smfFile1" 342 tap.skip $NTESTS_CMF 331 343 next 332 344 end 333 345 if ("$smf2" == "") 334 346 echo "ERROR: missing smf/cmf file : $smfFile2" 347 tap.skip $NTESTS_CMF 335 348 next 336 349 end … … 338 351 dirname $outroot -var mydir 339 352 mkdir $mydir 340 341 # XXX this number depends on the schema of the smfs and the camera (gpc1 vs gpc2)342 # XXX can we calculate the number of tests based on the number of smf extensions?343 # plan 3125344 ## XXX if smf.compare.all.extensions is called by an external function, we probably need a different plan,345 ## or we need to call 'plan' at the outer level?346 plan $NTESTS_CMF347 348 # Load psfField definitions. These variables are set by the349 # (init.camera, init.warp, init.diff) macros defined in .ippcheckrc.350 # These are called by init.stage351 smf.compare.parse.book $PSF_FIELDS psfFields352 smf.compare.parse.book $PSF_KEYS psfKeys353 smf.compare.parse.book $HDR_KEYS hdrKeys354 353 355 354 # does the smf have the right number of extensions? … … 381 380 if ($Next2 == -1) 382 381 echo "not ok : missing extenion $ext0:$Next1" 382 # XXX add a tap.skip here? 383 383 next 384 384 end 385 385 386 ok ($ext0:$Next1 == $ext1:$Next2) "matching ext names"386 # tap.ok ($ext0:$Next1 == $ext1:$Next2) "matching ext names" 387 387 $extname = $ext0:$Next1 388 388 # NOTE: analysis below uses ext sequence number (i,j) … … 398 398 echo "##### comparison results in $outroot.$extname.keys #####" 399 399 exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys 400 smf.compare.keys $outroot.$extname.keys hdrKeys 400 smf.compare.keys $outroot.$extname.keys hdrKeys; # TAP: 1 401 401 if ($NfailKeys) set NfailHdr = $NfailHdr + 1 402 402 end … … 408 408 echo "##### comparison results in $outroot.$extname.keys #####" 409 409 exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys 410 smf.compare.keys $outroot.$extname.keys psfKeys 410 smf.compare.keys $outroot.$extname.keys psfKeys; # TAP: 1 411 411 if ($NfailKeys) set NfailPsf = $NfailPsf + 1 412 412 … … 414 414 echo "##### comparison results in $outroot.$extname.txt #####" 415 415 smf.compare.onechip $outroot.$extname $smf1 {$Next1-1} $smf2 {$Next2-1}; # Note smf.compare.onechip counts from 0 = first extension 416 # TAP: 2 + Nfields 416 417 end 417 418 … … 422 423 echo "##### comparison results in $outroot.$extname.keys #####" 423 424 exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys 424 smf.compare.keys $outroot.$extname.keys hdrKeys 425 smf.compare.keys $outroot.$extname.keys hdrKeys; # TAP: 1 425 426 if ($NfailKeys) set NfailHdr = $NfailHdr + 1 426 427 end … … 432 433 echo "##### comparison results in $outroot.$extname.keys #####" 433 434 exec ippCheckKeys $smf1 $Next1 $smf2 $Next2 >& $outroot.$extname.keys 434 smf.compare.keys $outroot.$extname.keys psfKeys 435 smf.compare.keys $outroot.$extname.keys psfKeys; # TAP: 1 435 436 if ($NfailKeys) set NfailPsf = $NfailPsf + 1 436 437 … … 440 441 end 441 442 end 442 ok ($NfailHdr == 0) "$NfailHdr HDR headers failed comparison" 443 ok ($NfailPsf == 0) "$NfailPsf PSF headers failed comparison" 444 445 done 443 tap.ok ($NfailHdr == 0) "$NfailHdr HDR headers failed comparison" ; # TAP: each file 444 tap.ok ($NfailPsf == 0) "$NfailPsf PSF headers failed comparison" ; # TAP: each file 446 445 end 447 446 … … 474 473 $smf2_has_data = ($tfields:n > 0) && ($table:Ny > 0) 475 474 476 ok ($smf1_has_data == $smf2_has_data) "tables both have (or both lack) data"475 tap.ok ($smf1_has_data == $smf2_has_data) "tables both have (or both lack) data" ; # TAP: each chip 477 476 if (not($smf1_has_data) || not($smf2_has_data)) 478 477 echo "no data in tables $smf1 $ext1 or $smf2 $ext2, skipping" 479 478 # I should account for the number of skipped tests 479 local Nfields 480 book npages psfFields -var Nfields 481 tap.skip {$Nfields + 1} 480 482 return 481 483 end … … 554 556 # 555 557 output $output.txt 556 echo " $N1_keep & $N1_miss vs $N2_keep & $N2_miss"558 echo "PSF FIELDS: $N1_keep & $N1_miss vs $N2_keep & $N2_miss" 557 559 output stdout 558 559 # positional consistency:560 set dX = X_PSF_$v1 - Xm_$v2561 set dY = Y_PSF_$v1 - Ym_$v2562 563 # add a test here?564 # XXX this test is equivalent to tests of the fields below565 # but cannot be as finely controlled566 # vstat -q dX567 # ok ($SIGMA < 0.1) "X position stdev $SIGMA < 0.1"568 # vstat -q dY569 # ok ($SIGMA < 0.1) "Y position stdev $SIGMA < 0.1"570 560 end 571 561 … … 596 586 end 597 587 598 ok ($NfailFieldsPSF == 0) "$NfailFieldsPSF fields failed comparison" 599 588 tap.ok ($NfailFieldsPSF == 0) "$NfailFieldsPSF fields failed comparison"; # TAP: each chip 600 589 end 601 590 … … 715 704 fprintf "%24s : $PASS : SKIP" $field 716 705 output stdout 706 tap.skip 1 717 707 return 718 708 end … … 728 718 if ($hist:minVal < $minGood) set PASS = 0 729 719 if ($hist:maxVal > $maxGood) set PASS = 0 720 if (isinf($hist:maxVal)) set PASS = 0 721 if (isinf($hist:minVal)) set PASS = 0 730 722 731 723 # save the summary line to be written to a file by the calling function … … 734 726 output stdout 735 727 736 ok ($PASS) "PSF table field $field comparison"728 tap.ok ($PASS) "PSF table field $field comparison"; # TAP: each field 737 729 end 738 730 … … 796 788 $NfailKeys ++ 797 789 end 798 ok ($NfailKeys == 0) "$NfailKeys keys failed comparison"790 tap.ok ($NfailKeys == 0) "$NfailKeys keys failed comparison" ; # TAP: called 2x per chip 799 791 end 800 792 -
branches/eam_branches/ipp-20211108/ippTests/ippCheck/tap.pro
r42024 r42058 3 3 if (not($?TAP_VERBOSE)) set TAP_VERBOSE = 1 4 4 5 macro plan5 macro tap.plan 6 6 if ($0 != 2) 7 7 echo "USAGE: plan (Ntest)" … … 12 12 $tap_Npass = 0 13 13 $tap_Nfail = 0 14 $tap_Nskip = 0 14 15 $tap_Ntest = 0 15 16 end 16 17 17 macro done18 if ( not($?tap_Nplan))19 echo " ERROR: tap tests not planned"18 macro tap.skip 19 if ($0 != 2) 20 echo "USAGE skip (Nskip)" 20 21 break 21 22 end 22 23 23 echo "planned $tap_Nplan tests, ran $tap_Ntest" 24 echo "passed $tap_Npass tests, failed $tap_Nfail tests" 25 26 if (($tap_Nfail == 0) && ($tap_Ntest == $tap_Nplan) && ($tap_Npass == $tap_Ntest)) 27 echo "PASS: all tests run and passed" 28 return 1 29 end 30 31 if ($tap_Nfail > 0) 32 echo "FAIL: $tap_Nfail tests failed" 33 end 34 35 if ($tap_Ntest != $tap_Nplan) 36 echo "FAIL: not all tests run" 37 end 38 39 if ($tap_Ntest != $tap_Npass + $tap_Nfail) 40 echo "FAIL: inconsistent count: $tap_Ntest tests != $tap_Npass pass + $tap_Nfail fail" 41 end 24 $tap_Nskip += $1 42 25 end 43 26 44 macro ok27 macro tap.ok 45 28 if ($0 != 3) 46 echo "USAGE (condition) (label)"29 echo "USAGE: ok (condition) (label)" 47 30 break 48 31 end … … 63 46 end 64 47 48 macro tap.done 49 if (not($?tap_Nplan)) 50 echo "ERROR: tap tests not planned" 51 break 52 end 53 54 echo "planned $tap_Nplan tests, ran $tap_Ntest, skipped $tap_Nskip" 55 echo "passed $tap_Npass tests, failed $tap_Nfail tests" 56 57 if (($tap_Nfail == 0) && ($tap_Ntest + $tap_Nskip == $tap_Nplan) && ($tap_Npass == $tap_Ntest)) 58 echo "PASS: all tests run and passed" 59 return 1 60 end 61 62 if ($tap_Nfail > 0) 63 echo "FAIL: $tap_Nfail tests failed" 64 end 65 66 if ($tap_Ntest + $tap_Nskip != $tap_Nplan) 67 echo "FAIL: not all tests run" 68 end 69 70 if ($tap_Ntest != $tap_Npass + $tap_Nfail) 71 echo "FAIL: inconsistent count: $tap_Ntest tests != $tap_Npass pass + $tap_Nfail fail" 72 end 73 end 74
Note:
See TracChangeset
for help on using the changeset viewer.
