
I'm trying to run hat on some unit tests. They use HUnit-1.0, which I have under the tests directory, in tests/HUnit-1.0/; I've been interpreting the tests using runhaskell. When I run hmake -package parsec -i.. -iHUnit-1.0 RunTests; ./RunTests, everything works exactly as it does when I'm interpreting. When I add a -hat to the options, I get the following error: hat-trans -i.. -iHUnit-1.0 HUnit-1.0/HUnitLang.lhs Wrote Hat/HUnit-1.0/HUnitLang.hs /usr/bin/ghc -package parsec -i.. -iHUnit-1.0 -c -package hat -o HUnit-1.0/Hat/HUnitLang.o HUnit-1.0/Hat/HUnitLang.hs ghc-6.4.2: error: directory portion of "HUnit-1.0/Hat/HUnitLang.o" does not exist (used with "-o" option.) If I manually create HUnit-1.0/Hat: hat-trans -i.. -iHUnit-1.0 HUnit-1.0/HUnitLang.lhs Wrote Hat/HUnit-1.0/HUnitLang.hs /usr/bin/ghc -package parsec -i.. -iHUnit-1.0 -c -package hat -o HUnit-1.0/Hat/HUnitLang.o HUnit-1.0/Hat/HUnitLang.hs ghc-6.4.2: file `HUnit-1.0/Hat/HUnitLang.hs' does not exist If I switch into the HUnit-1.0 directory and run "hmake -hat HUnitLang.lhs": hmake -hat HUnitLang.lhs hat-trans HUnitLang.lhs Wrote Hat/HUnitLang.hs /usr/bin/ghc -c -package hat -o Hat/HUnitLang.o Hat/HUnitLang.hs Hat/HUnitLang.hs:52:38: Could not find module `Hat.PreludeBuiltin': use -v to see a list of the files searched for In the fourth argument of `Hat.Hat.uapp1', namely `aioError' In the definition of `hassertFailure': hassertFailure fmsg p = Hat.Hat.uapp1 p59v23v59v60 p59v23v59v29 p aioError hioError (Hat.Hat.uapp1 p59v32v59v60 p59v32v59v40 p auserError huserError (Hat.Hat.uapp2 p59v43v59v60 p59v55v59v56 p (+++) (*++) (ghunitPrefix p59v43v59v53 p) fmsg)) I'd like to be able to trace my code; I'm indifferent to whether or not I trace the code within HUnit. Any suggestions on how I can do this? Katerina Barone-Adesi

"Katerina Barone-Adesi"
hat-trans -i.. -iHUnit-1.0 HUnit-1.0/HUnitLang.lhs Wrote Hat/HUnit-1.0/HUnitLang.hs /usr/bin/ghc ... > HUnit-1.0/Hat/HUnitLang.hs
As I think you can see, hat-trans and hmake are disagreeing about where the Hat-translated versions of the source-code should live. hat-trans thinks Hat/HUnit-1.0/HUnitLang.hs whilst hmake thinks HUnit-1.0/Hat/HUnitLang.hs (the inital portion is swapped around). The main reason for this is a differing interpretation of the -i flag (giving a directory where extra source files live). One workaround is to move all the HUnit code to the current directory, rather than a separate directory. Another workaround is to change the name of the HUnit directory, so it no longer begins with upper-case, e.g. hunit-1.0. I know this is somewhat fragile, but the only way some tools know how to distinguish between the filename of a simple module, and the pathname of a hierarchical module, is on the case of the first letter of the directory part.
I'd like to be able to trace my code; I'm indifferent to whether or not I trace the code within HUnit. Any suggestions on how I can do this?
I hope one of these suggestions is useful. If not, please post again! Regards, Malcolm
participants (2)
-
Katerina Barone-Adesi
-
Malcolm Wallace