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

tribits_add[_advanced]_test(): Extract exec path from target name #581

Open
bartlettroscoe opened this issue May 11, 2023 · 0 comments
Open

Comments

@bartlettroscoe
Copy link
Member

While working on #63, I realized that tribits_add_test() and tribits_add_advanced_test() I realized that we can make these extract the exec path from the target name automatically, even with an MPI build, by using the $<TARGET_FILE:exeName> generator expression. To do this, we just need to do the following:

  • Combine the functions tribits_add_test_get_exe_binary_name() and tribits_add_test_adjust_directory() into a single function tribits_add_test_get_exe_binary_path() that will return $<TARGET_FILE:exeName> when execName is a target name.

  • Change from file(WRITE "${TEST_SCRIPT_FILE}" "${TEST_SCRIPT_STR}" ) to file(GENERATE ...) in TribitsAddAdvancedTest.cmake when not in testing mode.

This would make it so that you don't need to specify the DIRECTORY argument to the location of the executable. And this would work for MPI as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ToDo
Status: ToDo
Development

No branches or pull requests

1 participant