I've checked these all against the Darcs history using a script
(check-copyright, in my misccode collection). Anything Neil or I did as
part of our PhDs is copyright University of Kent; more recent work
belongs to us, as appropriate.
Most of this is trivial -- e.g. getting rid of dummy definitions of
coarbitrary, which is a separate typeclass in QC2, and changing the
parameter specs to use the new Args type.
The chunk of code that runs a QC test as an HUnit test is now quite a
bit simpler because QC's top-level interface returns a result. However,
this means that some gymnastics are required to get at the right
definition of Result in different places -- QC2 has two different types
called Result, and we use both for different jobs!
This is because QuickCheck 2 no longer exports the "generate" function;
since it's a test generator anyway, we may as well test it by using it
to test something trivial.
Most of this was a find-and-replace, PolyplateM -> AlloyA. But I also fixed some of the opsets and removed types that were no longer needed, and so on.
For some reason, the usage check tests are now very slow to run (perhaps because of all the operator definitions added to each one?), which needs further investigation.
This may seem like an odd change, but it simplifies the logic a lot. I kept having problems with passes not operating on externals (e.g. functions-to-procs, adding array sizes, constant folding in array dimensions) and adding a special case every time to also process the externals was getting silly.
Putting the externals in the AST therefore made sense, but I didn't want to just add dummy bodies as this would cause them to throw up errors (e.g. in the type-checking for functions). So I turned the bodies into a Maybe type, and that has worked out well.
I also stopped storing the formals in csExternals (since they are now in csNames, and the tree), which streamlined that nicely, and stopped me having to keep them up to date.
This means all the tests now get run as part of one list, and HUnit keeps track
of the number of failures for us. (The reason I was doing this was so that
tocktest will exit non-zero on QuickCheck test failure too.)
As part of this, I've reworked TestMain's main function quite a bit. It'll now
filter QuickCheck tests into response to options too.