www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Up to date conformance test suite for compiler correctness?

reply "Ryan" <dlang zipxap.com> writes:
Hi all,

I am wondering if there is an up to date conformance test 
(compiler correctness) suite for D2.  I located the dstress 
project on dsource.org, but it appears to be pre D2.

With four different compiler implementations, please tell me that 
people are not insane.

If people are insane (and no conformance suite exists), I think 
the easiest way to create one would be to produce a set of 
methods, one for each language construct/feature to be tested, 
that each return a string result.  The collective results would 
constitute a "profile" of a given compiler, which could be saved. 
  We would then pick one of the standard implementations as the 
"reference" implementation.  Testing compliance would then be a 
matter of comparing your profile to the profile for the reference 
implementation.

If people are insane (part 2): Does anybody have a good starting 
point?  i.e. a collection of methods to begin constructing a D2 
conformance suite?

Regards,

Ryan
Jan 17 2014
next sibling parent "Ryan" <dlang zipxap.com> writes:
I just pulled the dstress source code down and looked at it in 
TortoiseHg Workbench.

I see two check-ins on 19 August 2007 that seem to indicate D2 
conformance.  I will keep looking into this.
Jan 17 2014
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Friday, 17 January 2014 at 14:18:29 UTC, Ryan wrote:
 Hi all,

 I am wondering if there is an up to date conformance test 
 (compiler correctness) suite for D2.  I located the dstress 
 project on dsource.org, but it appears to be pre D2.

 With four different compiler implementations, please tell me 
 that people are not insane.

1) The 3 main compilers (dmd, gdc, ldc) share the majority of their frontend code. They aren't independent implementations like e.g. gcc/clang/icc/mvc/dmc etc... 2) All bugs fixed are accompanied by an addition to the test suite to test for regressions, which is also shared between compilers. While this isn't a systematic approach, it's quite a large set these days and is formed of pathological corner cases, which is exactly what you want.
Jan 17 2014
prev sibling next sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
Ryan:

 I just pulled the dstress source code down and looked at it in 
 TortoiseHg Workbench.

 I see two check-ins on 19 August 2007 that seem to indicate D2 
 conformance.  I will keep looking into this.

Compiler tests are added frequently: https://github.com/D-Programming-Language/dmd/tree/master/test Bye, bearophile
Jan 17 2014
prev sibling next sibling parent "Ryan" <dlang zipxap.com> writes:
On Friday, 17 January 2014 at 14:43:01 UTC, bearophile wrote:
 Ryan:

 I just pulled the dstress source code down and looked at it in 
 TortoiseHg Workbench.

 I see two check-ins on 19 August 2007 that seem to indicate D2 
 conformance.  I will keep looking into this.

Compiler tests are added frequently: https://github.com/D-Programming-Language/dmd/tree/master/test Bye, bearophile

If I'm reading this correctly then the latest set of unit tests for checking compatibility are integrated into the DMD source project itself. Is this correct?
Jan 17 2014
prev sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Friday, 17 January 2014 at 15:34:02 UTC, Ryan wrote:
 On Friday, 17 January 2014 at 14:43:01 UTC, bearophile wrote:
 Ryan:

 I just pulled the dstress source code down and looked at it 
 in TortoiseHg Workbench.

 I see two check-ins on 19 August 2007 that seem to indicate 
 D2 conformance.  I will keep looking into this.

Compiler tests are added frequently: https://github.com/D-Programming-Language/dmd/tree/master/test Bye, bearophile

If I'm reading this correctly then the latest set of unit tests for checking compatibility are integrated into the DMD source project itself. Is this correct?

Yes. And as John Colvin said, every bug that is fixed requires a relevant test to be added to the test suite.
Jan 17 2014