Skip to content

Instantly share code, notes, and snippets.

@X1011
Created February 1, 2015 10:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save X1011/693547bd9bea29aa678b to your computer and use it in GitHub Desktop.
Save X1011/693547bd9bea29aa678b to your computer and use it in GitHub Desktop.
unit-test-example failure
codio@saturn-granite:~/workspace$ cabal test
Running 2 test suites...
Test suite spec: RUNNING...
Test suite spec: PASS
Test suite logged to: dist/test/unit-test-example-0.0.0-spec.log
Test suite doctest: RUNNING...
### Failure in Codec/Base64.hs:14: expression `decode (encode xs) == xs'
<interactive>:37:3:
Not in scope: ‘polyQuickCheck’
In the splice: $(polyQuickCheck (mkName "doctest_prop"))
<interactive>:37:3:
GHC stage restriction:
‘polyQuickCheck’ is used in a top-level splice or annotation,
and must be imported, not defined locally
In the expression: polyQuickCheck (mkName "doctest_prop")
In the splice: $(polyQuickCheck (mkName "doctest_prop"))
Examples: 3 Tried: 3 Errors: 0 Failures: 1
Test suite doctest: FAIL
Test suite logged to: dist/test/unit-test-example-0.0.0-doctest.log
1 of 2 test suites (1 of 2 test cases) passed.
@FranklinChen
Copy link

What platform are you running on? Which set of the installation instructions did you use at https://github.com/pittsburgh-haskell/haskell-installation ? What versions of GHC and Cabal do you have installed?

$ ghc --version
$ cabal --version

@X1011
Copy link
Author

X1011 commented Feb 2, 2015

GHC 9.8.3 and cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library

I'm using Codio, which uses Ubuntu-based VMs, but it doesn't give sudo access, so it uses a variant of Autoparts for package mangement. Therefore, I followed the Linux instructions minus the APT installs and the /opt paths.

Codio doesn't currently have GHC 9.8.4, but it does have Cabal 1.20.0.2, so I'll hopefully try that this afternoon. I didn't want to mess with my current VM, because this was the first time I managed to even get this far. Failing that, I guess I'll try a manual install of GHC 7.8.4 and Cabal 1.22.

I also tried installing via Linuxbrew, but it kept failing mysteriously. I suspect Homebrew/linuxbrew#143 is not fully resolved.

@FranklinChen
Copy link

Oops, didn't get notified of your response yesterday, only saw it reloading this page now.

I'm sorry about your installation problems. This is something the Haskell community is working hard on, so that there will be no need for the specific instructions I had to create and test out. 1.16 of Cabal is definitely way too old. Either 1.20 or 1.22 should work. And either GHC 7.8.3 or 7.8.4 should work, but not other versions.

@FranklinChen
Copy link

One other thing, pointed out to me tonight at the workshop, was that I forgot to mention the need to remove old config directories ~/.ghc and ~/.cabal when installing much newer versions of GHC and Cabal. For reference, I have updated my instructions accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment