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