From c63bc5df4ef5560b5bbd42bf01e7deb097d2ca0f Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 10 Oct 2019 16:28:16 +1100 Subject: [PATCH] tools: add a backtrace generating test --- CMakeLists.txt | 2 +- tools/backtrace.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tools/backtrace.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index bd331d5d..317283da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -619,7 +619,7 @@ endif () ############################################################################### -foreach (tool cpuid log poisson macro scratch) +foreach (tool backtrace cpuid log poisson macro scratch) add_executable (util_${tool} tools/${tool}.cpp) set_target_properties (util_${tool} PROPERTIES OUTPUT_NAME ${tool}) target_link_libraries (util_${tool} cruft) diff --git a/tools/backtrace.cpp b/tools/backtrace.cpp new file mode 100644 index 00000000..14f0eb8e --- /dev/null +++ b/tools/backtrace.cpp @@ -0,0 +1,17 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 2019, Danny Robson + */ + +#include + +#include + + +int main () +{ + std::cout << cruft::backtrace () << '\n'; +} \ No newline at end of file