On 13 March 2006 09:45, Lemmih wrote:

> On 3/13/06, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote:
>>>>> There are no serious quickchecks in the testsuite. I found just
>>>>> one entry that didn't test the standard libraries: "prop_silly xs
>>>>> = head xs == head xs". Now how can that be when QuickCheck is so
>>>>> incredibly useful?
>>>> 
>>>> look in lib/Concurrent, eg. Chan001, MVar001.
>>> 
>>> Those aren't GHC tests. They test the standard library.
>> 
>> It's possible that there's a misunderstanding here.
>> 
>> The testsuite tests GHC as a *black box*; all you can do is invoke
>> it, giving lots of different Haskell programs as input, which is
>> what the testsuite does.  In principle, it would also be possible to
>> write Quickcheck tests for particular functions inside GHC.  For
>> example, the UniqFM data types could have a lot of Quickcheck tests;
>> and one could imagine many, many more.  These tests can't obviously
>> be done by running the GHC binary.  Instead, one would need to link
>> *part* of GHC with the test program, and run the test program as
>> 'main'.  We don't have any 'make' technology to do that yet.
>> 
>> If Lemmih has this in mind (and perhaps it is -- you say "I want to
>> test the core of GHC"), then maybe ghc/tests is the right place. 
>> But if you have in mind black-box tests of the compiled binary, then
>> I agree that fptools/testsuite is the right place (perhaps using
>> Quickcheck as the technology).
> 
> Yes, exactly. I want to test the GHC library, not the GHC binary.

That's true, and I very much like the idea of having unit tests against
parts of GHC.  I don't think there's a fundamental difficulty: the GHC
library is, after all, just a library and we have lots of tests for
library code.

I suppose the drawback is that currently you need stage1 working in
order to test the GHC library, because we build the GHC library as part
of stage 2.  So if GHC is in pieces and you need to find out why, the
testsuite doesn't help. (this is also a problem with Lemmih's quickcheck
code).  I think we can work around this, though.  The idea would be to
build a library from the stage 1 object code, and have a part of the
test suite that runs with TEST_HC=$(GHC), i.e. uses the installed GHC to
test the GHC library code.

Cheers,
        Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to