Skip to content

Commit 2acae63

Browse files
authored
Merge pull request #9707 from alt-romes/wip/romes/9697-nonlocal-test
Add test cabal install remote-pkg for #9697
2 parents 285dac2 + b1ff71f commit 2acae63

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

cabal-testsuite/PackageTests/Install/T7297-8909-7236/cabal.test.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ main = cabalTest $ do
1111
runInstalledExe' "my-exe" []
1212
>>= assertOutputContains ("hi" ++ show v)
1313

14+
installExternalWithTgt tgt v = withRepo "repo" (installWithTgt tgt v)
15+
16+
1417
cabal "install" (commonOpts 1) -- no target
1518
runInstalledExe' "my-exe" []
1619
>>= assertOutputContains "hi1"
@@ -20,3 +23,6 @@ main = cabalTest $ do
2023
installWithTgt "my-exe" 4
2124
installWithTgt "all" 5
2225
installWithTgt "all:exes" 6
26+
27+
-- And test it works when installing from an external repo (think Hackage)
28+
installExternalWithTgt "external-lib" 2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Revision history for external-lib0100
2+
3+
## 0.1.0.0 -- YYYY-mm-dd
4+
5+
* First version. Released on an unsuspecting world.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{-# LANGUAGE CPP #-}
2+
3+
#ifdef TEST1
4+
main = putStrLn "hi1"
5+
#endif
6+
7+
#ifdef TEST2
8+
main = putStrLn "hi2"
9+
#endif
10+
11+
#ifdef TEST3
12+
main = putStrLn "hi3"
13+
#endif
14+
15+
#ifdef TEST4
16+
main = putStrLn "hi4"
17+
#endif
18+
19+
#ifdef TEST5
20+
main = putStrLn "hi5"
21+
#endif
22+
23+
#ifdef TEST6
24+
main = putStrLn "hi6"
25+
#endif
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cabal-version: 3.0
2+
name: external-lib
3+
version: 0.1.0.0
4+
license: NONE
5+
6+
maintainer: Matthew Pickering
7+
build-type: Simple
8+
extra-doc-files: CHANGELOG.md
9+
10+
common warnings
11+
ghc-options: -Wall
12+
13+
executable my-exe
14+
import: warnings
15+
main-is: Main.hs
16+
build-depends: base
17+
hs-source-dirs: .
18+
default-language: Haskell2010

0 commit comments

Comments
 (0)