Go Back   Velocity Reviews > Newsgroups > C Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply

C Programming - syntactically comprehensive test program

 
Thread Tools Search this Thread
Old 02-28-2007, 10:41 AM   #1
nobrow@gmail.com
 
Posts: n/a
Default syntactically comprehensive test program

I need a syntactically comprehensive test program to test a C parser
on. Does anyone know where I might find a program that uses all
syntactical elements of the language and combines them in cunning/
realistic ways so that one might be confident that a pass on this
program will mean a pass on any valid C program.

Big ask, but I thought someone might know of a suitable file(s).

  Reply With Quote
Old 02-28-2007, 10:46 AM   #2
santosh
 
Posts: n/a
Default Re: syntactically comprehensive test program

nob...@gmail.com wrote:
> I need a syntactically comprehensive test program to test a C parser
> on. Does anyone know where I might find a program that uses all
> syntactical elements of the language and combines them in cunning/
> realistic ways so that one might be confident that a pass on this
> program will mean a pass on any valid C program.
>
> Big ask, but I thought someone might know of a suitable file(s).


gcc comes bundled with it's own test routines. I also think P.J.
Plauger's dinkumware.com offers to certify compilers and libraries for
standard conformance.

  Reply With Quote
Old 02-28-2007, 07:01 PM   #3
user923005
 
Posts: n/a
Default Re: syntactically comprehensive test program

On Feb 28, 3:41 am, nob...@gmail.com wrote:
> I need a syntactically comprehensive test program to test a C parser
> on. Does anyone know where I might find a program that uses all
> syntactical elements of the language and combines them in cunning/
> realistic ways so that one might be confident that a pass on this
> program will mean a pass on any valid C program.
>
> Big ask, but I thought someone might know of a suitable file(s).



http://www.plumhall.com/suites.html
http://www.opengroup.org/testing/tes...s/perenial.htm
http://www.ace.nl/compiler/supertest.html
There's a few gazillion more here:
http://www.google.com/search?q=C+val...&start=10&sa=N

  Reply With Quote
Old 02-28-2007, 07:06 PM   #4
Keith Thompson
 
Posts: n/a
Default Re: syntactically comprehensive test program

"santosh" <> writes:
> nob...@gmail.com wrote:
>> I need a syntactically comprehensive test program to test a C parser
>> on. Does anyone know where I might find a program that uses all
>> syntactical elements of the language and combines them in cunning/
>> realistic ways so that one might be confident that a pass on this
>> program will mean a pass on any valid C program.
>>
>> Big ask, but I thought someone might know of a suitable file(s).

>
> gcc comes bundled with it's own test routines. I also think P.J.
> Plauger's dinkumware.com offers to certify compilers and libraries for
> standard conformance.


I haven't looked at gcc's test suite. I'm sure it includes tests for
gcc-specific extensions. Before using it, make sure that those tests
are cleanly separated from the ones that use only standard C.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Reply With Quote
Old 02-28-2007, 07:12 PM   #5
Malcolm McLean
 
Posts: n/a
Default Re: syntactically comprehensive test program

<> wrote in message
>I need a syntactically comprehensive test program to test a C parser
> on. Does anyone know where I might find a program that uses all
> syntactical elements of the language and combines them in cunning/
> realistic ways so that one might be confident that a pass on this
> program will mean a pass on any valid C program.
>
> Big ask, but I thought someone might know of a suitable file(s).
>

Look for a program called C torture, which is designed to stress compilers.

Unfortunately it is extremely difficult to verify that a grammar parser is
correct. Non-artificial bugs will often fail to manifest themselves on the
vast majority of inputs. C torture is a good test, but not definitive by any
means, which is why ANSI haven't endorsed it or any similar test suite.


--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

  Reply With Quote
Old 02-28-2007, 07:33 PM   #6
user923005
 
Posts: n/a
Default Re: syntactically comprehensive test program

Too bad NIST never wrote one for C. There testers for other languages
are really good.
http://www.itl.nist.gov/div897/ctg/software.htm#pubsoft

I use their SQL test suite all the time, and it is fantastic.

  Reply With Quote
Old 02-28-2007, 09:59 PM   #7
CBFalconer
 
Posts: n/a
Default Re: syntactically comprehensive test program

Malcolm McLean wrote:
> <> wrote in message
>
>> I need a syntactically comprehensive test program to test a C
>> parser on. Does anyone know where I might find a program that
>> uses all syntactical elements of the language and combines them
>> in cunning/realistic ways so that one might be confident that a
>> pass on this program will mean a pass on any valid C program.
>>
>> Big ask, but I thought someone might know of a suitable file(s).

>
> Look for a program called C torture, which is designed to stress
> compilers.
>
> Unfortunately it is extremely difficult to verify that a grammar
> parser is correct. Non-artificial bugs will often fail to
> manifest themselves on the vast majority of inputs. C torture is
> a good test, but not definitive by any means, which is why ANSI
> haven't endorsed it or any similar test suite.


It is hard to test that a compiler system is correct. It is much
easier to test that it adheres to a specific clause in the
standard. This was the approach taken 25 years ago in the Pascal
Test Suite, which unfortunately got hidden by Prospero, when the
original had been open to all.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
On Your Way to Success: the Test 70-640 jiajiainlove@gmail.com MCTS 1 03-16-2009 10:47 AM
On Your Way to Success: the Test 70-640 jiajiainlove@gmail.com MCITP 0 03-16-2009 12:51 AM
This is incredible! jc_ice DVD Video 1 08-13-2006 09:47 AM
The Practice Test Package Development: A New Service on the Certification Market David Johnson A+ Certification 0 01-19-2005 09:52 AM
Re: A+ Test Info (June) RussS A+ Certification 0 08-04-2003 12:16 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47