Skip to content

Commit

Permalink
Fix a bunch of Windows tests, clarify why others are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Jul 15, 2024
1 parent 1ade294 commit 7b08b47
Show file tree
Hide file tree
Showing 77 changed files with 659 additions and 662 deletions.
60 changes: 31 additions & 29 deletions cabal-testsuite/PackageTests/AutoconfBadPaths/cabal.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
, "foo<bar"
, "foo=bar"
, "foo>bar"
, "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"
, "foo<bar"
, "foo=bar"
, "foo>bar"
, "foo?bar"
, "foo[bar"
, "foo\\bar"
, "foo`bar"
, "foo|bar"
]
where
setup dir = do
env <- getTestEnv
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Includes2
name: I
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Includes2
name: I
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -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 = <Database>
for Includes2-0.1.0.0...
for I-0.1.0.0...
66 changes: 33 additions & 33 deletions cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -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 = <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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
70 changes: 35 additions & 35 deletions cabal-testsuite/PackageTests/Backpack/Includes2/cov.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -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 = <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: <ROOT>/cov.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/Includes2-0.1.0.0/t/includes2-test/test/Includes2-0.1.0.0-includes2-test.log
Package coverage report written to <ROOT>/cov.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/Includes2-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html
Test suite logged to: <ROOT>/cov.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/I-0.1.0.0/t/includes2-test/test/I-0.1.0.0-includes2-test.log
Package coverage report written to <ROOT>/cov.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/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 <ROOT>/cov.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/Includes2-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html
Package coverage report written to <ROOT>/cov.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/I-0.1.0.0/t/includes2-test/hpc/vanilla/html/hpc_index.html
4 changes: 2 additions & 2 deletions cabal-testsuite/PackageTests/Backpack/Includes2/cov.test.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Test.Cabal.Prelude
main = cabalTest $ do
main = do
cabalTest $ do
skipUnlessGhcVersion ">= 8.1"
skipIfWindows -- TODO: https://github.com/haskell/cabal/issues/6271
-- #6397
cabal "test" ["--enable-coverage", "includes2-test"]
Original file line number Diff line number Diff line change
@@ -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 = <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 <PATH>
Installing internal library mysql in <PATH>
Expand All @@ -30,16 +30,16 @@ Installing library in <PATH>
Installing executable exe in <PATH>
Warning: The directory <ROOT>/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 = <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"
Loading

0 comments on commit 7b08b47

Please sign in to comment.