diff --git a/renderdoc/3rdparty/catch/catch.cpp b/renderdoc/3rdparty/catch/catch.cpp index be6b73367..9e9ae9a28 100644 --- a/renderdoc/3rdparty/catch/catch.cpp +++ b/renderdoc/3rdparty/catch/catch.cpp @@ -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); -} \ No newline at end of file +} + +#else + +#include "api/replay/renderdoc_replay.h" + +extern "C" RENDERDOC_API int RENDERDOC_CC RENDERDOC_RunUnitTests(const rdcstr &command, + const rdcarray &args) +{ + return 0; +} + +#endif // ENABLED(ENABLE_UNIT_TESTS)