mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Added libbacktrace support.
This commit is contained in:
@@ -6,6 +6,12 @@
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include "test.h"
|
||||
#include <bx/string.h>
|
||||
#include <bx/file.h>
|
||||
|
||||
namespace bx
|
||||
{
|
||||
void debugOutputCallstack(uint32_t _skip);
|
||||
}
|
||||
|
||||
bool testAssertHandler(const bx::Location& _location, const char* _format, va_list _argList)
|
||||
{
|
||||
@@ -13,6 +19,10 @@ bool testAssertHandler(const bx::Location& _location, const char* _format, va_li
|
||||
bx::vprintf(_format, _argList);
|
||||
bx::printf("\n");
|
||||
|
||||
uintptr_t stack[32];
|
||||
const uint32_t num = bx::getCallStack(2 /* skip self */, BX_COUNTOF(stack), stack);
|
||||
bx::writeCallstack(bx::getStdOut(), stack, num, bx::ErrorIgnore{});
|
||||
|
||||
// Throwing exceptions is required for testing asserts being trigged.
|
||||
// Use REQUIRE_ASSERTS to test asserts.
|
||||
throw std::exception();
|
||||
|
||||
Reference in New Issue
Block a user