Skip to content

Commit

Permalink
test backward-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
uchenily committed May 20, 2024
1 parent 2266736 commit 7899faa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 11 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
project('uvio', 'cpp',
version: '0.0.1',
default_options: [
'buildtype=debug',
'default_library=shared',
'cpp_std=c++20',
'warning_level=3'],
meson_version: '>=0.60.0')
meson_version: '>=0.63.0')

# Use libc++ by default if available instead of libstdc++ when compiling with clang.
cxx = meson.get_compiler('cpp')
Expand All @@ -18,8 +20,16 @@ compile_args = []
includes = include_directories('.')

libuv_dep = dependency('libuv')
backward_dep = dependency('backward-cpp')
dependencies = []
dependencies += libuv_dep
dependencies += backward_dep

add_project_arguments(['-DBACKWARD_HAS_BFD=1'], language: 'cpp')
# add_project_arguments(['-DBACKWARD_HAS_UNWIND=1'], language: 'cpp')
# add_project_arguments(['-DBACKWARD_HAS_LIBUNWIND=1'], language: 'cpp')
# add_project_arguments(['-DBACKWARD_HAS_DW=1'], language: 'cpp') # hang up?
# add_project_link_arguments(['-rdynamic'], language: 'cpp')

subdir('tests')
subdir('examples')
Expand Down
1 change: 1 addition & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
all_tests_sources = [
'test_log.cpp',
'test_backward.cpp',
'test_libuv.cpp',
'test_task.cpp',
'test_timer.cpp',
Expand Down
13 changes: 13 additions & 0 deletions tests/test_backward.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "backward.hpp"

#include <iostream>
#include <vector>

namespace backward {
backward::SignalHandling sh;
} // namespace backward

auto main() -> int {
std::vector<int> vec;
std::cout << "vec[100] = " << vec[100] << '\n';
}

0 comments on commit 7899faa

Please sign in to comment.