sharkdp / dbg-macro

A dbg(…) macro for C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Put tests behind feature flag in CMakeLists.txt

studoot opened this issue · comments

I'm using dbg-macro in my project by using the CMake add_subdirectory command. This brings in not just the library, but also the test executables. They don't get built, but the contained tests get added to CTest's list of tests to run, which means that CTest fails.

Looking at another header-only library that I use, I see that it uses a feature flag to exclude the tests when not wanted. This could be done with dbg-macro by wrapping lines 10-19 in:

if (DBG_MACRO_ENABLE_TESTS)
    :         :        :
(existing lines 10-19 here)
    :         :        :
endif()

I'm quite happy to create a pull-request for it...

I'm quite happy to create a pull-request for it...

Sounds great, thank you for reporting this!

closed via #43