Cannot run tests

Help
2012-11-10
2012-12-06
  • Graham Berks

    Graham Berks - 2012-11-10

    Hi, when I attempt to run a test I get

    test-progfun: unrecognized option `-plain'
    Try `test-progfun -help' for more information.

    It runs fine from the command line.

    Any ideas ?

    Have fp 2.3.2,  scion-browser-0.2.12, buildwrapper-0.6.2
    cabal-install version 1.16.0.2
    using version 1.16.0.3 of the Cabal library

    Thanks
    Graham

     
  • JP Moresmau

    JP Moresmau - 2012-11-10

    What are you using to write tests? Test-framework? Something else? -plain is a parameter useful for test-framework, make sure you use a recent version.

     
  • Graham Berks

    Graham Berks - 2012-11-10

    hspec 1.4.1

     
  • JP Moresmau

    JP Moresmau - 2012-11-10

    Yep, hspec is not supported as a test runner, only test-framework. you can still run the generated exe manually from .dist-buildwrapper/dist/, though.
    In between your two messages, I've added the possibility to run the generated exe from an unsupported test runner from the UI, so the next version should be easier for you to use. Even if we don't support a custom view for results, you'll be able to run the executable from the project contextual menu or the stanza contextual menu, and see the output in the Eclipse console.

     
  • Graham Berks

    Graham Berks - 2012-11-10

    thanks !

     
  • Graham Berks

    Graham Berks - 2012-11-12

    Ok, have switched to test-framework. as i'm just learning haskell.

    What way would you recommend working given I come from a TDD background with scala / java ?

    My natural reaction would be write a new test and execute that by itself.

    Thanks

     
  • JP Moresmau

    JP Moresmau - 2012-11-12

    I'm going to enhance the test support in the coming version of EclipseFP, using HTF (http://hackage.haskell.org/package/HTF-0.9.0.0) which would give us the possibility to discover tests, etc. but for the moment I'm using test-framework and hunit. See for example the tests in the buildwrapper project (https://github.com/JPMoresmau/BuildWrapper/tree/master/test). The full test suite produces an executable that you can run and get a report in the JUnit view on all the tests.

     
  • Graham Berks

    Graham Berks - 2012-11-12

    Thanks, that useful to see how you combine them.

    Yeah I had a runnable set of tests. Just wondering how you build this all up ?
    Run all tests each time ? Use ghci ?

    Have you seen the 'scala worksheet' in eclipse ? Wondering if there is anything like that ?

     
  • JP Moresmau

    JP Moresmau - 2012-11-12

    I run the executable each time, yes. What I do is that if I want to launch only a test, I can quickly comment out the other tests in the testgroup, wait for the exe to be built and run it again. What I plan to add in the next version is to be able to run tests module per module, maybe through GHCi.
    Have a look at http://jpmoresmau.blogspot.fr/2012/10/eclipsefp-first-timid-step-towards-live.html to see how you can combine GHCi and the debug view to evaluate expressions every time you change your file. you can do that in the development version of Eclipse, so it'll be part of the next release.

     
  • Graham Berks

    Graham Berks - 2012-11-16

    Hi, small problem,

    moved the directory of my project and realised I had to recreate the project.

    All i have is the src/test and the cabal file. Deleted .dist_buildwrapper / .project

    Created a new project but when I attempt to run exec or the tests it does nothing. Is there some other step inside the ice I am mean to run ?

    Thanks

     
  • Graham Berks

    Graham Berks - 2012-11-16

    I can run my test main via ghci and all works. Just the invocation via the executables and test suites.

     
  • JP Moresmau

    JP Moresmau - 2012-11-16

    Recreate a Haskell project with the same name, existing files won't be touched, but the .project file is what says "this is a haskell project" (it's an eclipse file containing metadata about the project). Rebuilding the project should recreate .dist-buildwrapper and the executables.

     
  • Graham Berks

    Graham Berks - 2012-11-16

    Yeah thats what I did. Only had the cabal file and the src / test. Created a new project and this problem occurs.

    Do I need to trash the workspace ?

     
  • Graham Berks

    Graham Berks - 2012-11-16

    get from the console when trying to run the exec

    configuring because setup_config not present

    Module not part of module graph
    Module not part of module graph
    Module not part of module graph
    Module not part of module graph

    Module not part of module graph
    Module not part of module graph
    Module not part of module graph
    Module not part of module graph

     
  • Graham Berks

    Graham Berks - 2012-11-16

    trashing the workspace fixed it.

     
  • JP Moresmau

    JP Moresmau - 2012-11-17

    That was a bit extreme, had you tried "cleaning" the project?

     
  • Graham Berks

    Graham Berks - 2012-11-17

    yup, I had deleted all non source files from the project.

     
  • Graham Berks

    Graham Berks - 2012-11-23

    Do you recommend indigo over juno for eclipsefp ?

     
  • Graham Berks

    Graham Berks - 2012-11-23

    Also have an odd install issue. Have recently changed my haskell install now when I create a haskell project I get

    configuring because setup_config not present

    buildwrapper: user error (You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.16.0.3, now Cabal-1.14.0).)
    Cabal file/Users/graham/Development/code/sandbox/progfun-haskell/.dist-buildwrapper/progfun-haskell.cabal does not exist
    configuring because persist build config not present

    buildwrapper: user error (You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.16.0.3, now Cabal-1.14.0).)
    configuring because persist build config not present

    buildwrapper: user error (You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.16.0.3, now Cabal-1.14.0).)
    configuring because persist build config not present

    buildwrapper: user error (You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.16.0.3, now Cabal-1.14.0).)
    Cabal file/Users/graham/Development/code/sandbox/progfun-haskell/.dist-buildwrapper/progfun-haskell.cabal does not exist
    configuring because setup_config not present

    buildwrapper: user error (You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.16.0.3, now Cabal-1.14.0).)

    I have the 1.14 from ghc 7.4.2 and 1.16 from a self install. The prefs has 1.16 installed. With

    $ cabal -V
    cabal-install version 1.16.0.2
    using version 1.16.0.3 of the Cabal library

    first in the path.

    Any ideas ? Works via cmd line cabal.

    Thanks

     
  • JP Moresmau

    JP Moresmau - 2012-11-23

    Sorry, missed your previous message. I haven't moved to juno myself, but I've heard only bad things about it, so maybe stick to Indigo until the dust settles.
    Now, your other message, is because the buildwrapper executable uses the Cabal library is was built with, and at the same time the cabal executable. If you've updated your Cabal install, you need to rebuild buildwrapper so that the cabal executable and the version of the Cabal library used to buidl buildwrapper have the same version. That's because Cabal saves its version into a config file and aborts if the versions don't match.
    You're not the first one with that issue, I'm planning to add a warning in EclipseFP if there is such a mismatch.

     
  • Graham Berks

    Graham Berks - 2012-11-24

    Thanks, yep that fixed it. Will go with Indigo as well.

     
  • Graham Berks

    Graham Berks - 2012-11-24

    By the way, if i run sourcegraph on the project I just get

    SourceGraph: Ambiguous infix expression

    Any ideas ? Or way to get more info on the issue ?

     
  • JP Moresmau

    JP Moresmau - 2012-11-24

    Nope, but I don't use SourceGraph much. I'd say it 's SourceGraph limitation. Ensure you're running the latest version of SourceGraph and if so, contact the maintainer. Try to find the minimal amount of code causing the issue, obviously something to do with infix operators.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks