C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

std-compliance tests for compilers?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Alexander Kamotsky
Guest





PostPosted: Sat Nov 27, 2004 2:12 am    Post subject: std-compliance tests for compilers? Reply with quote



Hello All,

Is it possible to write some unit tests or test program which would
let anybody quickly to check out some C++ compiler and answer which
features it supports or not?

I imagine that there should be separate source files (test modules)
and compliance-test would constist of two steps 1) successful
compilation of the module and 2) module test procedure passing.

For example, it's easy to write some code to test the following:
for (int i = 0;Wink {}
i = 2; // shouldn't compile

I wonder why such tests are not made yet--seems they would be
extremely helpful for programmists and developers of compilers. Again,
whether it's impossible or I just don't know about such tests? =)

--
Best regards, from orange Kiev =),
orange Alexander mailto:alexandroid (AT) p5com (DOT) com


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Maciej Sobczak
Guest





PostPosted: Sat Nov 27, 2004 9:28 pm    Post subject: Re: std-compliance tests for compilers? Reply with quote



Alexander Kamotsky wrote:

Quote:
I wonder why such tests are not made yet--seems they would be
extremely helpful for programmists and developers of compilers. Again,
whether it's impossible or I just don't know about such tests? =)

http://www.peren.com/

As far as I know, these are commercial tests.
I agree that it would be nice if such tests were available as open source.
Even better - it would be nice to have such tests as a form of appendix
to the standard itself.
In the eXtreme case, such tests would suffice *instead* of the standard,
about which people frequently argue. ;)

--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Greg Comeau
Guest





PostPosted: Sun Nov 28, 2004 11:36 am    Post subject: Re: std-compliance tests for compilers? Reply with quote



In article <41a8c7db$1_1 (AT) news (DOT) bluewin.ch>,
Maciej Sobczak <no.spam (AT) no (DOT) spam.com> wrote:
Quote:
Alexander Kamotsky wrote:
I wonder why such tests are not made yet--seems they would be
extremely helpful for programmists and developers of compilers. Again,
whether it's impossible or I just don't know about such tests? =)

http://www.peren.com/

As far as I know, these are commercial tests.
I agree that it would be nice if such tests were available as open source.
Even better - it would be nice to have such tests as a form of appendix
to the standard itself.
In the eXtreme case, such tests would suffice *instead* of the standard,
about which people frequently argue. Wink

This is not to say that the idea doesn't have merit, but
the committee is a bunch of volunteers and the observation often
comes down to issues of lack of time and money for such a thing.
Plus other reasons such as that the tests will not suffice instead
of the standard in any practical sense of it or otherwise.
--
Greg Comeau / Comeau C++ 4.3.3, for C++03 core language support
Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Richard Corden
Guest





PostPosted: Sun Nov 28, 2004 6:11 pm    Post subject: Re: std-compliance tests for compilers? Reply with quote


Alexander Kamotsky <alexandroid (AT) p5com (DOT) com> writes:

Quote:
Hello All,

Is it possible to write some unit tests or test program which would
let anybody quickly to check out some C++ compiler and answer which
features it supports or not?

We have a front end for our static analysis too, and IMO, the most
taxing test suite we have had to work with has been boost.

The code is amazingly standard conforming (IMHO), and only differs
from the standard using Preprocessor directives where a specific
compiler cannot handle the standard implementation.

Looking at a particular configuration file for a compiler will give
you a very good idea of the shortcomings (or lack of) for a specific
compiler.

Quote:

I imagine that there should be separate source files (test modules)
and compliance-test would constist of two steps 1) successful
compilation of the module and 2) module test procedure passing.

For example, it's easy to write some code to test the following:
for (int i = 0;Wink {}
i = 2; // shouldn't compile

Boost won't directly perform such tests. It is more interested in
ensuring that its libraries will work for the target comipler.
However, the code in places is of such complexity that they will find
faults in almost all areas of a compiler.

Quote:
I wonder why such tests are not made yet--seems they would be
extremely helpful for programmists and developers of compilers. Again,
whether it's impossible or I just don't know about such tests? =)

One reason is the infinite number of tests that can be written.

Regards,

Richard

--
Richard Corden
To reply remove 's' from address

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Maciej Sobczak
Guest





PostPosted: Sun Nov 28, 2004 11:56 pm    Post subject: Re: std-compliance tests for compilers? Reply with quote

Greg Comeau wrote:

Quote:
This is not to say that the idea doesn't have merit, but
the committee is a bunch of volunteers [...]

Of course (have you noticed the smiley? Wink ).

Not only it would not suffice, I really do not see any way to do this -
to describe the first few chapters from the standard, where the most
fundamental aspects of the "abstract machine" are defined. No way to
define things like "observable behaviour" in C++ itself.
On the other hand, there are many places that could be feasibly defined
in terms of tests, and the library description is IMHO a good candidate.
The existing commercial tests may serve as a "feasibility study" for this.

You also mention that the committe is a bunch of volunteers. Yet those
volunteers spent many man-years of work clarifying, replying to
questions, arguing and explaining - in other words, doing stuff that
results from the defficiencies of natural language. Defining the library
(for example, or at least parts of it) in terms of tests and assertions
would be possibly a bigger initial investment than writing english
standardese (which still took *a lot of* time to settle down, I
suppose), but possibly would save the time later.

--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.