diff --git a/cabal-testsuite/PackageTests/Install/T7297-8909-7236/cabal.test.hs b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/cabal.test.hs index 729108f273f..2583cdac2e3 100644 --- a/cabal-testsuite/PackageTests/Install/T7297-8909-7236/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/cabal.test.hs @@ -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" @@ -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 diff --git a/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/CHANGELOG.md b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/CHANGELOG.md new file mode 100644 index 00000000000..fbf078ff958 --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for external-lib0100 + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/Main.hs b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/Main.hs new file mode 100644 index 00000000000..38bfcb0221f --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/Main.hs @@ -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 diff --git a/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/external-lib.cabal b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/external-lib.cabal new file mode 100644 index 00000000000..bc501812d3b --- /dev/null +++ b/cabal-testsuite/PackageTests/Install/T7297-8909-7236/repo/external-lib-0.1.0.0/external-lib.cabal @@ -0,0 +1,18 @@ +cabal-version: 3.0 +name: external-lib +version: 0.1.0.0 +license: NONE +author: matthewtpickering@gmail.com +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