diff --git a/CMakeLists.txt b/CMakeLists.txt index ce033240..7f0eec36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR # using clang or gcc set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -rdynamic") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # debugging #set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG") diff --git a/test/src/pdf2htmlEX_wrapper_test.cpp b/test/src/pdf2htmlEX_wrapper_test.cpp index b3d6419c..c47acaf9 100644 --- a/test/src/pdf2htmlEX_wrapper_test.cpp +++ b/test/src/pdf2htmlEX_wrapper_test.cpp @@ -53,12 +53,28 @@ TEST_P(pdf2htmlEXWrapperTests, html) { password = "sample-user-password"; } - Html html = odr::internal::html::pdf2htmlEX_wrapper( - test_file.path, output_path, config, password); + try { + Html html = odr::internal::html::pdf2htmlEX_wrapper( + test_file.path, output_path, config, password); - for (const HtmlPage &html_page : html.pages()) { - EXPECT_TRUE(fs::is_regular_file(html_page.path)); - EXPECT_LT(0, fs::file_size(html_page.path)); + for (const HtmlPage &html_page : html.pages()) { + EXPECT_TRUE(fs::is_regular_file(html_page.path)); + EXPECT_LT(0, fs::file_size(html_page.path)); + } + } catch (const std::exception & e) { + std::cerr << e.what() << std::endl << std::flush; + + void *array[10]; + int size = backtrace(array, 10); + char ** symbols = backtrace_symbols(array, size); + for (int i = 0; i < size; i++) { + std::cerr << symbols[i] << std::endl; + } + free(symbols); + std::cerr << std::flush; + sleep(2); + + throw e; } }