From: Daniel Arndt Date: Tue, 3 Sep 2024 13:45:30 +0000 (-0400) Subject: Filter output of parameter_handler_29 test X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=971535f532f981278d26fcb3a68293531e3169ad;p=dealii.git Filter output of parameter_handler_29 test --- 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