Disable Unit Test Support for a single build configuration

Sysprogs forums Forums VisualGDB Disable Unit Test Support for a single build configuration

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29009
    Jose Cazarin
    Participant

    Hello!

    It looks like the “Unit Test Support” (using GoogleTest in my case) can’t be disabled in a per Configuration basis, just for the whole project

    Is there any way that it can be disabled for a single configuration?

    The reasoning behind this is that the compilation of the Google Test related file uses 14k of the flash, and we want to keep the generated binary as small as possible, and since production binaries don’t need to have unit test support, it doesn’t make sense to compile the Google Test files in this scenario.

     

    Thanks!

    #29052
    support
    Keymaster

    Hi,

    This is supported starting from the new VisualGDB 5.5 RC1 using the Embedded CMake Project Subsystem. You can now define arbitrary platforms/configurations with arbitrary CMake variables and use the if() syntax in CMakeLists.txt to conditionally enable/disable various features. You can also have multiple targets per project (e.g. one unit test target and one regular application, both referencing a common library).

    We will be publishing a few tutorials on the new Embedded CMake Project subsystem soon, explaining the new layout in details.

    #29075
    Jose Cazarin
    Participant

    We don’t use the Cmake build in our project, we use the MSBuild from Visual Studio, is there support for it as well?

    #29076
    support
    Keymaster

    Sorry, MSBuild projects share the same project structure (i.e. the set of source files) across all platforms and configurations, hence global settings like the test framework/BSP affect all configurations.

    You can work around it by defining per-configuration preprocessor macros and #ifdef-ing out the code that calls test framework functionality, but the test sources will be still present in Solution Explorer.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.