lanl/mcnptools

test files not working on windows

Opened this issue · 5 comments

The run_test_compare.cmake files for meshtal2vtk and l3d2vtk do not seem to work correctly on windows machines.

I propose the following to fix this issue:

For the meshtal2vtk file change:foreach(OUTFILE ${OUTFILES})

Convert line endings to be consistent

configure_file("${OUTFILE}" "${OUTFILE}.unix" NEWLINE_STYLE LF)

get_filename_component(outfile_baseline "${OUTFILE}" NAME)
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files "${CMAKE_CURRENT_BINARY_DIR}/${OUTFILE}.unix" "${baselinedir}/${outfile_baseline}"
RESULT_VARIABLE out_failed
)
if ( out_failed )
message(SEND_ERROR "output .vts files do not match")
endif ( out_failed )
endforeach()

to

foreach(OUTFILE ${OUTFILES})

Convert line endings to be consistent

configure_file("${OUTFILE}" "${OUTFILE}.unix" NEWLINE_STYLE LF)

get_filename_component(outfile_baseline "${OUTFILE}" NAME)
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol "${CMAKE_CURRENT_BINARY_DIR}/${OUTFILE}" "${baselinedir}/${outfile_baseline}"
RESULT_VARIABLE out_failed
)
if ( out_failed )
message(SEND_ERROR "output .vts files do not match")
endif ( out_failed )
endforeach()

compare_files now understands that unix and windows have different line endings since the "--ignore-eol". Then the configure_file command is un-nesessary. There maybe an issue with needing complete file names to make compare_files work correctly on some windows machines.

For the l3d2vtk run_test_compare.cmake file:
replace this

Convert line endings to be consistent

configure_file("${l3d2vtk_output}" "${l3d2vtk_output}.unix" NEWLINE_STYLE LF)

execute_process(
COMMAND ${CMAKE_COMMAND} -E
compare_files --ignore-eol
"${l3d2vtk_output}.unix"
"${baselinedir}/${l3d2vtk_output}"
RESULT_VARIABLE out_failed
)

with

Convert line endings to be consistent

configure_file("${l3d2vtk_output}" "${l3d2vtk_output}.unix" NEWLINE_STYLE LF)

execute_process(
COMMAND ${CMAKE_COMMAND} -E
compare_files --ignore-eol

"${l3d2vtk_output}.unix"

"${CMAKE_CURRENT_BINARY_DIR}/${l3d2vtk_output}"
"${baselinedir}/${l3d2vtk_output}"

RESULT_VARIABLE out_failed
)

Same reasons as above.

Kermit Bunde

Hey @kermitnuc

You can use triple backticks (```) to make code appear correctly, like this:

```cmake
configure_file("${l3d2vtk_output}" "${l3d2vtk_output}.unix" NEWLINE_STYLE LF)
```

So that it reads like:

configure_file("${l3d2vtk_output}" "${l3d2vtk_output}.unix" NEWLINE_STYLE LF)

Hey I am currently also having these issues, though I am not all that familiar with c++ as python is more within my purview. This is the ctest results after I ran that.

'''

The following tests FAILED:
51 - l3d2vtk_test_r_cyl (Failed)
52 - l3d2vtk_test_r_sph (Failed)
53 - l3d2vtk_test_rt (Failed)
54 - l3d2vtk_test_rz (Failed)
55 - l3d2vtk_test_rzt (Failed)
56 - l3d2vtk_test_x (Failed)
57 - l3d2vtk_test_xy (Failed)
58 - l3d2vtk_test_xyz (Failed)
59 - meshtal2vtk_test001 (Failed)
Errors while running CTest
Output from these tests are in: C:/Users/alext/mcnptools/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
'''
So if there is a fix to it if anyone could assist me I'd appreciate it.
Thanks !

Here! Thank you

LastTest.log