https://github.com/Kitware/CMake
Revision 3b4838b57fc70bd64b29044ccbdf582f14a0574d authored by Ryan Thornton on 16 March 2020, 20:16:38 UTC, committed by Ryan Thornton on 27 March 2020, 14:40:40 UTC
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: Ryan Thornton <ThorntonRyan@JohnDeere.com>
Co-authored-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
1 parent 1ba4cb5
Raw File
Tip revision: 3b4838b57fc70bd64b29044ccbdf582f14a0574d authored by Ryan Thornton on 16 March 2020, 20:16:38 UTC
GoogleTest: Add tests for MultiConfig discovery in PRE_TEST mode
Tip revision: 3b4838b
verify.h
#ifdef VERIFY_DEBUG
#  ifndef _DEBUG
#    error "_DEBUG not defined by debug runtime library selection"
#  endif
#else
#  ifdef _DEBUG
#    error "_DEBUG defined by non-debug runtime library selection"
#  endif
#endif

#ifdef VERIFY_DLL
#  ifndef _DLL
#    error "_DLL not defined by DLL runtime library selection"
#  endif
#else
#  ifdef _DLL
#    error "_DLL defined by non-DLL runtime library selection"
#  endif
#endif

#ifdef VERIFY_MT
#  ifndef _MT
#    error "_MT not defined by multi-threaded runtime library selection"
#  endif
#else
#  ifdef _MT
#    error "_MT defined by single-threaded runtime library selection"
#  endif
#endif
back to top