Include debug symbols in Release build, rework exception stack trace.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-08-16 16:59:13 +02:00
parent 5a14c712d2
commit 620248f329
3 changed files with 61 additions and 32 deletions

View File

@@ -3,15 +3,19 @@
#include "../src/Exception.hpp"
using namespace ArbUt;
#ifndef WINDOWS
__attribute__((optnone))
#endif
static void Thrower(){
throw ArbUt::Exception("foobar");
}
TEST_CASE("Throw exception get stack trace") {
try {
throw ArbUt::Exception("foobar");
Thrower();
} catch (const ArbUt::Exception& e) {
#ifndef NDEBUG
REQUIRE(e.GetStacktrace(1) == "ExceptionTests.cpp[8] ____C_A_T_C_H____T_E_S_T____0()\n");
#else
REQUIRE(e.GetStacktrace(1, false) == "ArbutilsTests Catch::RunContext::runTest(Catch::TestCase const&)\n");
#endif
REQUIRE(e.GetStacktrace(1) == "Stacktrace with depth 1: \n"
"ExceptionTests.cpp[10] Thrower()\n");
}
}