Don't compile Catch2 into release builds

This commit is contained in:
baldurk
2019-05-02 11:28:40 +01:00
parent 346d01b17a
commit c7bd434024
+18 -3
View File
@@ -22,12 +22,15 @@
* THE SOFTWARE.
******************************************************************************/
#include "common/globalconfig.h"
#if ENABLED(ENABLE_UNIT_TESTS)
#define CATCH_CONFIG_RUNNER
#define CATCH_CONFIG_NOSTDOUT
#include "catch.hpp"
#include "api/replay/renderdoc_replay.h"
#include "serialise/serialiser.h"
#include "strings/string_utils.h"
#include "catch.hpp"
// since we force use of ToStr for everything and don't allow using catch's stringstream (so that
// enums get forwarded to ToStr) we need to implement ToStr for one of Catch's structs.
@@ -310,4 +313,16 @@ extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_RunUnitTests(const rdcstr &c
// the return value to 255 prevents false negative when some multiple
// of 256 tests has failed
return (numFailed < 0xff ? numFailed : 0xff);
}
}
#else
#include "api/replay/renderdoc_replay.h"
extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_RunUnitTests(const rdcstr &command,
const rdcarray<rdcstr> &args)
{
return 0;
}
#endif // ENABLED(ENABLE_UNIT_TESTS)