Neil Brown
c9da4a7eaf
Overhauled the way that the array usage checking deals with background knowledge, ready to implement usage checking that makes proper use of background knowledge (information from elsewhere in the program)
2008-06-05 20:37:59 +00:00
Neil Brown
41ff60cb78
Removed the Rep constructor from Structured and instead added a Rep constructor to SpecType
...
This way, all replicators are declared like other names, and their scope is considered replicated. This simplifies the code a little.
Fixes #55
2008-06-04 17:00:43 +00:00
Neil Brown
ba66cce89f
Moved all the remaining pass information to be with the passes themselves, and adjusted the tests accordingly
...
All the passes now have their information (name, pre-requisites and post- properties) stored at the point where the pass is declared, which means the pass lists are just a simple list of pass functions.
The main consequence of this change was that the tests had to be changed. Now, instead of taking a "pass applied to data" item (type: PassM b), they take both the pass (type: Pass) and source data (type: b), and apply them later. This was the decision that involved the simplest changes to the existing tests (simply unbracketing the application of the pass to the source). I also had to include a few old-style versions though (testPass', testPassShouldFail') for where the functions were being used to test things that weren't actually passes (mainly StructureOccam).
Fixes #48
2008-06-02 14:31:19 +00:00
Neil Brown
7d65db43c0
Changed TestHarness to support Rain test files as well as occam
2008-05-17 13:13:52 +00:00
Neil Brown
ecb82d13a8
Revamped the ShowCode module, transforming it to use the writer monad
2008-03-20 16:20:14 +00:00
Neil Brown
03eab6c142
Fixed some typing relating to QuickCheck and the TestMonad to avoid type ambiguities in future
2008-03-05 16:04:30 +00:00
Neil Brown
1960deef39
Noted down a QuickCheck failure in ArrayUsageCheckTest
2008-02-25 12:09:21 +00:00
Neil Brown
74f3cb7fc2
Removed the export of "m" in TestUtils, instead moving the definition to each module that uses it (less confusing that way)
2008-02-24 18:55:44 +00:00
Neil Brown
2ea7e15570
Changed the QuickCheck tests to test multiplied variables more thoroughly
2008-02-11 14:26:55 +00:00
Neil Brown
fdb2e8d45d
Printed out more information when generateMapping fails (keys to VarMap not matching)
2008-02-11 12:02:20 +00:00
Neil Brown
04be245677
Adjusted the printing out of FlattenedExp; useful on test failure
2008-02-11 11:31:20 +00:00
Neil Brown
f403a90ccf
Adjusted the ArrayUsageCheckTest QuickCheck tests to allow expressions in the top and bottom of modulo, and the top of divides
2008-02-11 11:03:32 +00:00
Neil Brown
b83acaf7c5
Corrected a few comments in ArrayUsageCheckTest
2008-02-11 10:17:27 +00:00
Neil Brown
18cf66944a
Modified the array usage checking to treat any unknown expressions (function calls, etc) like variables were treated before
2008-02-10 23:58:32 +00:00
Neil Brown
94d9fedd0e
Tweaked some of the probabilities in the ArrayUsageCheckTest QuickCheck tests
2008-02-10 21:20:30 +00:00
Neil Brown
16279f4d1d
Added tests for the Divide item to the QuickCheck tests in ArrayUsageCheckTest
2008-02-09 20:12:30 +00:00
Neil Brown
41ab2d6bde
Introduced scaling of Modulo and Divide items, and tweaked some of the parameters to make the tests a little shorter
2008-02-09 17:23:49 +00:00
Neil Brown
25be01cb47
Added a coefficient for modulo and divide items
2008-02-09 15:08:10 +00:00
Neil Brown
c6b384d5d6
A large change, introducing tags for modulo items during array usage checking so that they can be accurately tested
2008-02-09 14:52:07 +00:00
Neil Brown
d0b94e402c
Added (constant divisor, for now) modulo to the QuickCheck tests in ArrayUsageCheckTest
2008-02-09 11:36:37 +00:00
Neil Brown
7fbb83a813
Fiddled with the types of genNewItem and similar functions, ready to support compound expressions in the QuickCheck tests
2008-02-09 02:01:01 +00:00
Neil Brown
cbd4a98ad5
Improved the error message when an array usage check test fails
2008-02-09 01:55:07 +00:00
Neil Brown
842b6b7788
Simplified the QuickCheck test in ArrayUsageCheckTest
2008-02-09 00:57:01 +00:00
Neil Brown
618ac31ae2
Added a QuickCheck test for makeEquations
2008-02-09 00:20:20 +00:00
Neil Brown
2343110311
Refactored some of ArrayUsageCheckTest, simplified it a little and corrected a bug in the test framework
...
Previously, the assertEquivalentProblems function and functions used by it dealt with results inside Maybe, sometimes then inside IO. These functions have been migrated to the new TestMonad. Instead of using Maybe, any problems with the test are dealt with by failing the test instead.
The assertEquivalentProblems function used to take a list of labelled expressions for comparison purposes. Now that we have an ordering on the AST, this is pointless. Instead we can directly sort the lists by the expressions involved. This simplifies the code a little.
Finally, a bug has been fixed. The mapping between expected and actual columns in the swapColumns' function of translateEquations was being used as a backward mapping, even though it was in fact a forward mapping. So that has also been corrected.
2008-02-08 23:58:28 +00:00
Neil Brown
38002bf9a8
Added another array usage check test
2008-02-08 23:56:59 +00:00
Neil Brown
914e9c3d71
Added a new test framework, based on simple monads, to allow easy unification of HUnit and QuickCheck tests with the minimum of work
2008-02-08 16:56:32 +00:00
Neil Brown
f82b6cf6a7
Finished writing the long test for replicated modulo, which seems to pass
2008-02-07 15:35:39 +00:00
Neil Brown
af0160e4fe
Added a test to show up a bug in handling replicator from/for values
2008-02-07 00:23:08 +00:00
Neil Brown
4cb02c4c71
Added lots more checks in ArrayUsageCheckTest that aim to produce a useful message when a usage check is failing
2008-02-06 23:55:25 +00:00
Neil Brown
74d5bc675d
Shorted the definition of generateMapping in ArrayUsageCheckTest
2008-02-06 23:55:01 +00:00
Neil Brown
ba04340989
Changed the ArrayUsageCheckTest framework to give you a test failure (rather than an unhelpful Haskell error) when translateEquations fails to result in a valid array
2008-02-06 23:27:59 +00:00
Neil Brown
416e385017
Added labels to all the QuickCheck tests to make it easier to see which one has failed
2008-02-05 22:15:17 +00:00
Neil Brown
1b7e0985cc
Added labels to a few tests and began writing a new one for replicated variables and modulo
2008-02-04 08:06:32 +00:00
Neil Brown
41194f757f
Added support for background knowledge to makeEquations in ArrayUsageCheck, and fed all the replicator bounds into it
2008-02-03 12:44:51 +00:00
Neil Brown
f26b3309a3
Added a new file of testcases for testing passed parameters
2008-01-29 11:39:04 +00:00
Neil Brown
5ff006f75d
Renamed the UsageCheck module to UsageCheckUtils
2008-01-28 12:59:22 +00:00
Neil Brown
efc69a97cf
Moved all the modules related to usage-checking into a new checks directory
2008-01-28 12:25:00 +00:00