On 05/08/16 01:37 +0100, Jonathan Wakely wrote:
The core of the new guidelines for writing tests is this:

[begin]
Test cases that use features of a particular C++ standard should
specify the minimum required standard as an effective target:

  // { dg-do run { target c++11 } }

or

  // { dg-require-effective-target c++11 }

Specifying the minimum required standard for a test allows it to be
run using later standards, so that we can verify that C++11
components still work correctly when compiled as C++14 or later.

I forgot to say that this is the main reason for all the testsuite
work I've been doing for the last couple of weeks. We have hundreds of
tests using { dg-options "-std=gnu++11" } which means that we're not
testing huge chunks of the library with the default -std=gnu++14
option.

By using { dg-do what { target c++11 } } the default testsuite options
will run the test with the default -std setting, but we can optionally
also run them with -std=gnu++11, and -std=gnu++17, and other
variations (which I'm going to be doing nightly).

So I want the docs to describe how I think we should be writing tests.

Reply via email to