Skip to content

Commit

Permalink
Merge pull request #9707 from alt-romes/wip/romes/9697-nonlocal-test
Browse files Browse the repository at this point in the history
Add test cabal install remote-pkg for #9697
  • Loading branch information
mergify[bot] authored Feb 18, 2024
2 parents 285dac2 + b1ff71f commit 2acae63
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ main = cabalTest $ do
runInstalledExe' "my-exe" []
>>= assertOutputContains ("hi" ++ show v)

installExternalWithTgt tgt v = withRepo "repo" (installWithTgt tgt v)


cabal "install" (commonOpts 1) -- no target
runInstalledExe' "my-exe" []
>>= assertOutputContains "hi1"
Expand All @@ -20,3 +23,6 @@ main = cabalTest $ do
installWithTgt "my-exe" 4
installWithTgt "all" 5
installWithTgt "all:exes" 6

-- And test it works when installing from an external repo (think Hackage)
installExternalWithTgt "external-lib" 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Revision history for external-lib0100

## 0.1.0.0 -- YYYY-mm-dd

* First version. Released on an unsuspecting world.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{-# LANGUAGE CPP #-}

#ifdef TEST1
main = putStrLn "hi1"
#endif

#ifdef TEST2
main = putStrLn "hi2"
#endif

#ifdef TEST3
main = putStrLn "hi3"
#endif

#ifdef TEST4
main = putStrLn "hi4"
#endif

#ifdef TEST5
main = putStrLn "hi5"
#endif

#ifdef TEST6
main = putStrLn "hi6"
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cabal-version: 3.0
name: external-lib
version: 0.1.0.0
license: NONE
author: [email protected]
maintainer: Matthew Pickering
build-type: Simple
extra-doc-files: CHANGELOG.md

common warnings
ghc-options: -Wall

executable my-exe
import: warnings
main-is: Main.hs
build-depends: base
hs-source-dirs: .
default-language: Haskell2010

0 comments on commit 2acae63

Please sign in to comment.