kazu-yamamoto / pgpdump

A PGP packet visualizer
http://www.mew.org/~kazu/proj/pgpdump/
BSD 3-Clause "New" or "Revised" License
174 stars 34 forks source link

How do you compile the tests? #12

Closed jpouellet closed 9 years ago

jpouellet commented 9 years ago

After about 2 hours of bootstrapping a haskell environment, figuring out what dependencies it needs, installing the dependencies, and having no clue how to resolve:

$ ghc test.hs

test.hs:7:8:
    Ambiguous module name ‘Test.Framework’:
      it was found in multiple packages:
      HTF-0.13.0.0 test-framework-0.8.1.1

or

$ ghc test.hs

test.hs:7:8:
    Could not find module ‘Test.Framework’
    It is a member of the hidden package ‘HTF-0.13.0.0’.
    It is a member of the hidden package ‘test-framework-0.8.1.1’.
    Use -v to see a list of the files searched for.

or

$ ghc -package HTF test.hs
[1 of 1] Compiling Test             ( test.hs, test.o )

test.hs:7:24: Module ‘Test.Framework’ does not export ‘defaultMain’

test.hs:7:37: Module ‘Test.Framework’ does not export ‘testGroup’

test.hs:7:48: Module ‘Test.Framework’ does not export ‘Test’

or

$ ghc -package test-framework test.hs
$ ./test
no such file or directory: ./test
$ ghc -package test-framework test.hs -o IHaveNoClueWhatImDoing
Warning: output was redirected with -o, but no output will be generated
because there is no Main module.

I found https://github.com/kazu-yamamoto/unit-test-example but still have no clue what to do.

I just give up. Any hints?

kazu-yamamoto commented 9 years ago

Sorry for no documentation. If you install Haskell Platform, please do:

% cabal install test-framework-hunit
% runghc test.hs
jpouellet commented 9 years ago

Works for me! Thanks. Might want to add a line to README.md about it though.

kazu-yamamoto commented 9 years ago

Done. Thank you for the suggestion.