diff --git a/nano/core_test/CMakeLists.txt b/nano/core_test/CMakeLists.txt index 1d01f6e796..eb2ec101ed 100644 --- a/nano/core_test/CMakeLists.txt +++ b/nano/core_test/CMakeLists.txt @@ -51,6 +51,7 @@ add_executable( request_aggregator.cpp signal_manager.cpp socket.cpp + stacktrace.cpp system.cpp telemetry.cpp throttle.cpp diff --git a/nano/core_test/stacktrace.cpp b/nano/core_test/stacktrace.cpp new file mode 100644 index 0000000000..5c2737f75f --- /dev/null +++ b/nano/core_test/stacktrace.cpp @@ -0,0 +1,13 @@ +#include + +#include + +// Check that the stacktrace contains the current function name +// This depend on the way testcase names are compiled by gtest +// "stacktrace_human_readable_Test::TestBody()" +TEST (stacktrace, human_readable) +{ + auto stacktrace = nano::generate_stacktrace (); + ASSERT_FALSE (stacktrace.empty ()); + ASSERT_TRUE (stacktrace.find ("stacktrace_human_readable_Test") != std::string::npos); +} \ No newline at end of file