Skip to content
  • Ryan Thornton's avatar
    GoogleTest: Add tests for MultiConfig discovery in PRE_TEST mode · 3b4838b5
    Ryan Thornton authored
    PRE_TEST makes it possible to properly distinguish between test cases
    that exist only in certain configurations.
    
    In the new test scenario, debug tests are disabled in release builds,
    and release tests are disabled in debug builds
    when a multi config generator is used.
    
    Note, this is a bit of a hack and *only* works for PRE_TEST mode.
    
    POST_BUILD makes no attempt to get this right. It preserves the status quo
    and you obtain the tests that were last discovered.
    
    See further discussion in !4078
    
    Ideally, the POST_BUILD behavior could be fixed
    by using generator expressions in OUTPUT and BYPRODUCT expressions.
    
    Then you could do something like:
    
        set(ctest_include_file "${ctest_file_base}_include-$<CONFIG>.cmake")
        set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")
    
    Once #12877
    
     lands, maybe this can be revisited.
    
    Co-authored-by: default avatarRyan Thornton <ThorntonRyan@JohnDeere.com>
    Co-authored-by: default avatarKevin Puetz <PuetzKevinA@JohnDeere.com>
    3b4838b5