Skip to content

Commit

Permalink
Add missing line at EOF for cabal-testsuite/**/*.hs
Browse files Browse the repository at this point in the history
- Fix whitespace in cabal-testsuite + other tests
  • Loading branch information
philderbeast committed Mar 16, 2024
1 parent e420bf2 commit e386a13
Show file tree
Hide file tree
Showing 39 changed files with 38 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ tests = testGroup "Distribution.Simple.Program.GHC"
, compilerCompat = []
, compilerLanguages = []
, compilerExtensions = []
, compilerProperties = Map.singleton "Support parallel --make" "YES"
, compilerProperties = Map.singleton "Support parallel --make" "YES"
})
(Platform X86_64 Linux)
(mempty { ghcOptNumJobs = Flag (NumJobs (Just 4)) })
assertListEquals flags ["-j4", "-clear-package-db"]
]
]
]

assertListEquals :: (Eq a, Show a) => [a] -> [a] -> Assertion
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/tests/IntegrationTests2/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
config/default-config
config/default-config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ main = setupTest $ do
skipUnlessGhcVersion ">= 8.1"
ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*"
expectBrokenIf ghc 7987 $
withPackageDb $
withPackageDb $
withDirectory "Includes2" $ do
let setup_install' args = setup_install_with_docs args
setup_install' ["mylib", "--cid", "mylib-0.1.0.0"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ executable demo
else
cmm-options: -ddump-cmm


Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ main = setupTest $ do
res <- fails $ withDirectory "custom" $ setup' "aaaa" []
assertOutputContains "unrecognised command" res


Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import qualified Distribution.Simple as DS
import Distribution.Simple.Setup

main :: IO ()
main = DS.defaultMainWithHooks DS.simpleUserHooks
main = DS.defaultMainWithHooks DS.simpleUserHooks
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import Test.Cabal.Prelude
-- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal
-- v2-sdist" writes sdist/uv-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import Test.Cabal.Prelude

-- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package.
main = cabalTest $ do
cabal "sdist" ["all", "--ignore-project"]
cabal "sdist" ["all", "--ignore-project"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import Test.Cabal.Prelude
-- and wrote sdist/p-0.1.tar.gz. That is incorrect. It didn't ignore the
-- project.
main = cabalTest $ do
cabal "v2-sdist" ["all", "--ignore-project"]
cabal "v2-sdist" ["all", "--ignore-project"]
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import Test.Cabal.Prelude
-- project probing would not occur and "cabal sdist" would work on the local
-- uv.cabal package.
main = cabalTest $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import Test.Cabal.Prelude
-- seen) is that project probing would not occur and "cabal v2-sdist" would work
-- on the local uv.cabal package.
main = cabalTest $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import Test.Cabal.Prelude
-- TODO: Fix this behaviour and apply the patch cabal.sub-pq.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.sub-pq.project has "packages: p/ q/" and "cabal v2-sdist" writes
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import Test.Cabal.Prelude
-- TODO: Fix this behaviour and apply the patch cabal.sub-rs.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.sub-rs.project has "packages: r/ s/" and "cabal v2-sdist" writes
-- sdist/r-0.1.tar.gz and sdist/s-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import Test.Cabal.Prelude
-- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal
-- v2-sdist" writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. That is correct.
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import Test.Cabal.Prelude

-- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package.
main = cabalTest $ do
cabal "sdist" ["all", "--ignore-project"]
cabal "sdist" ["all", "--ignore-project"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Test.Cabal.Prelude
-- sdist/uv-0.1.tar.gz for the uv.cabal package but instead it wrote
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz.
main = cabalTest $ do
cabal "v2-sdist" ["all", "--ignore-project"]
cabal "v2-sdist" ["all", "--ignore-project"]
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ import Test.Cabal.Prelude
-- TODO: Check that the code is behaving the same as it would have if
-- "--project-file=cabal.project" was given or if it is using project probing.
main = cabalTest $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Test.Cabal.Prelude
-- has "packages: p/ q/" and writes sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz.
-- This is correct.
main = cabalTest $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Test.Cabal.Prelude
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct but likely
-- accidental as the default cabal.project has the same packages.
main = cabalTest . withProjectFile "cabal.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- The given cabal.project has has "packages: p/ q/" and "cabal v2-sdist" writes
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.sub-pq.project has "packages: p/ q/" and "cabal sdist" writes
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.sub-pq.project has "packages: p/ q/" and "cabal v2-sdist" writes
-- sdist/p-0.1.tar.gz and sdist/q-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import Test.Cabal.Prelude
-- TODO: Fix this behaviour and apply the patch cabal.sub-rs.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
-- cabal.sub-rs.project has "packages: r/ s/" and "cabal v2-sdist" writes
-- sdist/r-0.1.tar.gz and sdist/s-0.1.tar.gz. That is correct.
main = cabalTest . withProjectFile "cabal.sub-rs.project" $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ with these tests.
`cabal.project` instead; either the one one in the current directory or the
one from the parent directory, one level up. I think this behaviour is wrong
and the supplied `--project-file` option should be respected.

Before I'd put a project there, one level up, the project probing had gone
all the way up to Cabal's own `cabal.project` as can be seen by this diff
after that change:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import Test.Cabal.Prelude

-- This test correctly writes sdist/z-0.1.tar.gz for the z.cabal package.
main = cabalTest $ do
cabal "sdist" ["all", "--ignore-project"]
cabal "sdist" ["all", "--ignore-project"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import Test.Cabal.Prelude

-- This test correctly writes sdist/z-0.1.tar.gz for the z.cabal package.
main = cabalTest $ do
cabal "sdist" ["all", "--ignore-project"]
cabal "sdist" ["all", "--ignore-project"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Test.Cabal.Prelude
-- has "packages: Projects-Default-No/p" and writes sdist/p-0.1.tar.gz. This is
-- correct.
main = cabalTest $ do
cabal "sdist" ["all"]
cabal "sdist" ["all"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Test.Cabal.Prelude
-- has "packages: Projects-Default-No/p" and writes sdist/p-0.1.tar.gz. This is
-- correct.
main = cabalTest $ do
cabal "v2-sdist" ["all"]
cabal "v2-sdist" ["all"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Test.Cabal.Prelude

main = cabalTest . withRepo "repo" . withProjectFile "0-local.project" $ do
fails $ cabal "v2-build" ["--dry-run"]
fails $ cabal "v2-build" ["--dry-run"]
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ testVersionWin project =

main = cabalTest . withRepo "repo" $ do
testVersionWin "1-local-constraints-import.project"
testVersionWin "1-local-import-constraints.project"
testVersionWin "1-local-import-constraints.project"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ testVersionWin project =

main = cabalTest . withRepo "repo" $ do
testVersionWin "2-local-constraints-import.project"
testVersionWin "2-local-import-constraints.project"
testVersionWin "2-local-import-constraints.project"
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do
-- +Warning: The directory <GBLTMPDIR><GHCVER>/incoming/new-2448/Users/RUNNER~1/AppData/Local/Temp/cabal-test-store-28260/ghc-<GHCVER>/WarnEarlyOver_-0.1.0.0-4c19059e06a32b93b2812983631117e77a2d3833/bin is not in the system search path.
-- +Copying 'warn-early-overwrite' to '<GBLTMPDIR>'
skipIfWindows
cabalG options "v2-install" ["--install-method=copy"]
cabalG options "v2-install" ["--install-method=copy"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do
-- The default install method is symlink that may not work on Windows.
skipIfWindows
let options = ["--store-dir=" ++ storeDir, "--installdir=" ++ storeDir]
cabalG options "v2-install" []
cabalG options "v2-install" []
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ do
-- Touch the target to see if the warning is made early before the build.
_ <- runM "touch" [storeDir </> "warn-early-overwrite"] Nothing
fails $ cabalG options "v2-install" []
cabalG options "v2-install" ["--overwrite-policy=always"]
cabalG options "v2-install" ["--overwrite-policy=always"]

0 comments on commit e386a13

Please sign in to comment.