From d559f84744d72da4262a5cd4c083a880c1a2b681 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Mon, 15 Jul 2024 17:33:22 +0200 Subject: [PATCH] Fix a bunch of Windows tests, clarify why others are broken --- .../AutoconfBadPaths/cabal.test.hs | 60 ++++++------ .../Includes2/{Includes2.cabal => I.cabal} | 6 +- .../Includes2.cabal => I.cabal.fail} | 0 .../I.cabal} | 0 .../Includes2/{Includes2.cabal => I.cabal} | 4 +- .../Backpack/Includes2/cabal-external.test.hs | 4 +- .../Includes2/cabal-internal-target.out | 8 +- .../Backpack/Includes2/cabal-internal.out | 66 ++++++------- .../Backpack/Includes2/cabal-internal.test.hs | 5 +- .../PackageTests/Backpack/Includes2/cov.out | 70 +++++++------- .../Backpack/Includes2/cov.test.hs | 1 - .../Includes2/setup-internal.cabal.out | 50 +++++----- .../Backpack/Includes2/setup-internal.out | 50 +++++----- .../Includes2/setup-per-component.out | 92 +++++++++---------- .../Includes2/setup-per-component.test.hs | 2 +- .../Includes3/{Includes3.cabal => I.cabal} | 2 +- .../Backpack/Includes3/cabal-external.test.hs | 4 +- .../Backpack/Includes3/cabal-internal.out | 34 +++---- .../Backpack/Includes3/cabal-internal.test.hs | 5 +- .../Backpack/Includes3/cabal-repo.test.hs | 1 - .../Includes3/setup-internal.cabal.out | 40 ++++---- .../Backpack/Includes3/setup-internal.out | 40 ++++---- .../PackageTests/Backpack/T6385/cabal.test.hs | 3 +- .../bkpcabal01/{bkpcabal01.cabal => b.cabal} | 2 +- .../Backpack/bkpcabal01/cabal.out | 56 +++++------ .../Backpack/bkpcabal01/cabal.test.hs | 4 +- .../PackageTests/BuildTools/Foreign/A.hs | 5 + .../Foreign/my-foreign-preprocessor.bat | 2 + .../Foreign/my-foreign-preprocessor.ps1 | 1 + .../BuildTools/Foreign/setup.test.hs | 2 - .../CCompilerOverride/setup.test.hs | 3 +- .../Paths/InvalidWin/cabal.test.hs | 17 ++-- .../PackageTests/CmmSourcesDyn/cabal.test.hs | 2 +- .../ConditionalAndImport/cabal.test.hs | 49 +++++----- .../PackageTests/CustomSegfault/cabal.test.hs | 3 +- .../PackageTests/ExtraProgPath/setup.test.hs | 10 +- .../PackageTests/ForeignLibs/setup.test.hs | 3 +- .../GHCJS/BuildRunner/cabal.test.hs | 4 +- .../GhcPkgGuess/SameDirectory/setup.test.hs | 17 ++-- .../SameDirectoryGhcVersion/setup.test.hs | 17 ++-- .../SameDirectoryVersion/setup.test.hs | 17 ++-- .../GhcPkgGuess/Symlink/setup.test.hs | 5 +- .../SymlinkGhcVersion/setup.test.hs | 5 +- .../GhcPkgGuess/SymlinkVersion/setup.test.hs | 5 +- .../HaddockKeepsTmps/cabal.test.hs | 21 +++-- .../Executable/setup-static.test.hs | 2 +- .../setup-gen-script.test.hs | 3 +- .../PackageTests/JS/JsSources/js-arch.test.hs | 12 +-- .../JS/JsSources/other-arch.test.hs | 9 +- .../JS/JsSourcesExe/js-arch.test.hs | 12 +-- .../JS/JsSourcesExe/other-arch.test.hs | 9 +- .../NonignoredConfigs/cabal.test.hs | 9 +- .../LinkerOptions/T7339/setup.test.hs | 11 +-- .../MultiRepl/EnabledSucc/cabal.test.hs | 1 - .../NewBuild/CmdRun/Terminate/cabal.test.hs | 54 +++++------ ...ackage-from-repo-with-custom-setup.test.hs | 6 +- .../PackageTests/NewBuild/T3827/cabal.test.hs | 4 +- .../PackageTests/NewFreeze/T9799b/src/None.hs | 5 +- .../OfflineFlag/offlineFlag.test.hs | 1 - .../Executable-Relocatable/setup.test.hs | 9 +- .../PackageTests/PkgConfigParse/setup.test.hs | 4 +- .../PreProcess/Hsc2HsOptionsCC/my.cabal | 1 - .../PreProcess/Hsc2HsOptionsCC/setup.test.hs | 32 ++++--- .../PackageTests/ProfShared/setup.test.hs | 5 +- .../QuasiQuotes/dynamic/setup.test.hs | 2 +- .../Regression/T4025/setup.test.hs | 27 +++--- .../Regression/T4270/setup.test.hs | 5 +- .../Regression/T4291/setup.test.hs | 25 ++--- .../Regression/T5309/cabal.test.hs | 12 ++- .../Regression/T5677/cabal.test.hs | 1 - .../Regression/T6906/cabal.test.hs | 3 +- .../ExeV10/cabal-with-hpc.multitest.hs | 4 +- .../clean-install-by-copy.test.hs | 18 ++-- .../clean-install-by-symlink.test.hs | 12 +-- .../WarnEarlyOverwrite/dirty-install.test.hs | 21 ++--- .../postCheckoutCommand/cabal.test.hs | 5 +- validate.sh | 2 +- 77 files changed, 554 insertions(+), 569 deletions(-) rename cabal-testsuite/PackageTests/Backpack/Includes2/{Includes2.cabal => I.cabal} (92%) rename cabal-testsuite/PackageTests/Backpack/Includes2/{Includes2-fail/Includes2.cabal => I.cabal.fail} (100%) rename cabal-testsuite/PackageTests/Backpack/Includes2/{Includes2.cabal.fail => Includes2-fail/I.cabal} (100%) rename cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/{Includes2.cabal => I.cabal} (93%) rename cabal-testsuite/PackageTests/Backpack/Includes3/{Includes3.cabal => I.cabal} (95%) rename cabal-testsuite/PackageTests/Backpack/bkpcabal01/{bkpcabal01.cabal => b.cabal} (96%) create mode 100644 cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat create mode 100644 cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 diff --git a/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs b/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs index 93ce9825a36..544764affcd 100644 --- a/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs +++ b/cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs @@ -2,36 +2,38 @@ import Test.Cabal.Prelude import Data.Foldable (traverse_) import Distribution.Simple.Utils import System.Directory -main = cabalTest $ do - -- Test the forbidden characters except NUL. Reference: - -- https://www.gnu.org/software/autoconf/manual/autoconf.html#File-System-Conventions +main = do -- Most of these are magic on Windows, so don't bother testing there. - -- - -- Note: we bundle the configure script so no need to autoreconf - -- while building - skipIfWindows - traverse_ check - [ "foo bar" - , "foo\tbar" - , "foo\nbar" - , "foo\"bar" - , "foo#bar" - , "foo$bar" - , "foo&bar" - , "foo'bar" - , "foo(bar" - , "foo)bar" - , "foo*bar" - , "foo;bar" - , "foobar" - , "foo?bar" - , "foo[bar" - , "foo\\bar" - , "foo`bar" - , "foo|bar" - ] + skipIfWindows "uninteresting" + cabalTest $ + -- Test the forbidden characters except NUL. Reference: + -- https://www.gnu.org/software/autoconf/manual/autoconf.html#File-System-Conventions + -- + -- Note: we bundle the configure script so no need to autoreconf + -- while building + + traverse_ check + [ "foo bar" + , "foo\tbar" + , "foo\nbar" + , "foo\"bar" + , "foo#bar" + , "foo$bar" + , "foo&bar" + , "foo'bar" + , "foo(bar" + , "foo)bar" + , "foo*bar" + , "foo;bar" + , "foobar" + , "foo?bar" + , "foo[bar" + , "foo\\bar" + , "foo`bar" + , "foo|bar" + ] where setup dir = do env <- getTestEnv diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal b/cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal similarity index 92% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal index e6aa6169e68..efaa83b4837 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal @@ -1,4 +1,4 @@ -name: Includes2 +name: I version: 0.1.0.0 license: BSD3 author: Edward Z. Yang @@ -35,14 +35,14 @@ library default-language: Haskell2010 executable exe - build-depends: base, Includes2 + build-depends: base, I main-is: Main.hs hs-source-dirs: exe default-language: Haskell2010 test-suite includes2-test type: exitcode-stdio-1.0 - build-depends: base, Includes2 + build-depends: base, I main-is: test.hs hs-source-dirs: test default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/Includes2.cabal b/cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal.fail similarity index 100% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/Includes2.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes2/I.cabal.fail diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal.fail b/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/I.cabal similarity index 100% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal.fail rename to cabal-testsuite/PackageTests/Backpack/Includes2/Includes2-fail/I.cabal diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/Includes2.cabal b/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/I.cabal similarity index 93% rename from cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/Includes2.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/I.cabal index 7a02fcd961c..793f6a31979 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/Includes2.cabal +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2/I.cabal @@ -1,4 +1,4 @@ -name: Includes2 +name: I version: 0.1.0.0 license: BSD3 author: Edward Z. Yang @@ -35,7 +35,7 @@ library default-language: Haskell2010 executable exe - build-depends: base, Includes2 + build-depends: base, I main-is: Main.hs hs-source-dirs: exe default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs index 7197786ff2a..432911b1714 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs @@ -1,8 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do + cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.external.project" $ do cabal "v2-build" ["exe"] withPlan $ do diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out index 8b63d59d82c..2a91ccc557a 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out @@ -2,8 +2,8 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes2-0.1.0.0 (lib:mylib) (first run) -Configuring library 'mylib' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + - I-0.1.0.0 (lib:mylib) (first run) +Configuring library 'mylib' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out index f8dfb64d9e6..42f77888c8c 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out @@ -2,42 +2,42 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes2-0.1.0.0 (lib:mylib) (first run) - - Includes2-0.1.0.0 (lib:mysql) (first run) - - Includes2-0.1.0.0 (lib:postgresql) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-mysql:Database.MySQL) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) - - Includes2-0.1.0.0 (lib) (first run) - - Includes2-0.1.0.0 (exe:exe) (first run) -Configuring library 'mylib' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + - I-0.1.0.0 (lib:mylib) (first run) + - I-0.1.0.0 (lib:mysql) (first run) + - I-0.1.0.0 (lib:postgresql) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-mysql:Database.MySQL) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) + - I-0.1.0.0 (lib) (first run) + - I-0.1.0.0 (exe:exe) (first run) +Configuring library 'mylib' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Configuring library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Configuring library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... +for I-0.1.0.0... +Configuring library 'mysql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Configuring library 'postgresql' for I-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Configuring library for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Configuring executable 'exe' for Includes2-0.1.0.0... -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... -# Includes2 exe + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Configuring library for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Configuring executable 'exe' for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... +# I exe "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs index a04fdd4987a..6a05d9f0e96 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs @@ -2,9 +2,8 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 - withProjectFile "cabal.internal.project" $ do + expectBrokenIf isWindows 10191 $ withProjectFile "cabal.internal.project" $ do cabal "v2-build" ["exe"] withPlan $ do - r <- runPlanExe' "Includes2" "exe" [] + r <- runPlanExe' "I" "exe" [] assertOutputContains "minemysql minepostgresql" r diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out index 784baff09e7..0d1b2c027b5 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.out @@ -2,47 +2,47 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes2-0.1.0.0 (lib:mylib) (first run) - - Includes2-0.1.0.0 (lib:mysql) (first run) - - Includes2-0.1.0.0 (lib:postgresql) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-mysql:Database.MySQL) (first run) - - Includes2-0.1.0.0 (lib:mylib with Database=Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) - - Includes2-0.1.0.0 (lib) (first run) - - Includes2-0.1.0.0 (test:includes2-test) (first run) -Configuring library 'mylib' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + - I-0.1.0.0 (lib:mylib) (first run) + - I-0.1.0.0 (lib:mysql) (first run) + - I-0.1.0.0 (lib:postgresql) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-mysql:Database.MySQL) (first run) + - I-0.1.0.0 (lib:mylib with Database=I-0.1.0.0-inplace-postgresql:Database.PostgreSQL) (first run) + - I-0.1.0.0 (lib) (first run) + - I-0.1.0.0 (test:includes2-test) (first run) +Configuring library 'mylib' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Configuring library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Configuring library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... +for I-0.1.0.0... +Configuring library 'mysql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Configuring library 'postgresql' for I-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-mysql:Database.MySQL +for I-0.1.0.0... Configuring library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Configuring library for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Configuring test suite 'includes2-test' for Includes2-0.1.0.0... -Preprocessing test suite 'includes2-test' for Includes2-0.1.0.0... -Building test suite 'includes2-test' for Includes2-0.1.0.0... + Database = I-0.1.0.0-inplace-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Configuring library for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Configuring test suite 'includes2-test' for I-0.1.0.0... +Preprocessing test suite 'includes2-test' for I-0.1.0.0... +Building test suite 'includes2-test' for I-0.1.0.0... Running 1 test suites... Test suite includes2-test: RUNNING... Test suite includes2-test: PASS -Test suite logged to: /cov.dist/work/./dist/build//ghc-/Includes2-0.1.0.0/t/includes2-test/test/Includes2-0.1.0.0-includes2-test.log -Package coverage report written to /cov.dist/work/./dist/build//ghc-/Includes2-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html +Test suite logged to: /cov.dist/work/./dist/build//ghc-/I-0.1.0.0/t/includes2-test/test/I-0.1.0.0-includes2-test.log +Package coverage report written to /cov.dist/work/./dist/build//ghc-/I-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html 1 of 1 test suites (1 of 1 test cases) passed. -Package coverage report written to /cov.dist/work/./dist/build//ghc-/Includes2-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html +Package coverage report written to /cov.dist/work/./dist/build//ghc-/I-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs index 24c1662c375..40079c0e787 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs @@ -1,6 +1,5 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 -- #6397 cabal "test" ["--enable-coverage", "includes2-test"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out index 12dc4aecc6c..e8f2fa18d85 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out @@ -1,25 +1,25 @@ # Setup configure -Configuring Includes2-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library postgresql in Installing internal library mysql in @@ -30,16 +30,16 @@ Installing library in Installing executable exe in Warning: The directory /setup-internal.cabal.dist/usr/bin is not in the system search path. # Setup register -Registering library 'postgresql' for Includes2-0.1.0.0... -Registering library 'mysql' for Includes2-0.1.0.0... +Registering library 'postgresql' for I-0.1.0.0... +Registering library 'mysql' for I-0.1.0.0... Registering library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Registering library for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Registering library for I-0.1.0.0... # exe "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out index 700f1b2fbfc..0cb3b8768c3 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out @@ -1,25 +1,25 @@ # Setup configure -Configuring Includes2-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... -Preprocessing library 'mylib' for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library postgresql in Installing internal library mysql in @@ -30,16 +30,16 @@ Installing library in Installing executable exe in Warning: The directory /setup-internal.dist/usr/bin is not in the system search path. # Setup register -Registering library 'postgresql' for Includes2-0.1.0.0... -Registering library 'mysql' for Includes2-0.1.0.0... +Registering library 'postgresql' for I-0.1.0.0... +Registering library 'mysql' for I-0.1.0.0... Registering library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-mysql:Database.MySQL -for Includes2-0.1.0.0... + Database = I-0.1.0.0-postgresql:Database.PostgreSQL +for I-0.1.0.0... Registering library 'mylib' instantiated with - Database = Includes2-0.1.0.0-postgresql:Database.PostgreSQL -for Includes2-0.1.0.0... -Registering library for Includes2-0.1.0.0... + Database = I-0.1.0.0-mysql:Database.MySQL +for I-0.1.0.0... +Registering library for I-0.1.0.0... # exe "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out index 36c406d8584..5fff9a72819 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out @@ -1,107 +1,107 @@ # Setup configure -Configuring library 'mylib' for Includes2-0.1.0.0... +Configuring library 'mylib' for I-0.1.0.0... # Setup build -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup haddock -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Running Haddock on library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/mylib +for I-0.1.0.0... +Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib # Setup copy Installing internal library mylib in # Setup register Registering library 'mylib' instantiated with Database = -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup configure -Configuring library 'mysql' for Includes2-0.1.0.0... +Configuring library 'mysql' for I-0.1.0.0... # Setup build -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Building library 'mysql' for Includes2-0.1.0.0... +Preprocessing library 'mysql' for I-0.1.0.0... +Building library 'mysql' for I-0.1.0.0... # Setup haddock -Preprocessing library 'mysql' for Includes2-0.1.0.0... -Running Haddock on library 'mysql' for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/mysql +Preprocessing library 'mysql' for I-0.1.0.0... +Running Haddock on library 'mysql' for I-0.1.0.0... +Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mysql # Setup copy Installing internal library mysql in # Setup register -Registering library 'mysql' for Includes2-0.1.0.0... +Registering library 'mysql' for I-0.1.0.0... # Setup configure -Configuring library 'postgresql' for Includes2-0.1.0.0... +Configuring library 'postgresql' for I-0.1.0.0... # Setup build -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Building library 'postgresql' for Includes2-0.1.0.0... +Preprocessing library 'postgresql' for I-0.1.0.0... +Building library 'postgresql' for I-0.1.0.0... # Setup haddock -Preprocessing library 'postgresql' for Includes2-0.1.0.0... -Running Haddock on library 'postgresql' for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/postgresql +Preprocessing library 'postgresql' for I-0.1.0.0... +Running Haddock on library 'postgresql' for I-0.1.0.0... +Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/postgresql # Setup copy Installing internal library postgresql in # Setup register -Registering library 'postgresql' for Includes2-0.1.0.0... +Registering library 'postgresql' for I-0.1.0.0... # Setup configure Configuring library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup haddock -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Running Haddock on library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/mylib +for I-0.1.0.0... +Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib # Setup copy Installing internal library mylib in # Setup register Registering library 'mylib' instantiated with Database = mysql-0.1.0.0:Database.MySQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup configure Configuring library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Building library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup haddock -Preprocessing library 'mylib' for Includes2-0.1.0.0... +Preprocessing library 'mylib' for I-0.1.0.0... Running Haddock on library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2/mylib +for I-0.1.0.0... +Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib # Setup copy Installing internal library mylib in # Setup register Registering library 'mylib' instantiated with Database = postgresql-0.1.0.0:Database.PostgreSQL -for Includes2-0.1.0.0... +for I-0.1.0.0... # Setup configure -Configuring library for Includes2-0.1.0.0... +Configuring library for I-0.1.0.0... # Setup build -Preprocessing library for Includes2-0.1.0.0... -Building library for Includes2-0.1.0.0... +Preprocessing library for I-0.1.0.0... +Building library for I-0.1.0.0... # Setup haddock -Preprocessing library for Includes2-0.1.0.0... -Running Haddock on library for Includes2-0.1.0.0... -Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/Includes2 +Preprocessing library for I-0.1.0.0... +Running Haddock on library for I-0.1.0.0... +Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I # Setup copy Installing library in # Setup register -Registering library for Includes2-0.1.0.0... +Registering library for I-0.1.0.0... # Setup configure -Configuring executable 'exe' for Includes2-0.1.0.0... +Configuring executable 'exe' for I-0.1.0.0... # Setup build -Preprocessing executable 'exe' for Includes2-0.1.0.0... -Building executable 'exe' for Includes2-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup haddock -Preprocessing executable 'exe' for Includes2-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... # Setup copy Installing executable exe in Warning: The directory /setup-per-component.dist/usr/bin is not in the system search path. diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs index 5bbb1b02af2..b6034011a14 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs @@ -14,6 +14,6 @@ main = setupTest $ do "--instantiate-with", "Database=mysql-0.1.0.0:Database.MySQL"] setup_install' ["mylib", "--cid", "mylib-0.1.0.0", "--instantiate-with", "Database=postgresql-0.1.0.0:Database.PostgreSQL"] - setup_install' ["Includes2"] + setup_install' ["I"] setup_install' ["exe"] runExe' "exe" [] >>= assertOutputContains "minemysql minepostgresql" diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal b/cabal-testsuite/PackageTests/Backpack/Includes3/I.cabal similarity index 95% rename from cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal rename to cabal-testsuite/PackageTests/Backpack/Includes3/I.cabal index 7016e221218..ca17845e21d 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/I.cabal @@ -1,4 +1,4 @@ -name: Includes3 +name: I version: 0.1.0.0 license: BSD3 author: Edward Z. Yang diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs index 80a4c47d068..6e6f017ee9f 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs @@ -1,9 +1,9 @@ import Test.Cabal.Prelude main = cabalTest $ do + ghcVer <- isGhcVersion ">= 9.10" skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 - withProjectFile "cabal.external.project" $ do + expectBrokenIf (isWindows && ghcVer) 10191 $ withProjectFile "cabal.external.project" $ do cabal "v2-build" ["exe"] withPlan $ do r <- runPlanExe' "exe" "exe" [] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out index 88b36e02c50..f7e2f2d75ef 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out @@ -2,27 +2,27 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - Includes3-0.1.0.0 (lib:sigs) (first run) - - Includes3-0.1.0.0 (lib:indef) (first run) - - Includes3-0.1.0.0 (lib:indef with Data.Map=containers-:Data.Map) (first run) - - Includes3-0.1.0.0 (exe:exe) (first run) -Configuring library 'sigs' for Includes3-0.1.0.0... -Preprocessing library 'sigs' for Includes3-0.1.0.0... + - I-0.1.0.0 (lib:sigs) (first run) + - I-0.1.0.0 (lib:indef) (first run) + - I-0.1.0.0 (lib:indef with Data.Map=containers-:Data.Map) (first run) + - I-0.1.0.0 (exe:exe) (first run) +Configuring library 'sigs' for I-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Configuring library 'indef' for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Configuring library 'indef' for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Configuring library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Configuring executable 'exe' for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... -# Includes3 exe +for I-0.1.0.0... +Configuring executable 'exe' for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... +# I exe fromList [(0,2),(2,4)] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs index b247e56259a..cca3ecf2954 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs @@ -2,9 +2,8 @@ import Test.Cabal.Prelude main = cabalTest $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 - withProjectFile "cabal.internal.project" $ do + expectBrokenIf isWindows 10191 $ withProjectFile "cabal.internal.project" $ do cabal "v2-build" ["exe"] withPlan $ do - r <- runPlanExe' "Includes3" "exe" [] + r <- runPlanExe' "I" "exe" [] assertOutputContains "fromList [(0,2),(2,4)]" r diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs index 00e2aff3c84..03b74a01b9a 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withProjectFile "cabal.repo.project" $ do withRepo "repo" $ do cabal "v2-build" ["exe"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out index ea300c9286d..9ac4463aa6e 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out @@ -1,18 +1,18 @@ # Setup configure -Configuring Includes3-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library sigs in Installing internal library indef in @@ -21,24 +21,24 @@ Installing executable exe in Warning: The directory /setup-internal.cabal.dist/usr/bin is not in the system search path. # Setup register Registering library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # exe fromList [(0,2),(2,4)] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out index cb9caef57a7..6912ab117cd 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out @@ -1,18 +1,18 @@ # Setup configure -Configuring Includes3-0.1.0.0... +Configuring I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # Setup copy Installing internal library sigs in Installing internal library indef in @@ -21,24 +21,24 @@ Installing executable exe in Warning: The directory /setup-internal.dist/usr/bin is not in the system search path. # Setup register Registering library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... +for I-0.1.0.0... Registering library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... +for I-0.1.0.0... # Setup build -Preprocessing library 'sigs' for Includes3-0.1.0.0... +Preprocessing library 'sigs' for I-0.1.0.0... Building library 'sigs' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = -for Includes3-0.1.0.0... -Preprocessing library 'indef' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing library 'indef' for I-0.1.0.0... Building library 'indef' instantiated with Data.Map = containers-:Data.Map -for Includes3-0.1.0.0... -Preprocessing executable 'exe' for Includes3-0.1.0.0... -Building executable 'exe' for Includes3-0.1.0.0... +for I-0.1.0.0... +Preprocessing executable 'exe' for I-0.1.0.0... +Building executable 'exe' for I-0.1.0.0... # exe fromList [(0,2),(2,4)] diff --git a/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs b/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs index 0a31702615c..930a61bb54e 100644 --- a/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude main = - cabalTest $ withShorterPathForNewBuildStore $ do + cabalTest $ expectBrokenIf isWindows 10191 $ withShorterPathForNewBuildStore $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 withRepo "repo" $ do cabal "v2-build" ["T6385"] diff --git a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/bkpcabal01.cabal b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/b.cabal similarity index 96% rename from cabal-testsuite/PackageTests/Backpack/bkpcabal01/bkpcabal01.cabal rename to cabal-testsuite/PackageTests/Backpack/bkpcabal01/b.cabal index f10d1aad151..f1e92112a1f 100644 --- a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/bkpcabal01.cabal +++ b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/b.cabal @@ -1,5 +1,5 @@ cabal-version: 2.0 -name: bkpcabal01 +name: b version: 0.1.0.0 description: This test also exists in GHC's test-suite under the same name and was ported over to cabal's testsuite as it exposed a diff --git a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out index 4630087ccc2..3ebec1cc5c1 100644 --- a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out @@ -2,33 +2,33 @@ Resolving dependencies... Build profile: -w ghc- -O1 In order, the following will be built: - - bkpcabal01-0.1.0.0 (lib:impl) (first run) - - bkpcabal01-0.1.0.0 (lib:p) (first run) - - bkpcabal01-0.1.0.0 (lib:p with H=bkpcabal01-0.1.0.0-inplace-impl:H) (first run) - - bkpcabal01-0.1.0.0 (lib:q) (first run) - - bkpcabal01-0.1.0.0 (lib:q with I=bkpcabal01-0.1.0.0-inplace-impl:I) (first run) - - bkpcabal01-0.1.0.0 (exe:exe) (first run) -Configuring library 'impl' for bkpcabal01-0.1.0.0... -Preprocessing library 'impl' for bkpcabal01-0.1.0.0... -Building library 'impl' for bkpcabal01-0.1.0.0... -Configuring library 'p' for bkpcabal01-0.1.0.0... -Preprocessing library 'p' for bkpcabal01-0.1.0.0... + - b-0.1.0.0 (lib:impl) (first run) + - b-0.1.0.0 (lib:p) (first run) + - b-0.1.0.0 (lib:p with H=b-0.1.0.0-inplace-impl:H) (first run) + - b-0.1.0.0 (lib:q) (first run) + - b-0.1.0.0 (lib:q with I=b-0.1.0.0-inplace-impl:I) (first run) + - b-0.1.0.0 (exe:exe) (first run) +Configuring library 'impl' for b-0.1.0.0... +Preprocessing library 'impl' for b-0.1.0.0... +Building library 'impl' for b-0.1.0.0... +Configuring library 'p' for b-0.1.0.0... +Preprocessing library 'p' for b-0.1.0.0... Building library 'p' instantiated with H = -for bkpcabal01-0.1.0.0... -Configuring library 'p' instantiated with H = bkpcabal01-0.1.0.0-inplace-impl:H -for bkpcabal01-0.1.0.0... -Preprocessing library 'p' for bkpcabal01-0.1.0.0... -Building library 'p' instantiated with H = bkpcabal01-0.1.0.0-inplace-impl:H -for bkpcabal01-0.1.0.0... -Configuring library 'q' for bkpcabal01-0.1.0.0... -Preprocessing library 'q' for bkpcabal01-0.1.0.0... +for b-0.1.0.0... +Configuring library 'p' instantiated with H = b-0.1.0.0-inplace-impl:H +for b-0.1.0.0... +Preprocessing library 'p' for b-0.1.0.0... +Building library 'p' instantiated with H = b-0.1.0.0-inplace-impl:H +for b-0.1.0.0... +Configuring library 'q' for b-0.1.0.0... +Preprocessing library 'q' for b-0.1.0.0... Building library 'q' instantiated with I = -for bkpcabal01-0.1.0.0... -Configuring library 'q' instantiated with I = bkpcabal01-0.1.0.0-inplace-impl:I -for bkpcabal01-0.1.0.0... -Preprocessing library 'q' for bkpcabal01-0.1.0.0... -Building library 'q' instantiated with I = bkpcabal01-0.1.0.0-inplace-impl:I -for bkpcabal01-0.1.0.0... -Configuring executable 'exe' for bkpcabal01-0.1.0.0... -Preprocessing executable 'exe' for bkpcabal01-0.1.0.0... -Building executable 'exe' for bkpcabal01-0.1.0.0... +for b-0.1.0.0... +Configuring library 'q' instantiated with I = b-0.1.0.0-inplace-impl:I +for b-0.1.0.0... +Preprocessing library 'q' for b-0.1.0.0... +Building library 'q' instantiated with I = b-0.1.0.0-inplace-impl:I +for b-0.1.0.0... +Configuring executable 'exe' for b-0.1.0.0... +Preprocessing executable 'exe' for b-0.1.0.0... +Building executable 'exe' for b-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs index 5a30f6a867a..0f1b7544e07 100644 --- a/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.test.hs @@ -1,6 +1,6 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do + cabalTest $ do -- GHC 8.2.2 had a regression ("unknown package: hole"), see also #4908 skipUnlessGhcVersion ">= 8.2 && <8.2.2 || >8.2.2" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 cabal "v2-build" ["all"] diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs b/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs index eae7f4476f3..45fc0ecfe9e 100644 --- a/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs @@ -1,4 +1,9 @@ +{-# LANGUAGE CPP #-} +#if mingw32_HOST_OS +{-# OPTIONS_GHC -F -pgmF my-foreign-preprocessor.bat #-} +#else {-# OPTIONS_GHC -F -pgmF my-foreign-preprocessor #-} +#endif module A where a :: String diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat new file mode 100644 index 00000000000..51e58f1b40c --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.bat @@ -0,0 +1,2 @@ +echo @off +pwsh my-foreign-preprocessor.ps1 %1 %2 %3 diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 new file mode 100644 index 00000000000..1bb89bcc1b8 --- /dev/null +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor.ps1 @@ -0,0 +1 @@ +get-content $args[1] | %{$_ -replace "0","1"} > $args[2] diff --git a/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs b/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs index 9860683f7b0..b698f579f93 100644 --- a/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs +++ b/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs @@ -5,9 +5,7 @@ import Control.Monad.IO.Class import System.Environment -- Test PATH-munging --- TODO: Enable this test on Windows main = setupAndCabalTest $ do - skipIfWindows path <- liftIO $ getEnv "PATH" cwd <- testCurrentDir <$> getTestEnv r <- withEnv [("PATH", Just $ cwd ++ ":" ++ path)] $ setup_build [] diff --git a/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs b/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs index b4f7f04ddb1..7cdb7c75287 100644 --- a/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs +++ b/cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs @@ -9,13 +9,12 @@ import Test.Cabal.Prelude -- https://gitlab.haskell.org/ghc/ghc/-/commit/8ff3134ed4aa323b0199ad683f72165e51a59ab6 main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.8" - isWin <- isWindows ghc94 <- isGhcVersion ">= 9.4.1" env <- getTestEnv let pwd = testCurrentDir env win_suffix = if ghc94 then "-clang.bat" else ".bat" customCC = - pwd ++ "/custom-cc" ++ if isWin then win_suffix else "" + pwd ++ "/custom-cc" ++ if isWindows then win_suffix else "" setup "configure" [ "--ghc-option=-optc=-DNOERROR2" diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs index 2201d7c73dc..12398950ed9 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.test.hs @@ -3,11 +3,12 @@ import Test.Cabal.Prelude import System.Directory (createDirectoryIfMissing) -- Invalid Windows filepath. -main = cabalTest $ do - skipIfWindows - cwd <- testCurrentDir <$> getTestEnv - liftIO $ createDirectoryIfMissing False $ cwd "n?ul" - liftIO $ writeFile (cwd "n?ul" "test.a") "" - -- A directory named like `n?ul` on Windows will make external - -- tools like git — and hence the whole testsuite — error. - fails $ cabal "check" [] +main = do + -- A directory named like `n?ul` on Windows will make external + -- tools like git — and hence the whole testsuite — error. + skipIfWindows "uninteresting" + cabalTest $ do + cwd <- testCurrentDir <$> getTestEnv + liftIO $ createDirectoryIfMissing False $ cwd "n?ul" + liftIO $ writeFile (cwd "n?ul" "test.a") "" + fails $ cabal "check" [] diff --git a/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs b/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs index ee8aa155ac2..0e39257c843 100644 --- a/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs +++ b/cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude main = cabalTest $ do - skipIfWindows + skipIfNoSharedLibraries res <- cabal' "v2-run" ["demo"] assertOutputContains "= Post common block elimination =" res assertOutputContains "In Box we have 0x" res diff --git a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs index f0ba4299c7a..c1aea47ce85 100644 --- a/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs +++ b/cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs @@ -1,5 +1,8 @@ import Test.Cabal.Prelude +normalizeWindowsOutput :: String -> String +normalizeWindowsOutput = if isWindows then map (\x -> case x of '/' -> '\\'; _ -> x) else id + main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do let log = recordHeader . pure @@ -76,7 +79,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do -- +-- etc log "checking that cyclical check catches a same file name that imports itself" cyclical4a <- fails $ cabal' "v2-build" [ "--project-file=cyclical-same-filename-out-out-self.project" ] - assertOutputContains "cyclical import of same-filename/cyclical-same-filename-out-out-self.config" cyclical4a + assertOutputContains (normalizeWindowsOutput "cyclical import of same-filename/cyclical-same-filename-out-out-self.config") cyclical4a -- +-- cyclical-same-filename-out-out-backback.project -- +-- cyclical-same-filename-out-out-backback.config @@ -112,31 +115,31 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do assertOutputContains "- hops-0.project" hopping assertOutputContains - "- hops-2.config \ + (normalizeWindowsOutput "- hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops-4.config \ + (normalizeWindowsOutput "- hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops-6.config \ + (normalizeWindowsOutput "- hops-6.config \ \ imported by: hops/hops-5.config \ \ imported by: hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops-8.config \ + (normalizeWindowsOutput "- hops-8.config \ \ imported by: hops/hops-7.config \ \ imported by: hops-6.config \ \ imported by: hops/hops-5.config \ @@ -144,43 +147,43 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-1.config \ - \ imported by: hops-0.project" + (normalizeWindowsOutput "- hops/hops-1.config \ + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-3.config \ + (normalizeWindowsOutput "- hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-5.config \ + (normalizeWindowsOutput "- hops/hops-5.config \ \ imported by: hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-7.config \ + (normalizeWindowsOutput "- hops/hops-7.config \ \ imported by: hops-6.config \ \ imported by: hops/hops-5.config \ \ imported by: hops-4.config \ \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping assertOutputContains - "- hops/hops-9.config \ + (normalizeWindowsOutput "- hops/hops-9.config \ \ imported by: hops-8.config \ \ imported by: hops/hops-7.config \ \ imported by: hops-6.config \ @@ -189,7 +192,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do \ imported by: hops/hops-3.config \ \ imported by: hops-2.config \ \ imported by: hops/hops-1.config \ - \ imported by: hops-0.project" + \ imported by: hops-0.project") hopping -- The project is named oops as it is like hops but has conflicting constraints. @@ -210,7 +213,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do assertOutputContains "(constraint from oops-0.project requires ==1.4.3.0)" oopsing assertOutputContains - " (constraint from oops/oops-9.config requires ==1.4.2.0) \ + (normalizeWindowsOutput " (constraint from oops/oops-9.config requires ==1.4.2.0) \ \ imported by: oops-8.config \ \ imported by: oops/oops-7.config \ \ imported by: oops-6.config \ @@ -219,7 +222,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do \ imported by: oops/oops-3.config \ \ imported by: oops-2.config \ \ imported by: oops/oops-1.config \ - \ imported by: oops-0.project" + \ imported by: oops-0.project") oopsing log "checking bad conditional" @@ -229,12 +232,12 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do log "checking that missing package message lists configuration provenance" missing <- fails $ cabal' "v2-build" [ "--project-file=cabal-missing-package.project" ] assertOutputContains - "When using configuration from: \ + (normalizeWindowsOutput "When using configuration from: \ \ - cabal-missing-package.project \ \ - missing/pkgs.config \ \ - missing/pkgs/default.config \ \The following errors occurred: \ - \ - The package location 'pkg-doesnt-exist' does not exist." + \ - The package location 'pkg-doesnt-exist' does not exist.") missing return () diff --git a/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs b/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs index a6c74dab745..b543cc5de45 100644 --- a/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs +++ b/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs @@ -1,6 +1,5 @@ import Test.Cabal.Prelude main = cabalTest $ do - -- TODO: this test ought to work on Windows too - skipUnless "not Linux" =<< isLinux + skipUnless "depends on `unix` and needs Linux" isLinux skipUnlessGhcVersion ">= 7.8" fails $ cabal' "v2-build" [] >>= assertOutputContains "SIGSEGV" diff --git a/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs b/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs index 80ee56f6287..ecc6696c1f2 100644 --- a/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs +++ b/cabal-testsuite/PackageTests/ExtraProgPath/setup.test.hs @@ -1,8 +1,8 @@ import Test.Cabal.Prelude -- Test that extra-prog-path overrides the path for pkg-config -main = cabalTest $ do - -- skipped on windows because using a script to dummy up an executable doesn't work the same. - skipIfWindows - cdir <- testCurrentDir `fmap` getTestEnv - fails $ cabal "v2-build" ["--extra-prog-path="++cdir] +main = do + skipIfWindows "useless test (CI has no pkg-config already)" + cabalTest $ do + cdir <- testCurrentDir `fmap` getTestEnv + fails $ cabal "v2-build" ["--extra-prog-path="++cdir] diff --git a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs index 1dcf918eaed..73d02e90987 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs +++ b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs @@ -27,9 +27,8 @@ import Test.Cabal.Prelude main = setupAndCabalTest . recordMode DoNotRecord $ do -- Foreign libraries don't work with GHC 7.6 and earlier skipUnlessGhcVersion ">= 7.8" - win <- isWindows ghc94 <- isGhcVersion ">= 9.4.1" - expectBrokenIf (win && ghc94) 8451 $ + expectBrokenIf (isWindows && ghc94) 8451 $ withPackageDb $ do setup_install [] setup "copy" [] -- regression test #4156 diff --git a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs index fd7328da0c2..18fa0d364fe 100644 --- a/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs +++ b/cabal-testsuite/PackageTests/GHCJS/BuildRunner/cabal.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude -main = cabalTest . recordMode DoNotRecord $ do - skipIfWindows -- disabled because (I presume) Windows doesn't have BASH +main = do + cabalTest . expectBrokenIf isWindows 10179 . recordMode DoNotRecord $ do cwd <- fmap testCurrentDir getTestEnv testInvokedWithBuildRunner cwd "test" [] testInvokedWithBuildRunner cwd "run" ["ghcjs-exe"] diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs index 85b30b87523..0f0e86a3c60 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs @@ -1,10 +1,9 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows -main = setupAndCabalTest $ do - skipIfWindows - env <- getTestEnv - let cwd = testCurrentDir env - ghc_path <- programPathM ghcProgram - r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc"] - assertOutputContains "is version 9999999" r + +main = setupAndCabalTest $ expectBrokenIf isWindows 10179 $ do + env <- getTestEnv + let cwd = testCurrentDir env + ghc_path <- programPathM ghcProgram + r <- withEnv [("WITH_GHC", Just ghc_path)] + . fails $ setup' "configure" ["-w", cwd "ghc"] + assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs index 746c8015fca..20a661437bf 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs @@ -1,10 +1,9 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows -main = setupAndCabalTest $ do - skipIfWindows - env <- getTestEnv - let cwd = testCurrentDir env - ghc_path <- programPathM ghcProgram - r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc-7.10"] - assertOutputContains "is version 9999999" r + +main = setupAndCabalTest $ expectBrokenIf isWindows 10179 $ do + env <- getTestEnv + let cwd = testCurrentDir env + ghc_path <- programPathM ghcProgram + r <- withEnv [("WITH_GHC", Just ghc_path)] + . fails $ setup' "configure" ["-w", cwd "ghc-7.10"] + assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs index 746c8015fca..20a661437bf 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs @@ -1,10 +1,9 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows -main = setupAndCabalTest $ do - skipIfWindows - env <- getTestEnv - let cwd = testCurrentDir env - ghc_path <- programPathM ghcProgram - r <- withEnv [("WITH_GHC", Just ghc_path)] - . fails $ setup' "configure" ["-w", cwd "ghc-7.10"] - assertOutputContains "is version 9999999" r + +main = setupAndCabalTest $ expectBrokenIf isWindows 10179 $ do + env <- getTestEnv + let cwd = testCurrentDir env + ghc_path <- programPathM ghcProgram + r <- withEnv [("WITH_GHC", Just ghc_path)] + . fails $ setup' "configure" ["-w", cwd "ghc-7.10"] + assertOutputContains "is version 9999999" r diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs index eab35100802..18cb32829b1 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows -main = setupAndCabalTest $ do - skipIfWindows + +main = setupAndCabalTest $ expectBrokenIf isWindows 10179 $ do withSymlink "bin/ghc" "ghc" $ do env <- getTestEnv let cwd = testCurrentDir env diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs index eb95044b941..7837f5f9f3b 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows -main = setupAndCabalTest $ do - skipIfWindows + +main = setupAndCabalTest $ expectBrokenIf isWindows 10179 $ do withSymlink "bin/ghc-7.10" "ghc" $ do env <- getTestEnv let cwd = testCurrentDir env diff --git a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs index eb95044b941..7837f5f9f3b 100644 --- a/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs +++ b/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs @@ -1,7 +1,6 @@ import Test.Cabal.Prelude --- TODO: Enable this test on Windows -main = setupAndCabalTest $ do - skipIfWindows + +main = setupAndCabalTest $ expectBrokenIf isWindows 10179 $ do withSymlink "bin/ghc-7.10" "ghc" $ do env <- getTestEnv let cwd = testCurrentDir env diff --git a/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs b/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs index 9a3dfe1777b..a4db6795625 100644 --- a/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs +++ b/cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.test.hs @@ -1,20 +1,21 @@ {-# LANGUAGE LambdaCase #-} import Test.Cabal.Prelude +import Data.List (sort) import Distribution.Verbosity import Distribution.Simple.Glob import Distribution.Simple.Glob.Internal +import Distribution.Simple.Utils -- Test that "cabal haddock" preserves temporary files -- We use haddock-keep-temp-file: True in the cabal.project. -main = cabalTest $ recordMode DoNotRecord $ do - skipIfWindows +main = cabalTest $ recordMode DoNotRecord $ withProjectFile "cabal.project" $ do + cabal "haddock" [] - cabal "haddock" [] + cwd <- fmap testCurrentDir getTestEnv - cwd <- fmap testCurrentDir getTestEnv - - (globMatches <$> liftIO (runDirFileGlob silent Nothing cwd (GlobDirRecursive [WildCard, Literal "response", WildCard, Literal "txt"]))) >>= \case - [] -> error "Expecting a response file to exist" - (m:_) -> - -- Assert the matched response file is not empty. - assertFileDoesContain (cwd m) "Simple.hs" + -- Windows has multiple response files, and only the last one (alphabetically) is the important one. + (safeLast . sort . globMatches <$> liftIO (runDirFileGlob silent Nothing cwd (GlobDirRecursive [WildCard, Literal "txt"]))) >>= \case + Nothing -> error "Expecting a response file to exist" + Just m -> do + -- Assert the matched response file is not empty, and indeed a haddock rsp + assertFileDoesContain (cwd m) "--package-name" diff --git a/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs b/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs index e84be709823..1c12fd03a7a 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs +++ b/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs @@ -24,7 +24,7 @@ import System.Directory -- this does build shared libraries just to make sure they -- don't get installed, so this test doesn't work on Windows.) main = setupAndCabalTest $ do - skipUnless "no shared libs" =<< hasSharedLibraries + skipIfNoSharedLibraries withPackageDb $ do -- MULTI forM_ [False, True] $ \is_dynamic -> do diff --git a/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs b/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs index 644d437b8ab..ada96fc159a 100644 --- a/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs +++ b/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs @@ -1,13 +1,12 @@ import Test.Cabal.Prelude -- Test to see if --gen-script main = setupAndCabalTest $ do - is_windows <- isWindows withPackageDb $ do withDirectory "p" $ do setup_build [] setup "copy" [] setup "register" ["--gen-script"] - _ <- if is_windows + _ <- if isWindows then shell "cmd" ["/C", "register.bat"] else shell "sh" ["register.sh"] return () diff --git a/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs index 1fed749bdb8..2b318af6670 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs @@ -1,9 +1,9 @@ import Test.Cabal.Prelude -main = setupAndCabalTest $ do - skipUnlessGhcVersion ">= 9.6" +main = do skipUnlessJavaScript - skipIfWindows - - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello JS!" res + skipIfWindows "" + setupAndCabalTest $ do + skipUnlessGhcVersion ">= 9.6" + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs index 187a9cf73bd..2e92eb1fcc5 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/other-arch.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do skipIfJavaScript - -- Ensure the field `js-sources` does not raise issues - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello Not JS!" res + cabalTest $ do + -- Ensure the field `js-sources` does not raise issues + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello Not JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs index 1fed749bdb8..2b318af6670 100644 --- a/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSourcesExe/js-arch.test.hs @@ -1,9 +1,9 @@ import Test.Cabal.Prelude -main = setupAndCabalTest $ do - skipUnlessGhcVersion ">= 9.6" +main = do skipUnlessJavaScript - skipIfWindows - - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello JS!" res + skipIfWindows "" + setupAndCabalTest $ do + skipUnlessGhcVersion ">= 9.6" + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello JS!" res diff --git a/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs index 187a9cf73bd..2e92eb1fcc5 100644 --- a/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSourcesExe/other-arch.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do +main = do skipIfJavaScript - -- Ensure the field `js-sources` does not raise issues - res <- cabal' "v2-run" ["demo"] - assertOutputContains "Hello Not JS!" res + cabalTest $ do + -- Ensure the field `js-sources` does not raise issues + res <- cabal' "v2-run" ["demo"] + assertOutputContains "Hello Not JS!" res diff --git a/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs b/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs index 8e7c8a6391d..55ec5ee6144 100644 --- a/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs +++ b/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs @@ -52,14 +52,7 @@ lrun :: [Linking] lrun = [Static, Dynamic, Static, Dynamic] main = cabalTest $ do - -- Skip if on Windows, since my default Chocolatey Windows setup (and the CI - -- server setup at the time, presumably) lacks support for dynamic builds - -- since the base package appears to be static only, lacking e.g. ‘.dyn_o’ - -- files. Normal Windows installations would need support for dynamic - -- builds, or else this test would fail when it tries to build with the - -- dynamic flags. - skipIfWindows - + skipIfNoSharedLibraries env <- getTestEnv withPackageDb $ do -- Phase 1: get 4 hashes according to config flags. diff --git a/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs index a46921de895..233d3b20736 100644 --- a/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs +++ b/cabal-testsuite/PackageTests/LinkerOptions/T7339/setup.test.hs @@ -18,8 +18,7 @@ import Test.Cabal.Prelude main = setupTest $ do - - skipIfWindows + skipIfNoSharedLibraries skipUnlessGhcVersion ">= 8.4" withPackageDb $ do @@ -59,9 +58,9 @@ main = setupTest $ do pkgDb <- testPackageDbDir <$> getTestEnv ghciScript <- liftIO $ readFile (cwd "T19350.script") _ <- runProgramM ghcProgram - [ "--interactive" - , "-package", "T7339" - , "-package-db", pkgDb - ] (Just ghciScript) + [ "--interactive" + , "-package", "T7339" + , "-package-db", pkgDb + ] (Just ghciScript) return () diff --git a/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs b/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs index 7ea2f71ea49..5a8434c5467 100644 --- a/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs +++ b/cabal-testsuite/PackageTests/MultiRepl/EnabledSucc/cabal.test.hs @@ -3,6 +3,5 @@ import Test.Cabal.Prelude main = do cabalTest $ do skipUnlessGhcVersion ">= 9.4" - skipIfWindows -- heisenbug, see #9103 res <- cabalWithStdin "v2-repl" ["--enable-multi-repl","pkg-b", "pkg-a"] "Bar.bar" assertOutputContains "3735929054" res diff --git a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs index 44f88c26656..8c3277174b8 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CmdRun/Terminate/cabal.test.hs @@ -17,36 +17,36 @@ without forking in the future.) -} main :: IO () -main = cabalTest $ do - skipIfWindows -- test project relies on Posix +main = do + skipIfWindows "depends on `unix`" + cabalTest $ do + -- timestamped logging to aid with #8416 + let logIO msg = do + ts <- Time.getCurrentTime + let tsfmt = Time.formatTime Time.defaultTimeLocale "%H:%M:%S.%q" ts + putStrLn $ tsfmt <> " [cabal.test] " <> msg + log = liftIO . logIO - -- timestamped logging to aid with #8416 - let logIO msg = do - ts <- Time.getCurrentTime - let tsfmt = Time.formatTime Time.defaultTimeLocale "%H:%M:%S.%q" ts - putStrLn $ tsfmt <> " [cabal.test] " <> msg - log = liftIO . logIO + dir <- fmap testCurrentDir getTestEnv + let runFile = dir "exe.run" + liftIO $ removeFile runFile `catchNoExist` return () - dir <- fmap testCurrentDir getTestEnv - let runFile = dir "exe.run" - liftIO $ removeFile runFile `catchNoExist` return () + log "about to v2-build" + cabal_raw_action ["v2-build", "exe"] (\_ -> return ()) + log "about to v2-run" + r <- fails $ cabal_raw_action ["v2-run", "exe"] $ \cabalHandle -> do + -- wait for "cabal run" to have started "exe" + logIO "about to wait for file" + waitFile total runFile + -- then kill "cabal run" + logIO "about to terminate cabal" + Process.terminateProcess cabalHandle + log "v2-run done" - log "about to v2-build" - cabal_raw_action ["v2-build", "exe"] (\_ -> return ()) - log "about to v2-run" - r <- fails $ cabal_raw_action ["v2-run", "exe"] $ \cabalHandle -> do - -- wait for "cabal run" to have started "exe" - logIO "about to wait for file" - waitFile total runFile - -- then kill "cabal run" - logIO "about to terminate cabal" - Process.terminateProcess cabalHandle - log "v2-run done" - - -- "exe" should exit, and should have been interrupted before - -- finishing its sleep - assertOutputContains "exiting" r - assertOutputDoesNotContain "done sleeping" r + -- "exe" should exit, and should have been interrupted before + -- finishing its sleep + assertOutputContains "exiting" r + assertOutputDoesNotContain "done sleeping" r where catchNoExist action handle = diff --git a/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs b/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs index f3774f78cd7..114d3487e8e 100644 --- a/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs @@ -2,11 +2,7 @@ import Test.Cabal.Prelude -- The one local package, pkg, has a dependency on remote-pkg-2.0, which has a -- setup dependency on remote-setup-dep-3.0. -main = - cabalTest $ withShorterPathForNewBuildStore $ do - - -- TODO: Debug this failure on Windows. - skipIfWindows +main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnless "no v2-build compatible boot-Cabal" =<< hasNewBuildCompatBootCabal withRepo "repo" $ do diff --git a/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs b/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs index f418538b074..93d28460c83 100644 --- a/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs +++ b/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs @@ -1,6 +1,4 @@ import Test.Cabal.Prelude main = cabalTest $ do - linux <- isLinux - osx <- isOSX - skipIf "8032 heisenbug profiling" (linux || osx) + skipIf "8032 heisenbug profiling" (isLinux || isOSX) cabal "v2-build" ["exe:q"] diff --git a/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs b/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs index f4c629a9329..e4aa4f2393a 100644 --- a/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs +++ b/cabal-testsuite/PackageTests/NewFreeze/T9799b/src/None.hs @@ -3,8 +3,11 @@ module None where import MyLib import Language.Haskell.TH +import System.IO $(do - runIO $ putStrLn $ "Building: " ++ renamedVers + runIO $ do + putStrLn $ "Building: " ++ renamedVers + hFlush stdout [d| x = () |] ) diff --git a/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs b/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs index 7c9617a623c..00dc5c17ba6 100644 --- a/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs +++ b/cabal-testsuite/PackageTests/OfflineFlag/offlineFlag.test.hs @@ -3,7 +3,6 @@ import Test.Cabal.Prelude main = cabalTest $ withShorterPathForNewBuildStore $ do skipUnlessGhcVersion ">= 8.1" - skipIfWindows withProjectFile "cabal.repo.project" $ do withRepo "repo" $ do fails $ cabal "v2-build" ["current", "--offline"] diff --git a/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs b/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs index ea88c7f9e41..fab6c7c0a06 100644 --- a/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs +++ b/cabal-testsuite/PackageTests/PathsModule/Executable-Relocatable/setup.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -- Test that Paths module is generated and usable when relocatable is turned on. -main = setupAndCabalTest $ do - skipIfWindows - skipUnlessGhcVersion ">= 8.0" - withPackageDb $ setup_build ["--enable-relocatable"] +main = do + skipIfWindows "no relocatable builds" + setupAndCabalTest $ do + skipUnlessGhcVersion ">= 8.0" + withPackageDb $ setup_build ["--enable-relocatable"] diff --git a/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs b/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs index 0f860ab637a..7ccdfca1655 100644 --- a/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs +++ b/cabal-testsuite/PackageTests/PkgConfigParse/setup.test.hs @@ -1,9 +1,7 @@ import Test.Cabal.Prelude -- Test that invalid unicode in pkg-config output doesn't trip up cabal very much -main = cabalTest $ do - -- skipped on windows because using a script to dummy up an executable doesn't work the same. - skipIfWindows +main = cabalTest $ expectBrokenIf isWindows 10179 $ do cdir <- testCurrentDir `fmap` getTestEnv res <- cabal' "v2-build" ["--extra-prog-path="++cdir, "-v2"] assertOutputContains "Some pkg-config packages have names containing invalid unicode: or" res diff --git a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal index 6d195b52b44..a1f30e58d6c 100644 --- a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal +++ b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/my.cabal @@ -11,4 +11,3 @@ executable my-executable main-is: Main.hs build-depends: base other-modules: Foo - hsc2hs-options: "--cc=g++" diff --git a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs index 8dfca6d7d52..eb3a5eb255e 100644 --- a/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs +++ b/cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/setup.test.hs @@ -5,24 +5,34 @@ import System.Directory (findExecutable) -- Check that preprocessors (hsc2hs) are run main = setupAndCabalTest $ do - -- we need "g++" - hasGxx <- liftIO $ fmap isJust $ findExecutable "g++" - skipUnless "g++" hasGxx - - -- Figure out how recent GHC we need - -- https://github.com/msys2/MINGW-packages/issues/3531 - skipIfWindows + -- we need "g++" (or "clang++" in newer Windows) + ghcVer <- isGhcVersion ">= 9.4" + cc <- if isWindows + then + -- The mingw tools distributed with GHC are not usually on the + -- path so we specify the path to cc directly. + joinPath + . (++ ["mingw", "bin", if ghcVer then "clang++.exe" else "g++.exe"]) + . init + . splitPath + . resultOutput + <$> runProgramM ghcProgram ["--print-libdir"] Nothing + else do + hasGxx <- liftIO $ fmap isJust $ findExecutable "g++" + skipUnless "g++" hasGxx + pure "g++" -- we need recent enough hsc2hs -- hsc2hs commit 9671202c11f7fe98e5b96d379532b6f691dc46dd -- Fix when using g++ as C compiler. Patch from elaforge. Fixes ghc #7232 + -- We also require 0.68.8 so that last --cc is the one that applies. p <- requireProgramM hsc2hsProgram case programVersion p of - Nothing -> skip "Unknown hsc2hs version" - Just v | v < mkVersion [0,68] -> skip $ "hsc2hs version: " ++ prettyShow v ++ " < 0.68" - _ -> return () + Nothing -> skip "Unknown hsc2hs version" + Just v | v < mkVersion [0,68,8] -> skip $ "hsc2hs version: " ++ prettyShow v ++ " < 0.68.8" + _ -> return () -- Actual test - setup_build [] + setup_build ["--hsc2hs-options=\"--cc=" <> cc <> "\""] r <- runExe' "my-executable" [] assertOutputContains "Is not C, is C++" r diff --git a/cabal-testsuite/PackageTests/ProfShared/setup.test.hs b/cabal-testsuite/PackageTests/ProfShared/setup.test.hs index 754ff7a290d..84fcbd47e57 100644 --- a/cabal-testsuite/PackageTests/ProfShared/setup.test.hs +++ b/cabal-testsuite/PackageTests/ProfShared/setup.test.hs @@ -8,11 +8,9 @@ data BuildWay = StaticWay | DynWay | ProfWay | ProfDynWay -- Test building with profiling shared support main = do setupTest $ recordMode DoNotRecord $ do - has_prof_shared <- hasProfiledSharedLibraries - has_shared <- hasSharedLibraries -- Tests are not robust against missing dynamic libraries yet. Would -- be better to fix this. - skipUnless "Missing shared libraries" has_shared + skipIfNoSharedLibraries let analyse_result expected r = do @@ -142,4 +140,3 @@ main = do run_cabal_test ["--enable-profiling", "--enable-executable-dynamic"] ([ProfDynWay, ProfWay, DynWay, StaticWay], [ProfDynWay]) run_cabal_test ["prof-shared", "--disable-library-profiling", "--enable-profiling", "--enable-executable-dynamic"] ([ProfDynWay, DynWay, StaticWay], []) - diff --git a/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs b/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs index 31309a46f0c..bbc850992fa 100644 --- a/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs +++ b/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs @@ -1,5 +1,5 @@ import Test.Cabal.Prelude -- Test building a dynamic library/executable which uses QuasiQuotes main = setupAndCabalTest $ do - skipUnless "no shared libs" =<< hasSharedLibraries + skipIfNoSharedLibraries setup_build ["--enable-shared", "--enable-executable-dynamic"] diff --git a/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs index 0ec5d068147..d6034c7c3f2 100644 --- a/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs @@ -1,16 +1,15 @@ import Test.Cabal.Prelude -- Test that we don't accidentally add the inplace directory to --- an executable RPATH. Don't test on Windows, which doesn't --- support RPATH. -main = setupAndCabalTest $ do - skipIfWindows - osx <- isOSX - ghc <- isGhcVersion ">= 8.10.7" - expectBrokenIf (osx && ghc) 7610 $ do -- see also issue #7988 - setup "configure" ["--enable-executable-dynamic"] - setup "build" [] - -- This should fail as it we should NOT be able to find the - -- dynamic library for the internal library (since we didn't - -- install it). If we incorrectly encoded our local dist - -- dir in the RPATH, this will succeed. - recordMode DoNotRecord . fails $ runExe "exe" [] +-- an executable RPATH. +main = do + skipIfWindows "doesn't support RPATH" + setupAndCabalTest $ do + ghc <- isGhcVersion ">= 8.10.7" + expectBrokenIf (isOSX && ghc) 7610 $ do -- see also issue #7988 + setup "configure" ["--enable-executable-dynamic"] + setup "build" [] + -- This should fail as it we should NOT be able to find the + -- dynamic library for the internal library (since we didn't + -- install it). If we incorrectly encoded our local dist + -- dir in the RPATH, this will succeed. + recordMode DoNotRecord . fails $ runExe "exe" [] diff --git a/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs index 258dcc21e16..bd227b75f3e 100644 --- a/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs @@ -4,10 +4,9 @@ import Test.Cabal.Prelude -- See https://github.com/haskell/cabal/issues/4270 main = setupAndCabalTest $ do skipIfAllCabalVersion "< 2.2" - skipUnless "no shared libs" =<< hasSharedLibraries + skipIfNoSharedLibraries skipUnless "no shared Cabal" =<< hasCabalShared ghc <- isGhcVersion "== 8.0.2" - osx <- isOSX - expectBrokenIf (osx && ghc) 8028 $ do + expectBrokenIf (isOSX && ghc) 8028 $ do setup_build ["--enable-tests", "--enable-executable-dynamic"] setup "test" [] diff --git a/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs b/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs index a6eb9844785..f5152c93ccb 100644 --- a/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T4291/setup.test.hs @@ -3,15 +3,16 @@ import Test.Cabal.Prelude -- Test that checkRelocate doesn't fail when library directory of dependee -- contains '..' -main = setupAndCabalTest $ withPackageDb $ do - skipIfWindows - skipUnlessGhcVersion ">= 7.6" - env <- getTestEnv - let pkgroot = takeDirectory $ testPackageDbDir env - prefix = testTmpDir env "prefix" - assertBool "we need a prefix that is not under pkgroot for this test" $ - not $ pkgroot `isPrefixOf` prefix - withDirectory "dependee" $ - setup_install ["--enable-relocatable", "--prefix", prefix] - withDirectory "depender" $ - setup_install ["--enable-relocatable", "--prefix", prefix] +main = do + skipIfWindows "no relocatable builds" + setupAndCabalTest $ withPackageDb $ do + skipUnlessGhcVersion ">= 7.6" + env <- getTestEnv + let pkgroot = takeDirectory $ testPackageDbDir env + prefix = testTmpDir env "prefix" + assertBool "we need a prefix that is not under pkgroot for this test" $ + not $ pkgroot `isPrefixOf` prefix + withDirectory "dependee" $ + setup_install ["--enable-relocatable", "--prefix", prefix] + withDirectory "depender" $ + setup_install ["--enable-relocatable", "--prefix", prefix] diff --git a/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs index a81a75197f3..e64f2e36951 100644 --- a/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T5309/cabal.test.hs @@ -1,6 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 - cabal "v2-build" ["all"] - cabal "v2-test" ["all"] - cabal "v2-bench" ["all"] +main = do + cabalTest $ do + ghcVer <- isGhcVersion ">= 9.4" + expectBrokenIf (isWindows && ghcVer) 10189 $ do + cabal "v2-build" ["all"] + cabal "v2-test" ["all"] + cabal "v2-bench" ["all"] diff --git a/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs index 27edba49486..a8ea261289a 100644 --- a/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T5677/cabal.test.hs @@ -2,5 +2,4 @@ import Test.Cabal.Prelude main = cabalTest $ do -- -Wmissing-export-lists is new in 8.4. skipUnlessGhcVersion ">= 8.3" - skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271 cabal "v2-build" ["all"] diff --git a/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs b/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs index 233f4a2a3d1..fabfcbdbede 100644 --- a/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs +++ b/cabal-testsuite/PackageTests/Regression/T6906/cabal.test.hs @@ -1,9 +1,8 @@ import Test.Cabal.Prelude main = cabalTest $ do - win <- isWindows ghcsWithMaxPathIssue <- isGhcVersion "< 8.6.5" - expectBrokenIf (win && ghcsWithMaxPathIssue) 6271 $ do + expectBrokenIf (isWindows && ghcsWithMaxPathIssue) 6271 $ do res <- recordMode DoNotRecord $ cabalG' ["--config=cabal.config"] "v2-install" ["-v3"] assertOutputContains "creating file with the inputs used to compute the package hash:" res assertOutputContains "extra-lib-dirs: bar" res diff --git a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs index 14f12247548..c62f83385a3 100644 --- a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs +++ b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal-with-hpc.multitest.hs @@ -9,8 +9,8 @@ import qualified Distribution.Verbosity as Verbosity import Test.Cabal.Prelude main = cabalTest $ do - skipIf "osx" =<< isOSX -- TODO: re-enable this once the macOS CI - -- issues are resolved, see discussion in #4902. + skipIf "osx" isOSX -- TODO: re-enable this once the macOS CI + -- issues are resolved, see discussion in #4902. hasShared <- hasSharedLibraries hasProfiled <- hasProfiledLibraries diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs index 710878ce1f0..e05f52953f5 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-copy.test.hs @@ -1,14 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ withShorterPathForNewBuildStore $ do - storeDir <- testStoreDir <$> getTestEnv - let options = ["--installdir=" ++ storeDir] - -- Use install method copy that should surely work on Windows too but our - -- path normalization for testing is not good enough yet as can be seen in - -- this CI failure snippet diff: - -- -Warning: The directory /ghc-/incoming/new-/ghc-/-/bin is not in the system search path. - -- -Copying 'warn-early-overwrite' to '/warn-early-overwrite' - -- +Warning: The directory /incoming/new-2448/Users/RUNNER~1/AppData/Local/Temp/cabal-test-store-28260/ghc-/WarnEarlyOver_-0.1.0.0-4c19059e06a32b93b2812983631117e77a2d3833/bin is not in the system search path. - -- +Copying 'warn-early-overwrite' to '' - skipIfWindows - cabalG options "v2-install" ["--install-method=copy"] +main = do + skipIfWindows "#10180" + cabalTest $ withShorterPathForNewBuildStore $ do + storeDir <- testStoreDir <$> getTestEnv + let options = ["--installdir=" ++ storeDir] + cabalG options "v2-install" ["--install-method=copy"] diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs index f4e6556b167..d25ecb0465e 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/clean-install-by-symlink.test.hs @@ -1,8 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ withShorterPathForNewBuildStore $ do - storeDir <- testStoreDir <$> getTestEnv - -- The default install method is symlink that may not work on Windows. - skipIfWindows - let options = ["--installdir=" ++ storeDir] - cabalG options "v2-install" [] +main = do + skipIfWindows "#10180" + cabalTest $ withShorterPathForNewBuildStore $ do + storeDir <- testStoreDir <$> getTestEnv + let options = ["--installdir=" ++ storeDir] + cabalG options "v2-install" [] diff --git a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs index 8d2ae8e6cc5..232d526f983 100644 --- a/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs +++ b/cabal-testsuite/PackageTests/WarnEarlyOverwrite/dirty-install.test.hs @@ -2,14 +2,13 @@ import Test.Cabal.Prelude import System.FilePath -main = cabalTest $ withShorterPathForNewBuildStore $ do - - storeDir <- testStoreDir <$> getTestEnv - -- Windows does not natively include a touch command. - -- SEE: https://stackoverflow.com/questions/30011267/create-an-empty-file-on-the-commandline-in-windows-like-the-linux-touch-command - skipIfWindows - let options = ["--installdir=" ++ storeDir] - -- 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"] +main = do + skipIfWindows "#10180" + cabalTest $ withShorterPathForNewBuildStore $ do + storeDir <- testStoreDir <$> getTestEnv + let options = ["--installdir=" ++ storeDir] + -- Touch the target to see if the warning is made early before the build. + _ <- runM "touch" [ (if isWindows then (<.> "exe") else id) + $ storeDir "warn-early-overwrite" ] Nothing + fails $ cabalG options "v2-install" [] + cabalG options "v2-install" ["--overwrite-policy=always"] diff --git a/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs b/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs index d4747aceb92..65fddd48be5 100644 --- a/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs +++ b/cabal-testsuite/PackageTests/postCheckoutCommand/cabal.test.hs @@ -1,7 +1,8 @@ import Test.Cabal.Prelude -main = cabalTest $ do - skipIfWindows +main = do + skipIfWindows "see #10182" + cabalTest $ do withProjectFile "cabal.positive.project" $ do cabal "v2-build" ["-v0"] withProjectFile "cabal.negative.project" $ do diff --git a/validate.sh b/validate.sh index edb1db83277..47705300a2d 100755 --- a/validate.sh +++ b/validate.sh @@ -329,7 +329,7 @@ CABALLISTBIN="${CABAL} list-bin --builddir=$BUILDDIR --project-file=$PROJECTFILE # of validate.sh # https://github.com/haskell/cabal/issues/9571 # https://github.com/haskell/cabal/pull/10114 -RTSOPTS="$([ $ARCH = "x86_64-windows" ] && [ -z "$CI" ] && echo "+RTS --io-manager=native" || echo "")" +RTSOPTS="$([ $ARCH = "x86_64-windows" ] && [ -z "$CI" ] && [ "$($HC --numeric-version)" != "8.10.7" ] && echo "+RTS --io-manager=native" || echo "")" # header #######################################################################