[cfe-dev] FW: Patch for UCNs in string literals

AlisdairM(public) public at alisdairm.net
Sun Jul 5 06:07:56 PDT 2009

Oops, intended for list, not private email!


-----Original Message-----
From: AlisdairM(public) [mailto:public at alisdairm.net] 
Sent: 05 July 2009 10:48
To: 'Eli Friedman'
Subject: RE: [cfe-dev] Patch for UCNs in string literals

> -----Original Message-----
> From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu]
> On Behalf Of Eli Friedman
> Sent: 05 July 2009 07:58
> To: James Porter
> Cc: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] Patch for UCNs in string literals
> On Sat, Jul 4, 2009 at 10:16 PM, James Porter<porterj at alum.rit.edu>
> wrote:
> > Eli Friedman wrote:
> >> Please just include the subset of tests that currently passes; we
> can
> >> add additional tests as the issues get fixed.
> >
> > I was under the impression based on the website that XFAIL'd tests
> were
> > encouraged:
> >
> >     http://clang.llvm.org/OpenProjects.html
> >
> >     "Pick a paragraph, write a few tests, and see if they work! Even
> if
> >     they don't we'd still like the new tests (with XFAIL'd) so that
> we
> >     know what to fix."
> A patch should be accompanied by a non-XFAIL'd test for each thing it
> fixes; otherwise, the tests won't detect regressions.  I haven't
> thought through what that means for the C++ tests; perhaps splitting
> them into p2a/p2b/p2c/etc. would be appropriate.

Well, it looks like precedent is upon us!

I'd appreciate some guidance on how best to submit these tests.  There are at least two issues here:

i/ there is a different behaviour between C++ and C.  Ideally I would like to test both.
That is why I submitted two versions of tests for the same paragraph.

In hindsight it looks like we might be better served by a parallel test structure to test/CXX for the C language, although I don't have a copy of that standard myself to know where to submit tests.  At least with C++0x we have publicly available working draughts.

A subset of this issue is the change between C++ and C++0x, which again suggests two tests.  I followed precedent elsewhere of tagging the 0x specific tests with the cpp0x suffix.  Ideally we should run all C++ tests in both C++ and C++0x mode as (most) conforming C++03 programs should also be conforming C++0x programs.  So far, the main incompatibility would be handling of auto.

ii/ Eli's original issue that we want to see tests passing to indicate the new feature works, as well as the extensive tests to validate the paragraph.  I am happy to break out the passing functionality tests, but I don't want to lose the full paragraph coverage.  How should we name these tests and where should we place them?

For example, when working on my type-alias patch I am using a test file unrelated to paragraph numbers, as the controlling paragraph says not a lot more than 'works like a typedef' so I need to test a wide variety of typedef-like uses, which is almost an open set.  Could I submit my working tests as n2170a.cpp, while retaining the full XFAILed p2?  Likewise, we can incrementally add n2170b,c,d,etc. as support for UCNs in more contexts becomes available.


More information about the cfe-dev mailing list