| 3 |  | # Render and primitive type testing | 
| 4 |  | # | 
| 5 |  |  | 
| 6 | + | # Number of processes to use on tests that run multi-core | 
| 7 | + | ifeq ($(OS),Windows_NT)  # is Windows | 
| 8 | + | NPROC := 1 | 
| 9 | + | else | 
| 10 | + | NPROC := 2 | 
| 11 | + | endif | 
| 12 | + |  | 
| 13 |  | # Image reduction for comparisons | 
| 14 |  | RDU_PFILT = pfilt -1 -r 1 -x 128 -y 128 -pa 1 | 
| 15 |  |  | 
| 16 |  | # Image comparison command | 
| 17 | < | IMG_CMP = radcompare -rms 0.08 -max 1.5 | 
| 17 | > | IMG_CMP = radcompare -rel 0.007 -rms 0.1 -max 1.5 | 
| 18 |  |  | 
| 19 |  | # Default target is to test everything | 
| 20 | < | all:    test-dielectric-def test-dielectric-fish test-glass-def \ | 
| 21 | < | test-glass-fish test-glass-up test-inst-def test-inst-fish \ | 
| 22 | < | test-mesh-def test-mesh-cyl test-mirror-fish test-mist-def \ | 
| 23 | < | test-tfunc-def test-tfunc-fish test-trans-def test-trans-fish \ | 
| 24 | < | test-trans2-def test-trans2-fish | 
| 20 | > | all:    test-xform test-oconv test-rad test-rfluxmtx test-rpiece \ | 
| 21 | > | test-rpict test-mkpmap \ | 
| 22 | > | test-trans2-def test-trans2-fish test-trans2-win \ | 
| 23 | > | test-mixtex-def test-mixtex-fish test-mixtex-plan test-mixtex-rplan \ | 
| 24 | > | test-tfunc-def test-tfunc-fish test-inst-def test-inst-fish \ | 
| 25 | > | test-mesh-def test-mesh-cyl test-mesh-cyl2 test-mist-def \ | 
| 26 | > | test-dielectric-def test-dielectric-fish test-trans-def \ | 
| 27 | > | test-glass-def test-glass-fish test-glass-up \ | 
| 28 | > | test-trans-fish test-patterns-def test-patterns-plan \ | 
| 29 | > | test-rtrace test-mirror-fish test-obj2mesh \ | 
| 30 | > | test-prism1-fish test-prism2-fish test-spectra-fish | 
| 31 |  |  | 
| 32 |  | clean: | 
| 33 | < | rm -f *.oct *.amb *_ill.dat *_*.hdr *.unf combined.rad | 
| 33 | > | rm -f *.oct *.amb *_ill.dat blinds_ill?.dat *_*.hdr *.unf \ | 
| 34 | > | *.[cg]pm{,.leaf} inst_rad.txt combined.rad rfmirror.mtx | 
| 35 |  |  | 
| 36 | < | # Special test of xform | 
| 36 | > | ###### | 
| 37 | > | # More-or-less evenly divided batches for NPROC=1 (redundancies removed) | 
| 38 |  |  | 
| 39 | < | test-xform:     combined_scene.rad | 
| 40 | < | xform -f combined_scene.rad | grep -v '^[       ]*#' > combined.rad | 
| 26 | < | radcompare ref/combined.rad combined.rad | 
| 39 | > | batch1: test-mixtex-def test-mixtex-fish test-mixtex-plan test-mixtex-rplan \ | 
| 40 | > | test-xform test-oconv test-rad test-obj2mesh | 
| 41 |  |  | 
| 42 | + | batch2: test-rfluxmtx test-mist-def test-glass-def test-glass-fish test-glass-up | 
| 43 | + |  | 
| 44 | + | batch3: test-inst-def test-inst-fish test-trans2-def test-trans2-fish test-trans2-win \ | 
| 45 | + | test-dielectric-def test-dielectric-fish | 
| 46 | + |  | 
| 47 | + | batch4: test-rtrace test-prism1-fish test-prism2-fish test-mirror-fish \ | 
| 48 | + | test-mesh-def test-mesh-cyl test-mesh-cyl2 test-tfunc-def test-tfunc-fish \ | 
| 49 | + | test-trans-def test-trans-fish test-patterns-def test-patterns-plan | 
| 50 | + |  | 
| 51 | + | ### Test Aliases ### | 
| 52 | + |  | 
| 53 | + | test-rpict:     test-mirror-fish | 
| 54 | + |  | 
| 55 | + | test-rpiece test-mkpmap:        test-mixtex-def | 
| 56 | + |  | 
| 57 | + | ### Special test of xform ### | 
| 58 | + |  | 
| 59 | + | test-xform:     combined.rad | 
| 60 | + | radcompare "-c#" -max 0.04 ref/combined.rad combined.rad | 
| 61 | + |  | 
| 62 | + | combined.rad:   combined_scene.rad | 
| 63 | + | xform -f combined_scene.rad > combined.rad | 
| 64 | + |  | 
| 65 | + | ### Special test of rad ### | 
| 66 | + |  | 
| 67 | + | test-rad:       inst.oct | 
| 68 | + | rad -n -s -e inst.rif > inst_rad.txt | 
| 69 | + | radcompare ref/inst_rad.txt inst_rad.txt | 
| 70 | + |  | 
| 71 | + | ### Special tests of oconv and obj2mesh ### | 
| 72 | + |  | 
| 73 | + | test-oconv:     inst.oct | 
| 74 | + | radcompare ref/inst.oct inst.oct | 
| 75 | + |  | 
| 76 | + | test-obj2mesh:  cab.obj | 
| 77 | + | obj2mesh -w cab.obj | radcompare ref/cab.rtm - | 
| 78 | + |  | 
| 79 | + | ### Special test of rtrace ### | 
| 80 | + |  | 
| 81 | + | test-rtrace:    ref/mirror_fish.hdr rtmirror_fish.hdr | 
| 82 | + | $(RDU_PFILT) rtmirror_fish.hdr | $(IMG_CMP) -h ref/mirror_fish.hdr - | 
| 83 | + |  | 
| 84 | + | rtmirror_fish.hdr:      mirror.oct | 
| 85 | + | rad -v 0 mirror.rif OPT=mirror.opt | 
| 86 | + | vwrays -ff -vf fish.vf -x 2048 -y 1991 | rtrace -n $(NPROC) @mirror.opt \ | 
| 87 | + | -ffc -x 2048 -y 1991 mirror.oct | pfilt -1 -e +3 -r .6 -x /2 -y /2 \ | 
| 88 | + | > rtmirror_fish.hdr | 
| 89 | + | rm -f mirror.opt | 
| 90 | + |  | 
| 91 | + | ### Special test for rfluxmtx (and rcontrib) ### | 
| 92 | + |  | 
| 93 | + | test-rfluxmtx:  ref/rfmirror.mtx rfmirror.mtx | 
| 94 | + | radcompare -max .4 -rms .05 -rel 1e-4 ref/rfmirror.mtx rfmirror.mtx | 
| 95 | + |  | 
| 96 | + | rfmirror.mtx:   mirror.rad dummysky.rad basic.mat diorama_walls.rad \ | 
| 97 | + | closed_end.rad front_cap.rad glass_pane.rad antimatter_portal.rad | 
| 98 | + | rfluxmtx -n $(NPROC) -ab 2 -lw 1e-4 mirror.rad dummysky.rad \ | 
| 99 | + | basic.mat diorama_walls.rad closed_end.rad front_cap.rad \ | 
| 100 | + | glass_pane.rad antimatter_portal.rad > rfmirror.mtx | 
| 101 | + |  | 
| 102 |  | ### Octree for dielectric ### | 
| 103 |  |  | 
| 104 |  | dielectric.oct: dielectric.rif | 
| 278 |  |  | 
| 279 |  | ### End  mirror-fish  tests | 
| 280 |  |  | 
| 207 | – | ### Octree for    mist ### | 
| 208 | – |  | 
| 209 | – | mist.oct:       mist.rif | 
| 210 | – | rad -v 0    mist.rif | 
| 211 | – |  | 
| 281 |  | ### Reference and test for    mist view   def ### | 
| 282 |  |  | 
| 283 |  | test-mist-def:  ref/mist_def.hdr    mist_def.hdr | 
| 287 |  | make    mist_def.hdr | 
| 288 |  | $(RDU_PFILT)    mist_def.hdr > ref/mist_def.hdr | 
| 289 |  |  | 
| 290 | < | mist_def.hdr:   mist.oct | 
| 291 | < | rad -v   def    mist.rif | 
| 290 | > | mist_def.hdr:   mist.rif | 
| 291 | > | rad -N $(NPROC) mist.rif | 
| 292 |  |  | 
| 293 |  | ### End    mist-def   tests | 
| 294 |  |  | 
| 332 |  |  | 
| 333 |  | ### Octree for   tfunc ### | 
| 334 |  |  | 
| 335 | < | tfunc.oct:      tfunc.rif | 
| 335 | > | tfunc1.oct:     tfunc.rif | 
| 336 |  | rad -v 0   tfunc.rif | 
| 337 |  |  | 
| 338 |  | ### Reference and test for   tfunc view   def ### | 
| 344 |  | make   tfunc_def.hdr | 
| 345 |  | $(RDU_PFILT)   tfunc_def.hdr > ref/tfunc_def.hdr | 
| 346 |  |  | 
| 347 | < | tfunc_def.hdr:  tfunc.oct | 
| 347 | > | tfunc_def.hdr:  tfunc1.oct | 
| 348 |  | rad -v   def   tfunc.rif | 
| 349 |  |  | 
| 350 |  | ### End   tfunc-def   tests | 
| 358 |  | make   tfunc_fish.hdr | 
| 359 |  | $(RDU_PFILT)   tfunc_fish.hdr > ref/tfunc_fish.hdr | 
| 360 |  |  | 
| 361 | < | tfunc_fish.hdr: tfunc.oct | 
| 361 | > | tfunc_fish.hdr: tfunc1.oct | 
| 362 |  | rad -v  fish   tfunc.rif | 
| 363 |  |  | 
| 364 |  | ### End   tfunc-fish  tests | 
| 398 |  |  | 
| 399 |  | ### Octree for  trans2 ### | 
| 400 |  |  | 
| 401 | < | trans2.oct:     trans2.rif | 
| 401 | > | trans21.oct:    trans2.rif | 
| 402 |  | rad -v 0  trans2.rif | 
| 403 |  |  | 
| 404 |  | ### Reference and test for  trans2 view   def ### | 
| 410 |  | make  trans2_def.hdr | 
| 411 |  | $(RDU_PFILT)  trans2_def.hdr > ref/trans2_def.hdr | 
| 412 |  |  | 
| 413 | < | trans2_def.hdr: trans2.oct | 
| 413 | > | trans2_def.hdr: trans21.oct | 
| 414 |  | rad -v   def  trans2.rif | 
| 415 |  |  | 
| 416 |  | ### End  trans2-def   tests | 
| 424 |  | make  trans2_fish.hdr | 
| 425 |  | $(RDU_PFILT)  trans2_fish.hdr > ref/trans2_fish.hdr | 
| 426 |  |  | 
| 427 | < | trans2_fish.hdr:        trans2.oct | 
| 427 | > | trans2_fish.hdr:        trans21.oct | 
| 428 |  | rad -v  fish  trans2.rif | 
| 429 |  |  | 
| 430 |  | ### End  trans2-fish  tests | 
| 438 |  | make  trans2_win.hdr | 
| 439 |  | $(RDU_PFILT)  trans2_win.hdr > ref/trans2_win.hdr | 
| 440 |  |  | 
| 441 | < | trans2_win.hdr: trans2.oct | 
| 441 | > | trans2_win.hdr: trans21.oct | 
| 442 |  | rad -v   win  trans2.rif | 
| 443 |  |  | 
| 444 |  | ### End  trans2-win   tests | 
| 445 | + |  | 
| 446 | + | ### Octree for patterns ### | 
| 447 | + |  | 
| 448 | + | patterns.oct:   patterns.rif | 
| 449 | + | rad -v 0 patterns.rif | 
| 450 | + |  | 
| 451 | + | ### Reference and test for patterns view   def ### | 
| 452 | + |  | 
| 453 | + | test-patterns-def:      ref/patterns_def.hdr patterns_def.hdr | 
| 454 | + | $(RDU_PFILT) patterns_def.hdr | $(IMG_CMP) ref/patterns_def.hdr - | 
| 455 | + |  | 
| 456 | + | ref/patterns_def.hdr: | 
| 457 | + | make patterns_def.hdr | 
| 458 | + | $(RDU_PFILT) patterns_def.hdr > ref/patterns_def.hdr | 
| 459 | + |  | 
| 460 | + | patterns_def.hdr:       patterns.oct | 
| 461 | + | rad -v   def patterns.rif | 
| 462 | + |  | 
| 463 | + | ### End patterns-def   tests | 
| 464 | + |  | 
| 465 | + | ### Reference and test for patterns view   plan ### | 
| 466 | + |  | 
| 467 | + | test-patterns-plan:     ref/patterns_plan.hdr patterns_plan.hdr | 
| 468 | + | $(RDU_PFILT) patterns_plan.hdr | $(IMG_CMP) ref/patterns_plan.hdr - | 
| 469 | + |  | 
| 470 | + | ref/patterns_plan.hdr: | 
| 471 | + | make patterns_plan.hdr | 
| 472 | + | $(RDU_PFILT) patterns_plan.hdr > ref/patterns_plan.hdr | 
| 473 | + |  | 
| 474 | + | patterns_plan.hdr:      patterns.oct | 
| 475 | + | rad -v   plan patterns.rif | 
| 476 | + |  | 
| 477 | + | ### End patterns-plan   tests | 
| 478 | + |  | 
| 479 | + | ### Octree for  mixtex ### | 
| 480 | + |  | 
| 481 | + | mixtex.oct:     mixtex.rif | 
| 482 | + | rad -v 0 -N $(NPROC) mixtex.rif | 
| 483 | + |  | 
| 484 | + | ### Reference and test for  mixtex view   def ### | 
| 485 | + |  | 
| 486 | + | test-mixtex-def:        ref/mixtex_def.hdr  mixtex_def.hdr | 
| 487 | + | $(RDU_PFILT)  mixtex_def.hdr | $(IMG_CMP) ref/mixtex_def.hdr - | 
| 488 | + |  | 
| 489 | + | ref/mixtex_def.hdr: | 
| 490 | + | make  mixtex_def.hdr | 
| 491 | + | $(RDU_PFILT)  mixtex_def.hdr > ref/mixtex_def.hdr | 
| 492 | + |  | 
| 493 | + | mixtex_def.hdr: mixtex.oct | 
| 494 | + | rad -v def -N $(NPROC) mixtex.rif | 
| 495 | + |  | 
| 496 | + | ### End  mixtex-def   tests | 
| 497 | + |  | 
| 498 | + | ### Reference and test for  mixtex view  fish ### | 
| 499 | + |  | 
| 500 | + | test-mixtex-fish:       ref/mixtex_fish.hdr  mixtex_fish.hdr | 
| 501 | + | $(RDU_PFILT)  mixtex_fish.hdr | $(IMG_CMP) ref/mixtex_fish.hdr - | 
| 502 | + |  | 
| 503 | + | ref/mixtex_fish.hdr: | 
| 504 | + | make  mixtex_fish.hdr | 
| 505 | + | $(RDU_PFILT)  mixtex_fish.hdr > ref/mixtex_fish.hdr | 
| 506 | + |  | 
| 507 | + | mixtex_fish.hdr:        mixtex.oct | 
| 508 | + | rad -v  fish  mixtex.rif | 
| 509 | + |  | 
| 510 | + | ### End  mixtex-fish  tests | 
| 511 | + |  | 
| 512 | + | ### Reference and test for  mixtex view  plan ### | 
| 513 | + |  | 
| 514 | + | test-mixtex-plan:       ref/mixtex_plan.hdr  mixtex_plan.hdr | 
| 515 | + | $(RDU_PFILT)  mixtex_plan.hdr | $(IMG_CMP) ref/mixtex_plan.hdr - | 
| 516 | + |  | 
| 517 | + | ref/mixtex_plan.hdr: | 
| 518 | + | make  mixtex_plan.hdr | 
| 519 | + | $(RDU_PFILT)  mixtex_plan.hdr > ref/mixtex_plan.hdr | 
| 520 | + |  | 
| 521 | + | mixtex_plan.hdr:        mixtex.oct | 
| 522 | + | rad -v  plan  mixtex.rif | 
| 523 | + |  | 
| 524 | + | ### End  mixtex-plan  tests | 
| 525 | + |  | 
| 526 | + | ### Reference and test for  mixtex view rplan ### | 
| 527 | + |  | 
| 528 | + | test-mixtex-rplan:      ref/mixtex_rplan.hdr  mixtex_rplan.hdr | 
| 529 | + | $(RDU_PFILT)  mixtex_rplan.hdr | $(IMG_CMP) ref/mixtex_rplan.hdr - | 
| 530 | + |  | 
| 531 | + | ref/mixtex_rplan.hdr: | 
| 532 | + | make  mixtex_rplan.hdr | 
| 533 | + | $(RDU_PFILT)  mixtex_rplan.hdr > ref/mixtex_rplan.hdr | 
| 534 | + |  | 
| 535 | + | mixtex_rplan.hdr:       mixtex.oct | 
| 536 | + | rad -v rplan  mixtex.rif | 
| 537 | + |  | 
| 538 | + | ### End  mixtex-rplan tests | 
| 539 | + |  | 
| 540 | + | ### Reference and test for spectra fish ### | 
| 541 | + |  | 
| 542 | + | test-spectra-fish:      ref/spectra_fish.hdr spectra_fish.hdr | 
| 543 | + | $(RDU_PFILT) spectra_fish.hdr | $(IMG_CMP) ref/spectra_fish.hdr - | 
| 544 | + |  | 
| 545 | + | ref/spectra_fish.hdr: | 
| 546 | + | make spectra_fish.hdr | 
| 547 | + | $(RDU_PFILT) spectra_fish.hdr > ref/spectra_fish.hdr | 
| 548 | + |  | 
| 549 | + | spectra_fish.hdr:       spectra.oct | 
| 550 | + | rad -v fish spectra.rif | 
| 551 | + |  | 
| 552 | + | ### End spectra-fish tests |