This project currently contains RunLab.hs, an automated student submission checking system.
Usage
Build with ghc -package ghc RunLab.hs
Then, run with ./RunLab filename.hs
where filename.hs
is the filename of the student submission. This will run the checks found in checks/filename.hs
against the submission, printing a report.
Writing check suites
A checks file must do a few things:
It must be in the module
Checks
.It must export some definitions named
test_name :: ? -> IO ()
wherename
is the name of a definition expected to be present in the student submission. The argument type of eachtest_
should match the complete type of the corresponding submission definition.
When the system runs the checks, it executes a do
block like this:
do
Checks.test_name1 name1
Checks.test_name2 name2
...
So each test should take the (submitted) function to be tested and run some tests against it. (You can safely import, e.g., QuickCheck in a check suite file.)