diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-05-12 13:56:19 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-05-12 13:56:19 -0400 |
commit | fd1545197ac5ea1cc248aa98220c5d078c9555ee (patch) | |
tree | 819b9ffac9d400ede46c8818eb0ff776e26f10f9 /indra/test | |
parent | 91c20363eee4e1e02435e0ee74867cdb3f6c7136 (diff) | |
parent | 6007475c87d3edbb023cc64bb097d33e6c04dfd4 (diff) |
SL-10297: Merge branch 'sl-10297-oz' into sl-10297.
Bring in Oz's tweaks to the way BugSplat is engaged and tested, plus a few
other miscellaneous goodies.
Diffstat (limited to 'indra/test')
-rw-r--r-- | indra/test/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/test/test.cpp | 22 |
2 files changed, 19 insertions, 9 deletions
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 87536e146b..251100867f 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -13,7 +13,7 @@ include(LLXML) include(Linking) include(Tut) include(LLAddBuildTest) - +include(bugsplat) include(GoogleMock) include_directories( @@ -83,6 +83,10 @@ list(APPEND test_SOURCE_FILES ${test_HEADER_FILES}) add_executable(lltest ${test_SOURCE_FILES}) +if (USE_BUGSPLAT) + set_target_properties(lltest PROPERTIES COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}") +endif (USE_BUGSPLAT) + target_link_libraries(lltest ${LEGACY_STDIO_LIBS} ${LLDATABASE_LIBRARIES} diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 87c4a8d8a3..571f502861 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -75,7 +75,18 @@ #include <fstream> -void wouldHaveCrashed(const std::string& message); +LLError::ErrFatalHookResult wouldHaveCrashed(const std::string& message) +{ +#if LL_MSVC +#pragma warning (push) +#pragma warning (disable : 4702) // warning C4702: unreachable code +#endif + tut::fail("fatal error message: " + message); + return LLError::ERR_DO_NOT_CRASH; +#if LL_MSVC +#pragma warning (pop) +#endif +} namespace tut { @@ -146,7 +157,7 @@ public: mOldSettings(LLError::saveAndResetSettings()), mRecorder(new RecordToTempFile(pool)) { - LLError::setFatalFunction(wouldHaveCrashed); + LLError::setFatalHook(wouldHaveCrashed); LLError::setDefaultLevel(level); LLError::addRecorder(mRecorder); } @@ -512,11 +523,6 @@ void stream_groups(std::ostream& s, const char* app) } } -void wouldHaveCrashed(const std::string& message) -{ - tut::fail("llerrs message: " + message); -} - static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL; int main(int argc, char **argv) @@ -626,7 +632,7 @@ int main(int argc, char **argv) replayer.reset(new LLReplayLogReal(level, gAPRPoolp)); } } - LLError::setFatalFunction(wouldHaveCrashed); + LLError::setFatalHook(wouldHaveCrashed); std::string test_app_name(argv[0]); std::string test_log = test_app_name + ".log"; LLFile::remove(test_log); |