1 |
include(setup_paths.cmake) |
2 |
|
3 |
file(MAKE_DIRECTORY "${test_output_dir}/dc") |
4 |
|
5 |
set(view_def -x 50 -y 50 -vf model.vp) |
6 |
|
7 |
file(WRITE "${office_dir}/test/raytest_dc.sky" |
8 |
"void glow skyglow\n0\n0\n4\n1 1 1 0\n\nskyglow source sky\n0\n0\n4\n0 0 1 360 |
9 |
") |
10 |
|
11 |
message("Run: oconv${CMAKE_EXECUTABLE_SUFFIX} -f -i test/raytest_model.oct test/raytest_dc.sky") |
12 |
execute_process( |
13 |
WORKING_DIRECTORY ${office_dir} |
14 |
COMMAND oconv${CMAKE_EXECUTABLE_SUFFIX} -f -i test/raytest_model.oct test/raytest_dc.sky |
15 |
OUTPUT_FILE test/raytest_model_dc.oct |
16 |
) |
17 |
|
18 |
execute_process( |
19 |
WORKING_DIRECTORY ${office_dir} |
20 |
COMMAND vwrays${CMAKE_EXECUTABLE_SUFFIX} -d ${view_def} |
21 |
OUTPUT_VARIABLE vwrays_out |
22 |
) |
23 |
|
24 |
message(STATUS "vwrays_out: ${vwrays_out}") |
25 |
string(STRIP "${vwrays_out}" vwrays_out) |
26 |
separate_arguments(vwrays_out) |
27 |
|
28 |
message("Run: vwrays${CMAKE_EXECUTABLE_SUFFIX} -ff ${view_def} | rtcontrib${CMAKE_EXECUTABLE_SUFFIX} -ab 1 ${rtcontrib_threads}-V+ -fo -ffc $\(vwrays -d ${view_def}\) -f tregenza.cal -bn 146 -b tbin -o ${test_output_dir}/dc/treg%03d.hdr -m skyglow test/raytest_model_dc.oct") |
29 |
execute_process( |
30 |
WORKING_DIRECTORY ${office_dir} |
31 |
COMMAND vwrays${CMAKE_EXECUTABLE_SUFFIX} -ff ${view_def} |
32 |
COMMAND rtcontrib${CMAKE_EXECUTABLE_SUFFIX} -ab 1 ${rtcontrib_threads}-V+ -fo -ffc ${vwrays_out} -f tregenza.cal -bn 146 -b tbin -o ${test_output_dir}/dc/treg%03d.hdr -m skyglow test/raytest_model_dc.oct |
33 |
RESULT_VARIABLE res |
34 |
) |
35 |
if(NOT ${res} EQUAL 0) |
36 |
message(FATAL_ERROR "Bad return value from vwrays, res = ${res}") |
37 |
endif() |
38 |
|
39 |
execute_process( |
40 |
WORKING_DIRECTORY ${office_dir} |
41 |
COMMAND gensky${CMAKE_EXECUTABLE_SUFFIX} 03 21 12 -a 40 -o 105 -m 105 +s |
42 |
COMMAND ${perl} ${util_dir}/genskyvec.pl -m 1 |
43 |
COMMAND dctimestep${CMAKE_EXECUTABLE_SUFFIX} test/dc/treg%03d.hdr |
44 |
COMMAND pfilt${CMAKE_EXECUTABLE_SUFFIX} -1 -x /1 -y /1 |
45 |
OUTPUT_FILE test/raytest_timestep.hdr |
46 |
RESULT_VARIABLE res |
47 |
) |
48 |
|
49 |
if(NOT ${res} EQUAL 0) |
50 |
message(FATAL_ERROR "Bad return value, res = ${res}") |
51 |
endif() |
52 |
|
53 |
file(READ ${office_dir}/test/raytest_timestep.hdr test_output) |
54 |
if(test_output MATCHES "dctimestep${CMAKE_EXECUTABLE_SUFFIX} test/dc/treg%03d.hdr") |
55 |
message(STATUS "passed") |
56 |
else() |
57 |
message(STATUS "failed") |
58 |
endif() |