The libstdc++ testsuite

Benjamin Kosnik bkoz@redhat.com
Fri Jul 6 10:52:00 GMT 2001


> But I don't know where it will break unless I test it all.  So, I'm trying to
> generate testsuite entries that, rather than checking known regressions,
> exercises basic functionality of the library (for those parts I know I've
> touched) looking for new regressions.

Usually I do both. Test suite additions should be added when things get 
fixed that people have complained about, so that they don't get broken again.

> I'm assuming we eventually want this sort of thing for libstdc++, it's
> just that nobody has stepped forward to do it yet.  If I'm wrong, let
> me know.

No, more tests are certainly helpful. I've done a lot of 17, 21, 27, and 22 
tests. The rest of the library is catch as catch can, sadly. Thus your 
surprise at 23_containers, and the lack of testing.

> Which brings up my question of the day.  Are there any published
> guidelines on writing test cases for libstdc++?  The existing test cases
> are not entirely consistent.

Yeah. I know. I've been meaning to write such a thing for a bit. The only 
real issue is naming the test file to match the part of the standard 
that's being tested, and to use debug_assert.h. 

> Oh, another one.   I've been trying to slip doxygen-style comments into
> code I've touched, assuming that's desireable.  Would it be possible for
> someone (else) to come up with a style guideline on what and how stuff
> should be documented that way?  I find it difficult to extract conclusions
> out of the mailing list threads.

You'll definitely want to make a separate pass out of the doxygen-style 
comments. Please do this later.

> Yes, a third question, now that I'm on a roll.  What is the policy about
> reformatting existing source to match the C++STYLE guidelines? I find
> consistently formatted code much (much) easier to deal with, especially
> in the depths of templated stuff.  Trouble is none of the SGI code follows
> the guidelines, or apparently any guidelines, and reformatting can mean
> changing every line in a file.  Years of being scolded (and in turn, scolding)
> have made me hesitate to do this, but it sure is nice once it's done.
> Should I or shouldn't I?

You should. I've been doing it for all the files I touch. Most of the 
string, locale, and io are formatted (more or less) correctly WRT C++STYLE.

> > Now y'all know why I prefer patches with testsuite entries. I got sick of 
> > harassing people for this.
> 
> Yes, and I'm a somewhat abashed reformed hacker.

Well. This is encouraging.

-benjamin



More information about the Libstdc++ mailing list