tools: add a backtrace generating test

This commit is contained in:
Danny Robson 2019-10-10 16:28:16 +11:00
parent 7a5fa7fa2d
commit c63bc5df4e
2 changed files with 18 additions and 1 deletions

View File

@ -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) add_executable (util_${tool} tools/${tool}.cpp)
set_target_properties (util_${tool} PROPERTIES OUTPUT_NAME ${tool}) set_target_properties (util_${tool} PROPERTIES OUTPUT_NAME ${tool})
target_link_libraries (util_${tool} cruft) target_link_libraries (util_${tool} cruft)

17
tools/backtrace.cpp Normal file
View File

@ -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 <danny@nerdcruft.net>
*/
#include <cruft/util/backtrace.hpp>
#include <iostream>
int main ()
{
std::cout << cruft::backtrace () << '\n';
}