From 971535f532f981278d26fcb3a68293531e3169ad Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 3 Sep 2024 09:45:30 -0400 Subject: [PATCH] Filter output of parameter_handler_29 test --- .../parameter_handler/parameter_handler_29.cc | 17 +++++++++++++- .../parameter_handler_29.output | 10 ++++---- .../parameter_handler_29.output.clang-apple | 23 ------------------- 3 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 tests/parameter_handler/parameter_handler_29.output.clang-apple diff --git a/tests/parameter_handler/parameter_handler_29.cc b/tests/parameter_handler/parameter_handler_29.cc index a8d79bb699..e2f2c5652c 100644 --- a/tests/parameter_handler/parameter_handler_29.cc +++ b/tests/parameter_handler/parameter_handler_29.cc @@ -82,7 +82,22 @@ main() catch (const ParameterHandler::ExcEncounteredDeprecatedEntries &exc) { deallog << exc.get_exc_name() << std::endl; - exc.print_info(deallog.get_file_stream()); + + // Filter out compiler-dependent information + std::stringstream tmp; + exc.print_info(tmp); + std::string filtered_error = tmp.str(); + size_t function_begin = filtered_error.find("in function"); + + while (function_begin != filtered_error.npos) + { + size_t additional_begin = + filtered_error.find("Additional", function_begin); + filtered_error = filtered_error.substr(0, function_begin) + '\n' + + filtered_error.substr(additional_begin); + function_begin = filtered_error.find("in function"); + } + deallog << filtered_error; // Check that the deprecated entries are still accessible. prm.enter_subsection("Testing"); diff --git a/tests/parameter_handler/parameter_handler_29.output b/tests/parameter_handler/parameter_handler_29.output index 60600592b9..645b901cea 100644 --- a/tests/parameter_handler/parameter_handler_29.output +++ b/tests/parameter_handler/parameter_handler_29.output @@ -1,23 +1,21 @@ DEAL::ExcEncounteredDeprecatedEntries(deprecation_messages) - The following deprecated entries were encountered: +DEAL:: The following deprecated entries were encountered: -------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::scan_line(std::string, const string&, unsigned int, bool) +An error occurred in file Additional information: Line <2> of file : Entry is deprecated. -------------------------------------------------------- -------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::scan_line(std::string, const string&, unsigned int, bool) +An error occurred in file Additional information: Line <3> of file : Entry is deprecated. -------------------------------------------------------- -DEAL::a, b, c +a, b, c DEAL::3 diff --git a/tests/parameter_handler/parameter_handler_29.output.clang-apple b/tests/parameter_handler/parameter_handler_29.output.clang-apple deleted file mode 100644 index 964365216e..0000000000 --- a/tests/parameter_handler/parameter_handler_29.output.clang-apple +++ /dev/null @@ -1,23 +0,0 @@ - -DEAL::ExcEncounteredDeprecatedEntries(deprecation_messages) - The following deprecated entries were encountered: - - --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::scan_line(std::string, const std::string &, const unsigned int, const bool) -Additional information: - Line <2> of file : Entry is - deprecated. --------------------------------------------------------- - --------------------------------------------------------- -An error occurred in file in function - void dealii::ParameterHandler::scan_line(std::string, const std::string &, const unsigned int, const bool) -Additional information: - Line <3> of file : Entry is - deprecated. --------------------------------------------------------- - -DEAL::a, b, c -DEAL::3 -- 2.39.5