From: Matthias Maier Date: Mon, 14 Oct 2013 14:52:35 +0000 (+0000) Subject: Fix an issue with __PRETTY_FUNCTION__ and clang X-Git-Tag: v8.1.0~570^2~64 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1576f6d6a260a4b9d7fe61516b0e7390bc1dc3e;p=dealii.git Fix an issue with __PRETTY_FUNCTION__ and clang git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31229 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/thread_validity_06.cc b/tests/base/thread_validity_06.cc index 799626be49..abb69f57ab 100644 --- a/tests/base/thread_validity_06.cc +++ b/tests/base/thread_validity_06.cc @@ -83,4 +83,8 @@ int main() deallog.threshold_double(1.e-10); test (); + + deallog.detach(); + logfile.close(); + unify_pretty_function ("output"); } diff --git a/tests/base/threads_01.cc b/tests/base/threads_01.cc index 9f7e5eee7b..5e1aba5838 100644 --- a/tests/base/threads_01.cc +++ b/tests/base/threads_01.cc @@ -2081,4 +2081,5 @@ X<8> x8; deallog.detach (); logfile.close (); sort_file_contents ("output"); + unify_pretty_function ("output"); } diff --git a/tests/base/threads_02.cc b/tests/base/threads_02.cc index 81cbe489e7..89f3336b11 100644 --- a/tests/base/threads_02.cc +++ b/tests/base/threads_02.cc @@ -2081,4 +2081,5 @@ X<8> x8; deallog.detach (); logfile.close (); sort_file_contents ("output"); + unify_pretty_function ("output"); } diff --git a/tests/tests.h b/tests/tests.h index 641695c96c..36c4b65cc3 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -231,6 +231,18 @@ void sort_file_contents (const std::string &filename) } +/* + * Replace all occurences of ' &' by '& ' from the given file to hopefully be more compiler + * independent with respect to __PRETTY_FUNCTION__ + */ +void unify_pretty_function (const std::string &filename) +{ + int error = std::system ((std::string ("sed -i -e 's/ \\&/ \\& /g' -e 's/ & ,/\\&,/g' -e 's/ \\& )/\\&)/g' -e 's/ \\& /\\& /g' ") + filename).c_str()); + Assert (error == 0, + ExcInternalError()); +} + +