| 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 test-prism1-fish test-prism2-fish \ |
| 22 |
> |
test-mixtex-def test-mixtex-fish test-mixtex-plan test-mixtex-rplan \ |
| 23 |
> |
test-trans2-def test-trans2-fish test-trans2-win test-dielectric-def \ |
| 24 |
> |
test-dielectric-fish test-glass-def test-glass-fish test-glass-up \ |
| 25 |
> |
test-tfunc-def test-tfunc-fish test-inst-def test-inst-fish \ |
| 26 |
> |
test-mesh-def test-mesh-cyl test-mesh-cyl2 test-mirror-fish test-mist-def \ |
| 27 |
> |
test-trans-def test-trans-fish test-patterns-def test-patterns-plan \ |
| 28 |
> |
test-rtrace test-obj2mesh |
| 29 |
|
|
| 30 |
|
clean: |
| 31 |
< |
rm -f *.oct *.amb *_ill.dat *_*.hdr *.unf combined.rad |
| 31 |
> |
rm -f *.oct *.amb *_ill.dat blinds_ill?.dat *_*.hdr *.unf \ |
| 32 |
> |
*.[cg]pm{,.leaf} inst_rad.txt combined.rad rfmirror.mtx |
| 33 |
|
|
| 34 |
< |
# Special test of xform |
| 34 |
> |
###### |
| 35 |
> |
# More-or-less evenly divided batches for NPROC=1 (redundancies removed) |
| 36 |
|
|
| 37 |
< |
test-xform: combined_scene.rad |
| 38 |
< |
xform -f combined_scene.rad | grep -v '^[ ]*#' > combined.rad |
| 26 |
< |
radcompare ref/combined.rad combined.rad |
| 37 |
> |
batch1: test-mixtex-def test-mixtex-fish test-mixtex-plan test-mixtex-rplan \ |
| 38 |
> |
test-xform test-oconv test-rad test-obj2mesh |
| 39 |
|
|
| 40 |
+ |
batch2: test-rfluxmtx test-mist-def test-glass-def test-glass-fish test-glass-up |
| 41 |
+ |
|
| 42 |
+ |
batch3: test-inst-def test-inst-fish test-trans2-def test-trans2-fish test-trans2-win \ |
| 43 |
+ |
test-dielectric-def test-dielectric-fish |
| 44 |
+ |
|
| 45 |
+ |
batch4: test-rtrace test-prism1-fish test-prism2-fish test-mirror-fish \ |
| 46 |
+ |
test-mesh-def test-mesh-cyl test-mesh-cyl2 test-tfunc-def test-tfunc-fish \ |
| 47 |
+ |
test-trans-def test-trans-fish test-patterns-def test-patterns-plan |
| 48 |
+ |
|
| 49 |
+ |
### Test Aliases ### |
| 50 |
+ |
|
| 51 |
+ |
test-rpict: test-mirror-fish |
| 52 |
+ |
|
| 53 |
+ |
test-rpiece test-mkpmap: test-mixtex-def |
| 54 |
+ |
|
| 55 |
+ |
### Special test of xform ### |
| 56 |
+ |
|
| 57 |
+ |
test-xform: combined.rad |
| 58 |
+ |
radcompare "-c#" -max 0.04 ref/combined.rad combined.rad |
| 59 |
+ |
|
| 60 |
+ |
combined.rad: combined_scene.rad |
| 61 |
+ |
xform -f combined_scene.rad > combined.rad |
| 62 |
+ |
|
| 63 |
+ |
### Special test of rad ### |
| 64 |
+ |
|
| 65 |
+ |
test-rad: inst.oct |
| 66 |
+ |
rad -n -s -e inst.rif > inst_rad.txt |
| 67 |
+ |
radcompare ref/inst_rad.txt inst_rad.txt |
| 68 |
+ |
|
| 69 |
+ |
### Special tests of oconv and obj2mesh ### |
| 70 |
+ |
|
| 71 |
+ |
test-oconv: inst.oct |
| 72 |
+ |
radcompare ref/inst.oct inst.oct |
| 73 |
+ |
|
| 74 |
+ |
test-obj2mesh: cab.obj |
| 75 |
+ |
obj2mesh -w cab.obj | radcompare ref/cab.rtm - |
| 76 |
+ |
|
| 77 |
+ |
### Special test of rtrace ### |
| 78 |
+ |
|
| 79 |
+ |
test-rtrace: ref/mirror_fish.hdr rtmirror_fish.hdr |
| 80 |
+ |
$(RDU_PFILT) rtmirror_fish.hdr | $(IMG_CMP) -h ref/mirror_fish.hdr - |
| 81 |
+ |
|
| 82 |
+ |
rtmirror_fish.hdr: mirror.oct |
| 83 |
+ |
rad -v 0 mirror.rif OPT=mirror.opt |
| 84 |
+ |
vwrays -ff -vf fish.vf -x 2048 -y 1991 | rtrace -n $(NPROC) @mirror.opt \ |
| 85 |
+ |
-ffc -x 2048 -y 1991 mirror.oct | pfilt -1 -e +3 -r .6 -x /2 -y /2 \ |
| 86 |
+ |
> rtmirror_fish.hdr |
| 87 |
+ |
rm -f mirror.opt |
| 88 |
+ |
|
| 89 |
+ |
### Special test for rfluxmtx (and rcontrib) ### |
| 90 |
+ |
|
| 91 |
+ |
test-rfluxmtx: ref/rfmirror.mtx rfmirror.mtx |
| 92 |
+ |
radcompare -max .4 -rms .05 -rel 1e-4 ref/rfmirror.mtx rfmirror.mtx |
| 93 |
+ |
|
| 94 |
+ |
rfmirror.mtx: mirror.rad dummysky.rad basic.mat diorama_walls.rad \ |
| 95 |
+ |
closed_end.rad front_cap.rad glass_pane.rad antimatter_portal.rad |
| 96 |
+ |
rfluxmtx -n $(NPROC) -ab 2 -lw 1e-4 mirror.rad dummysky.rad \ |
| 97 |
+ |
basic.mat diorama_walls.rad closed_end.rad front_cap.rad \ |
| 98 |
+ |
glass_pane.rad antimatter_portal.rad > rfmirror.mtx |
| 99 |
+ |
|
| 100 |
|
### Octree for dielectric ### |
| 101 |
|
|
| 102 |
|
dielectric.oct: dielectric.rif |
| 276 |
|
|
| 277 |
|
### End mirror-fish tests |
| 278 |
|
|
| 207 |
– |
### Octree for mist ### |
| 208 |
– |
|
| 209 |
– |
mist.oct: mist.rif |
| 210 |
– |
rad -v 0 mist.rif |
| 211 |
– |
|
| 279 |
|
### Reference and test for mist view def ### |
| 280 |
|
|
| 281 |
|
test-mist-def: ref/mist_def.hdr mist_def.hdr |
| 285 |
|
make mist_def.hdr |
| 286 |
|
$(RDU_PFILT) mist_def.hdr > ref/mist_def.hdr |
| 287 |
|
|
| 288 |
< |
mist_def.hdr: mist.oct |
| 289 |
< |
rad -v def mist.rif |
| 288 |
> |
mist_def.hdr: mist.rif |
| 289 |
> |
rad -N $(NPROC) mist.rif |
| 290 |
|
|
| 291 |
|
### End mist-def tests |
| 292 |
|
|
| 330 |
|
|
| 331 |
|
### Octree for tfunc ### |
| 332 |
|
|
| 333 |
< |
tfunc.oct: tfunc.rif |
| 333 |
> |
tfunc1.oct: tfunc.rif |
| 334 |
|
rad -v 0 tfunc.rif |
| 335 |
|
|
| 336 |
|
### Reference and test for tfunc view def ### |
| 342 |
|
make tfunc_def.hdr |
| 343 |
|
$(RDU_PFILT) tfunc_def.hdr > ref/tfunc_def.hdr |
| 344 |
|
|
| 345 |
< |
tfunc_def.hdr: tfunc.oct |
| 345 |
> |
tfunc_def.hdr: tfunc1.oct |
| 346 |
|
rad -v def tfunc.rif |
| 347 |
|
|
| 348 |
|
### End tfunc-def tests |
| 356 |
|
make tfunc_fish.hdr |
| 357 |
|
$(RDU_PFILT) tfunc_fish.hdr > ref/tfunc_fish.hdr |
| 358 |
|
|
| 359 |
< |
tfunc_fish.hdr: tfunc.oct |
| 359 |
> |
tfunc_fish.hdr: tfunc1.oct |
| 360 |
|
rad -v fish tfunc.rif |
| 361 |
|
|
| 362 |
|
### End tfunc-fish tests |
| 396 |
|
|
| 397 |
|
### Octree for trans2 ### |
| 398 |
|
|
| 399 |
< |
trans2.oct: trans2.rif |
| 399 |
> |
trans21.oct: trans2.rif |
| 400 |
|
rad -v 0 trans2.rif |
| 401 |
|
|
| 402 |
|
### Reference and test for trans2 view def ### |
| 408 |
|
make trans2_def.hdr |
| 409 |
|
$(RDU_PFILT) trans2_def.hdr > ref/trans2_def.hdr |
| 410 |
|
|
| 411 |
< |
trans2_def.hdr: trans2.oct |
| 411 |
> |
trans2_def.hdr: trans21.oct |
| 412 |
|
rad -v def trans2.rif |
| 413 |
|
|
| 414 |
|
### End trans2-def tests |
| 422 |
|
make trans2_fish.hdr |
| 423 |
|
$(RDU_PFILT) trans2_fish.hdr > ref/trans2_fish.hdr |
| 424 |
|
|
| 425 |
< |
trans2_fish.hdr: trans2.oct |
| 425 |
> |
trans2_fish.hdr: trans21.oct |
| 426 |
|
rad -v fish trans2.rif |
| 427 |
|
|
| 428 |
|
### End trans2-fish tests |
| 436 |
|
make trans2_win.hdr |
| 437 |
|
$(RDU_PFILT) trans2_win.hdr > ref/trans2_win.hdr |
| 438 |
|
|
| 439 |
< |
trans2_win.hdr: trans2.oct |
| 439 |
> |
trans2_win.hdr: trans21.oct |
| 440 |
|
rad -v win trans2.rif |
| 441 |
|
|
| 442 |
|
### End trans2-win tests |
| 443 |
+ |
|
| 444 |
+ |
### Octree for patterns ### |
| 445 |
+ |
|
| 446 |
+ |
patterns.oct: patterns.rif |
| 447 |
+ |
rad -v 0 patterns.rif |
| 448 |
+ |
|
| 449 |
+ |
### Reference and test for patterns view def ### |
| 450 |
+ |
|
| 451 |
+ |
test-patterns-def: ref/patterns_def.hdr patterns_def.hdr |
| 452 |
+ |
$(RDU_PFILT) patterns_def.hdr | $(IMG_CMP) ref/patterns_def.hdr - |
| 453 |
+ |
|
| 454 |
+ |
ref/patterns_def.hdr: |
| 455 |
+ |
make patterns_def.hdr |
| 456 |
+ |
$(RDU_PFILT) patterns_def.hdr > ref/patterns_def.hdr |
| 457 |
+ |
|
| 458 |
+ |
patterns_def.hdr: patterns.oct |
| 459 |
+ |
rad -v def patterns.rif |
| 460 |
+ |
|
| 461 |
+ |
### End patterns-def tests |
| 462 |
+ |
|
| 463 |
+ |
### Reference and test for patterns view plan ### |
| 464 |
+ |
|
| 465 |
+ |
test-patterns-plan: ref/patterns_plan.hdr patterns_plan.hdr |
| 466 |
+ |
$(RDU_PFILT) patterns_plan.hdr | $(IMG_CMP) ref/patterns_plan.hdr - |
| 467 |
+ |
|
| 468 |
+ |
ref/patterns_plan.hdr: |
| 469 |
+ |
make patterns_plan.hdr |
| 470 |
+ |
$(RDU_PFILT) patterns_plan.hdr > ref/patterns_plan.hdr |
| 471 |
+ |
|
| 472 |
+ |
patterns_plan.hdr: patterns.oct |
| 473 |
+ |
rad -v plan patterns.rif |
| 474 |
+ |
|
| 475 |
+ |
### End patterns-plan tests |
| 476 |
+ |
|
| 477 |
+ |
### Octree for mixtex ### |
| 478 |
+ |
|
| 479 |
+ |
mixtex.oct: mixtex.rif |
| 480 |
+ |
rad -v 0 -N $(NPROC) mixtex.rif |
| 481 |
+ |
|
| 482 |
+ |
### Reference and test for mixtex view def ### |
| 483 |
+ |
|
| 484 |
+ |
test-mixtex-def: ref/mixtex_def.hdr mixtex_def.hdr |
| 485 |
+ |
$(RDU_PFILT) mixtex_def.hdr | $(IMG_CMP) ref/mixtex_def.hdr - |
| 486 |
+ |
|
| 487 |
+ |
ref/mixtex_def.hdr: |
| 488 |
+ |
make mixtex_def.hdr |
| 489 |
+ |
$(RDU_PFILT) mixtex_def.hdr > ref/mixtex_def.hdr |
| 490 |
+ |
|
| 491 |
+ |
mixtex_def.hdr: mixtex.oct |
| 492 |
+ |
rad -v def -N $(NPROC) mixtex.rif |
| 493 |
+ |
|
| 494 |
+ |
### End mixtex-def tests |
| 495 |
+ |
|
| 496 |
+ |
### Reference and test for mixtex view fish ### |
| 497 |
+ |
|
| 498 |
+ |
test-mixtex-fish: ref/mixtex_fish.hdr mixtex_fish.hdr |
| 499 |
+ |
$(RDU_PFILT) mixtex_fish.hdr | $(IMG_CMP) ref/mixtex_fish.hdr - |
| 500 |
+ |
|
| 501 |
+ |
ref/mixtex_fish.hdr: |
| 502 |
+ |
make mixtex_fish.hdr |
| 503 |
+ |
$(RDU_PFILT) mixtex_fish.hdr > ref/mixtex_fish.hdr |
| 504 |
+ |
|
| 505 |
+ |
mixtex_fish.hdr: mixtex.oct |
| 506 |
+ |
rad -v fish mixtex.rif |
| 507 |
+ |
|
| 508 |
+ |
### End mixtex-fish tests |
| 509 |
+ |
|
| 510 |
+ |
### Reference and test for mixtex view plan ### |
| 511 |
+ |
|
| 512 |
+ |
test-mixtex-plan: ref/mixtex_plan.hdr mixtex_plan.hdr |
| 513 |
+ |
$(RDU_PFILT) mixtex_plan.hdr | $(IMG_CMP) ref/mixtex_plan.hdr - |
| 514 |
+ |
|
| 515 |
+ |
ref/mixtex_plan.hdr: |
| 516 |
+ |
make mixtex_plan.hdr |
| 517 |
+ |
$(RDU_PFILT) mixtex_plan.hdr > ref/mixtex_plan.hdr |
| 518 |
+ |
|
| 519 |
+ |
mixtex_plan.hdr: mixtex.oct |
| 520 |
+ |
rad -v plan mixtex.rif |
| 521 |
+ |
|
| 522 |
+ |
### End mixtex-plan tests |
| 523 |
+ |
|
| 524 |
+ |
### Reference and test for mixtex view rplan ### |
| 525 |
+ |
|
| 526 |
+ |
test-mixtex-rplan: ref/mixtex_rplan.hdr mixtex_rplan.hdr |
| 527 |
+ |
$(RDU_PFILT) mixtex_rplan.hdr | $(IMG_CMP) ref/mixtex_rplan.hdr - |
| 528 |
+ |
|
| 529 |
+ |
ref/mixtex_rplan.hdr: |
| 530 |
+ |
make mixtex_rplan.hdr |
| 531 |
+ |
$(RDU_PFILT) mixtex_rplan.hdr > ref/mixtex_rplan.hdr |
| 532 |
+ |
|
| 533 |
+ |
mixtex_rplan.hdr: mixtex.oct |
| 534 |
+ |
rad -v rplan mixtex.rif |
| 535 |
+ |
|
| 536 |
+ |
### End mixtex-rplan tests |