mcnptools icon indicating copy to clipboard operation
mcnptools copied to clipboard

test files not working on windows

Open kermitnuc opened this issue 3 years ago • 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

kermitnuc avatar Mar 30 '23 15:03 kermitnuc

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)

tjlaboss avatar Apr 28 '23 15:04 tjlaboss

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 !

Gtrimble42 avatar Aug 10 '24 19:08 Gtrimble42

Can you post the LastTest.log file (at least the parts from the tests that failed). Kermit bundeSent from my iPhoneOn Aug 10, 2024, at 1:06 PM, Gtrimble42 @.***> wrote: 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 !

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

kermitnuc avatar Aug 10 '24 21:08 kermitnuc

Here! Thank you

LastTest.log

Gtrimble42 avatar Aug 11 '24 16:08 Gtrimble42

Can you look in the .vts files for the tests that failed to see how they are different then the expected.  Maybe run a Unix diff on them.  If they are binary this might not be possible.Kermit bundeSent from my iPadOn Aug 11, 2024, at 10:20 AM, Gtrimble42 @.***> wrote: Here! Thank you LastTest.log

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

kermitnuc avatar Aug 11 '24 17:08 kermitnuc