From: sof Date: Thu, 29 May 1997 05:28:08 +0000 (+0000) Subject: [project @ 1997-05-29 05:28:08 by sof] X-Git-Tag: Approximately_1000_patches_recorded~445 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=291b7ab4dbafa062fe96b7f0b7ed79fb171d1c35;p=ghc-hetmet.git [project @ 1997-05-29 05:28:08 by sof] Synced wrt current Makefile setup --- diff --git a/ghc/compiler/tests/README b/ghc/compiler/tests/README index b84a5fc..3343453 100644 --- a/ghc/compiler/tests/README +++ b/ghc/compiler/tests/README @@ -12,7 +12,7 @@ and a files which specify ghc's expected error output (reader001.stderr). "make reader001.runtest" will compile reader001.hs using ghc and compare the resulting output with that specified in the file reader001.stderr. -"make runtests" run all tests. +"make all" run all tests. ------------------------------------------------------------------------------- ADDING A NEW TEST @@ -22,21 +22,27 @@ To add a new test copy your Haskell program into an appropriately named file in the appropriate directory (for example, "typecheck/tc093.hs" for the 93rd typechecker test). -Edit the Makefile in that directory to add your test. Most directories -have some flags which are set for every test (RUNSTDTEST_OPTS), but you can -also set some extra per-file runtest flags (to control the output of ghc, -for instance). Just set ttc093_flags to the flags you want. +If the test needs to set the compiler options to something other than +the default for the directory, either modify the SRC_HC_OPTS (applies +to all tests in that directory), or set some extra per-file compiler +options. For example, -For example, - - tc093_flags = -noC -ddump-tc -x1 + tc093_HC_OPTS = -noC -ddump-tc -noC tells not bother generating any C (not point in doing that, since we only want to test the typechecker). -ddump-tc tells ghc to dump the -typechcker state, while -x1 tells runtest that the expected exit code is 1, -not 0 (the default). +typechecker state. + +Depending on the tests/ subdirectory, a default exit code is +expected from all tests therein, normally 0 (==success). +Per-file options to the runtests script can be set as follows + + tc093_RUNTEST_OPTS = -x 1 + +telling the test script that the compiler is expected to fail +on tc093. -"touch" the file tc093.stderr. "make tc093.runtest" will then build -tc093.runtest and fail (because the expected output doesn't match the empty +"touch" the file tc093.stderr. "make tc093.o" will then run +the compiler and fail (because the expected output doesn't match the empty tc093.stderr). However, it is then easy to update tc093.stderr with the -stuff printed out during "make tc093.runtest". +stuff printed out during "make tc093.o".