XMC: tests/* no longer compiles

The QC 1 v 2 errors aside, they seem to be quite bitrotten eg. for test_Selective.hs test_Selective.hs:18:4: `coarbitrary' is not a (visible) method of class `Arbitrary' test_Selective.hs:20:20: Not in scope: type constructor or class `Selection' test_Selective.hs:25:29: Not in scope: data constructor `Sel' test_Selective.hs:26:4: `coarbitrary' is not a (visible) method of class `Arbitrary' test_Selective.hs:34:26: Not in scope: `select' test_Selective.hs:34:48: Not in scope: `nMaster' test_Selective.hs:34:63: Not in scope: `nRest' test_Selective.hs:35:17: Not in scope: `update' test_Selective.hs:38:50: Not in scope: `update' test_Selective.hs:39:17: Not in scope: `update' test_Selective.hs:43:10: Not in scope: `nMaster' test_Selective.hs:43:48: Not in scope: `nMaster' test_Selective.hs:43:74: Not in scope: `select' test_Selective.hs:46:65: Not in scope: `select' test_Selective.hs:47:17: Not in scope: `update' test_Selective.hs:52:26: Not in scope: `select' test_Selective.hs:58:27: Not in scope: `select' test_Selective.hs:62:40: Not in scope: `nMaster' test_Selective.hs:62:49: Not in scope: `update' test_Selective.hs:63:43: Not in scope: `nMaster' test_Selective.hs:63:59: Not in scope: `start' test_Selective.hs:64:17: Not in scope: `update' test_Selective.hs:65:40: Not in scope: `nRest' test_Selective.hs:65:47: Not in scope: `update' test_Selective.hs:70:16: Not in scope: `update' test_Selective.hs:73:15: Not in scope: `update' test_Selective.hs:74:15: Not in scope: `select' test_Selective.hs:78:16: Not in scope: `update' test_Selective.hs:81:15: Not in scope: `update' test_Selective.hs:82:15: Not in scope: `select' I've pushed 1 patches updating module imports and aavogt did another, but I can't seem to get ghci to load the right QuickCheck version so I'm punting on fixing any other possible errors. -- gwern

Gwern Branwen
The QC 1 v 2 errors aside, they seem to be quite bitrotten eg. for test_Selective.hs
test_Selective.hs:18:4: `coarbitrary' is not a (visible) method of class `Arbitrary'
[snip]
I've pushed 1 patches updating module imports and aavogt did another, but I can't seem to get ghci to load the right QuickCheck version so I'm punting on fixing any other possible errors.
Well, the .cabal file does specify QuickCheck < 2, so that should be right. What versions of QuickCheck do you have installed? Or if you're trying to build/run this without using Cabal, then do "ghc-pkg hide QuickCheck-2.xxxxx". -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

* On Thursday, April 15 2010, Ivan Lazar Miljenovic wrote:
Gwern Branwen
writes: The QC 1 v 2 errors aside, they seem to be quite bitrotten eg. for test_Selective.hs
test_Selective.hs:18:4: `coarbitrary' is not a (visible) method of class `Arbitrary'
[snip]
I've pushed 1 patches updating module imports and aavogt did another, but I can't seem to get ghci to load the right QuickCheck version so I'm punting on fixing any other possible errors.
Well, the .cabal file does specify QuickCheck < 2, so that should be right. What versions of QuickCheck do you have installed? Or if you're trying to build/run this without using Cabal, then do "ghc-pkg hide QuickCheck-2.xxxxx".
You can build them by specifying explicitly the version of QC to use: ghc -O2 --make -package QuickCheck-1.2.0.0 tests/test_XPrompt.hs -o xprompt ./xprompt Sometimes you need a script to could be run with a script that extracts all prop_ functions like [1], for tests like tests/test_Selective.hs Ideally, somebody could set up something to run all tests (adding some more), using something like [2]. [1] http://www.cs.chalmers.se/~rjmh/QuickCheck/quickcheck [2] http://batterseapower.github.com/test-framework/ -- Adam

On Wed, Apr 14, 2010 at 11:23 PM, Gwern Branwen
The QC 1 v 2 errors aside, they seem to be quite bitrotten eg. for test_Selective.hs
AFAIR, these tests work if the appropriate symbols are exported, but those symbols are not appropriate for export for general use. I don't know of a good way around this. --Max

* On Friday, April 16 2010, Max Rabkin wrote:
On Wed, Apr 14, 2010 at 11:23 PM, Gwern Branwen
wrote: The QC 1 v 2 errors aside, they seem to be quite bitrotten eg. for test_Selective.hs
AFAIR, these tests work if the appropriate symbols are exported, but those symbols are not appropriate for export for general use. I don't know of a good way around this.
--Max
I've done some CPP to work around that: we already use some to toggle xft support, so it can't be too bad to enable it on a file-by-file basis, right? GHCi can load modules while disregarding module exports (:m *Module), which could be accessed from the ghc-api too (see InteractiveEval.setContext), but I was unable to load all the prop_ functions defined in another module as if they had been specified in that interactive session. I'm not aware that other projects use this approach for tests however. Also added is a script to collect prop_ functions and run them all together in a generated script, with some instructions how to run it: perhaps it could be extended to look at comments (extracted with haskell-src-exts), from the modules in XMonad/* -- Adam
participants (4)
-
Adam Vogt
-
Gwern Branwen
-
Ivan Lazar Miljenovic
-
Max Rabkin