Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test files not working on windows #3

Open
kermitnuc opened this issue Mar 30, 2023 · 5 comments
Open

test files not working on windows #3

kermitnuc opened this issue Mar 30, 2023 · 5 comments

Comments

@kermitnuc
Copy link

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

@tjlaboss
Copy link

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)

@Gtrimble42
Copy link

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 !

@kermitnuc
Copy link
Author

kermitnuc commented Aug 10, 2024 via email

@Gtrimble42
Copy link

Here! Thank you

LastTest.log

@kermitnuc
Copy link
Author

kermitnuc commented Aug 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants