Skip to content

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

@bartlettroscoe

Description

@bartlettroscoe

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    ToDo

    Status

    ToDo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions