Skip to content

Commit

Permalink
Filter output of parameter_handler_29 test
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Sep 4, 2024
1 parent 2285fbc commit dba3298
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
19 changes: 18 additions & 1 deletion tests/parameter_handler/parameter_handler_29.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,24 @@ 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);
std::string additional_string =
filtered_error.substr(additional_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");
Expand Down
10 changes: 4 additions & 6 deletions tests/parameter_handler/parameter_handler_29.output
Original file line number Diff line number Diff line change
@@ -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 <parameter_handler.cc> in function
void dealii::ParameterHandler::scan_line(std::string, const string&, unsigned int, bool)
An error occurred in file <parameter_handler.cc>
Additional information:
Line <2> of file <prm/parameter_handler_3.prm>: Entry <string list> is
deprecated.
--------------------------------------------------------

--------------------------------------------------------
An error occurred in file <parameter_handler.cc> in function
void dealii::ParameterHandler::scan_line(std::string, const string&, unsigned int, bool)
An error occurred in file <parameter_handler.cc>
Additional information:
Line <3> of file <prm/parameter_handler_3.prm>: Entry <int> is
deprecated.
--------------------------------------------------------

DEAL::a, b, c
a, b, c
DEAL::3

0 comments on commit dba3298

Please sign in to comment.