Skip to content
Snippets Groups Projects
Commit a366739c authored by Francesco Gazzetta's avatar Francesco Gazzetta
Browse files

Add test for new-bench

parent 7e2071f1
No related branches found
No related tags found
No related merge requests found
main = putStrLn "Hello Bar"
main = putStrLn "Hello Foo"
name: MultipleBenchmarks
version: 1.0
build-type: Simple
cabal-version: >= 1.10
benchmark foo
type: exitcode-stdio-1.0
main-is: Foo.hs
build-depends: base
default-language: Haskell2010
benchmark bar
type: exitcode-stdio-1.0
main-is: Bar.hs
build-depends: base
default-language: Haskell2010
# cabal new-bench
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- MultipleBenchmarks-1.0 (bench:foo) (first run)
Configuring benchmark 'foo' for MultipleBenchmarks-1.0..
Preprocessing benchmark 'foo' for MultipleBenchmarks-1.0..
Building benchmark 'foo' for MultipleBenchmarks-1.0..
Running 1 benchmarks...
Benchmark foo: RUNNING...
Benchmark foo: FINISH
# cabal new-bench
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- MultipleBenchmarks-1.0 (bench:bar) (first run)
- MultipleBenchmarks-1.0 (bench:foo) (first run)
Configuring benchmark 'bar' for MultipleBenchmarks-1.0..
Preprocessing benchmark 'bar' for MultipleBenchmarks-1.0..
Building benchmark 'bar' for MultipleBenchmarks-1.0..
Running 1 benchmarks...
Benchmark bar: RUNNING...
Benchmark bar: FINISH
Preprocessing benchmark 'foo' for MultipleBenchmarks-1.0..
Building benchmark 'foo' for MultipleBenchmarks-1.0..
Running 1 benchmarks...
Benchmark foo: RUNNING...
Benchmark foo: FINISH
packages: .
import Test.Cabal.Prelude
main = cabalTest $ do
res1 <- cabal' "new-bench" ["foo"]
assertOutputContains "Hello Foo" res1
assertOutputDoesNotContain "Hello Bar" res1
res2 <- cabal' "new-bench" ["all"]
assertOutputContains "Hello Foo" res2
assertOutputContains "Hello Bar" res2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment