diff mbox

Some testsuite cleanup

Message ID 20160731192158.GT4264@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely July 31, 2016, 7:21 p.m. UTC
On 28/07/16 22:06 +0100, Jonathan Wakely wrote:
>The dg-prune-output directives in these tests are needed to prune some
>additional errors that are only issued in C++98 mode, but the line
>numbers had got out of date. I've replaced the hardcoded numbers with
>strings that will stay valid.
>
>   Fix DR 438 container tests to pass in C++98 mode
>       * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
>       Adjust dg-prune-output pattern for error in C++98 mode.
>       * testsuite/23_containers/deque/requirements/dr438/
>       constructor_1_neg.cc: Likewise.
>       * testsuite/23_containers/deque/requirements/dr438/
>       constructor_2_neg.cc: Likewise.
>       * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
>       Likewise.
>       * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
>       Likewise.
>       * testsuite/23_containers/list/requirements/dr438/
>       constructor_1_neg.cc: Likewise.
>       * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
>       Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
>       Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/
>       constructor_1_neg.cc: Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/
>       constructor_2_neg.cc: Likewise.
>       * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
>       Likewise.

I missed one test in the change above. For that test the extra error
in C++98 mode comes from location 1698:29 which doesn't match the 1682
lineno in the test, but instead matches the dg-error on line 29 of the
file. That means it fails if it's run with
--target_board=unix/-fno-show-column/-std=gnu++98

(I'm getting really annoyed with line numbers matching columns!)

Tested x86_64-linux, committed to trunk.

Comments

Jonathan Wakely July 31, 2016, 8:30 p.m. UTC | #1
On 31/07/16 20:21 +0100, Jonathan Wakely wrote:
>(I'm getting really annoyed with line numbers matching columns!)

testsuite/20_util/pair/cons/explicit_construct.cc is another one where
this happens. If you remove a blank line near the top of the file it
starts FAILing, because the error at explicit_construct.cc:55:40:
matches a dg-error on line 40.

Whitespace changes that cause testsuite FAILs are infuriating (and
hard to identify sometimes).

On IRC last week I proposed adding -fno-show-column to
libstdc++-v3/scripts/testsuite_flags.in which solves the problem.
Other people suggested I should tweak deajagnu to make it not match
column numbers. I tried various things, and tried to understand how
the front-end tests solve the problem, but simply adding
-fno-show-column seemed the simplest and most robust.

Better ideas would be welcome.
diff mbox

Patch

commit c9949d54ba1ff875802947e7e7bba63a9a2e1164
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sun Jul 31 19:58:46 2016 +0100

    Fix DR 438 std::list test to pass in C++98 mode
    
    	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
    	Adjust dg-prune-output pattern for error in C++98 mode.

diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
index 313c54a..769d615 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-prune-output 1682 }
+// { dg-prune-output "no matching function .*_M_fill_initialize" }
 
 #include <list>
 #include <utility>