Skip to content

Commit

Permalink
testsuite: Add test for haskell#9334
Browse files Browse the repository at this point in the history
This adds a test which checks that v2-run works with profiling.

```
cabal v2-run --enable-profiling Main.hs
```

which is the same one as is run in ghcup-ci.

This test fails on recent GHC versions on GHCUp CI so hopefully also on
cabal CI.

https://github.com/haskell/ghcup-metadata/actions/runs/6369779959/job/17290326630#step:3:15214
  • Loading branch information
mpickering committed Nov 16, 2023
1 parent 21b858f commit 1031865
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cabal-testsuite/PackageTests/NewBuild/CmdRun/RunProf/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{- cabal:
build-depends: base
-}

main = print $ 1 + 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# cabal v2-run
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- fake-package-0 (exe:script-Main.hs) --enable-profiling (first run)
Configuring executable 'script-Main.hs' for fake-package-0...
Building executable 'script-Main.hs' for fake-package-0...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

main = cabalTest $ do
res <- cabal' "v2-run" ["--enable-profiling", "./Main.hs"]
assertOutputContains "2" res

0 comments on commit 1031865

Please sign in to comment.