Using cabal repl with tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using cabal repl with tests

Arnaud Bailly-2
Hello,
I have a classical project with cabal file split between a library, an executable and a test-suite. When I run `cabal repl` I got all modules from the library loaded, which is somewhat logical.

I would like to launch a repl with test modules loaded, how can I achieve this?
Adding `--enable-tests` does not help for the repl... 

Thanks,
--
Arnaud Bailly
FoldLabs Associate: http://foldlabs.com

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Using cabal repl with tests

Daniel Gorín
Try: cabal repl <name_of_your_tests>

The same works for executables.

Daniel

On 15 Sep 2014, at 14:08, Arnaud Bailly <[hidden email]> wrote:

> Hello,
> I have a classical project with cabal file split between a library, an executable and a test-suite. When I run `cabal repl` I got all modules from the library loaded, which is somewhat logical.
>
> I would like to launch a repl with test modules loaded, how can I achieve this?
> Adding `--enable-tests` does not help for the repl...
>
> Thanks,
> --
> Arnaud Bailly
> FoldLabs Associate: http://foldlabs.com
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Using cabal repl with tests

Ivan Lazar Miljenovic
In reply to this post by Arnaud Bailly-2
From `cabal repl --help`:

Examples:
  cabal repl               The first component in the package
  cabal repl foo           A named component (i.e. lib, exe, test suite)

The `foo' in this case is the name of the test-suite or executable.

On 15 September 2014 23:08, Arnaud Bailly <[hidden email]> wrote:

> Hello,
> I have a classical project with cabal file split between a library, an
> executable and a test-suite. When I run `cabal repl` I got all modules from
> the library loaded, which is somewhat logical.
>
> I would like to launch a repl with test modules loaded, how can I achieve
> this?
> Adding `--enable-tests` does not help for the repl...
>
> Thanks,
> --
> Arnaud Bailly
> FoldLabs Associate: http://foldlabs.com
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



--
Ivan Lazar Miljenovic
[hidden email]
http://IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Using cabal repl with tests

Arnaud Bailly-2
In reply to this post by Daniel Gorín
Wow! Works like a charm... Thanks a lot.

And it is documented in the cabal user guide!

So I should have looked there before, apologies for the noise. 

--
Arnaud Bailly
FoldLabs Associate: http://foldlabs.com

On Mon, Sep 15, 2014 at 3:14 PM, Daniel Gorín <[hidden email]> wrote:
Try: cabal repl <name_of_your_tests>

The same works for executables.

Daniel

On 15 Sep 2014, at 14:08, Arnaud Bailly <[hidden email]> wrote:

> Hello,
> I have a classical project with cabal file split between a library, an executable and a test-suite. When I run `cabal repl` I got all modules from the library loaded, which is somewhat logical.
>
> I would like to launch a repl with test modules loaded, how can I achieve this?
> Adding `--enable-tests` does not help for the repl...
>
> Thanks,
> --
> Arnaud Bailly
> FoldLabs Associate: http://foldlabs.com
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe