Include debug symbols in Release build, rework exception stack trace.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user