Skip to content

Commit

Permalink
WIP: fix the testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Jul 14, 2023
1 parent 30cbb31 commit 1ea8a0d
Show file tree
Hide file tree
Showing 35 changed files with 296 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: fail
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: 2.0

library mylib
build-depends: base
signatures: Database
exposed-modules: Mine
hs-source-dirs: ../mylib
default-language: Haskell2010

library mysql
build-depends: base
exposed-modules: Database.MySQL
hs-source-dirs: ../mysql
default-language: Haskell2010

library postgresql
build-depends: base
exposed-modules: Database.PostgreSQL
hs-source-dirs: ../postgresql
default-language: Haskell2010

library
build-depends: base, mysql, postgresql, mylib
mixins:
mysql (Database.MySQL as Database),
postgresql (Database.PostgreSQL as Database)
exposed-modules: App
hs-source-dirs: ../src
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Includes2
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: 2.0

library mylib
build-depends: base
signatures: Database
exposed-modules: Mine
hs-source-dirs: ../mylib
default-language: Haskell2010

library mysql
build-depends: base
exposed-modules: Database.MySQL
hs-source-dirs: ../mysql
default-language: Haskell2010

library postgresql
build-depends: base
exposed-modules: Database.PostgreSQL
hs-source-dirs: ../postgresql
default-language: Haskell2010

library
build-depends: base, mysql, postgresql, mylib
mixins:
mylib (Mine as Mine.MySQL) requires (Database as Database.MySQL),
mylib (Mine as Mine.PostgreSQL) requires (Database as Database.PostgreSQL)
exposed-modules: App
hs-source-dirs: ../src
default-language: Haskell2010

executable exe
build-depends: base, Includes2
main-is: Main.hs
hs-source-dirs: ../exe
default-language: Haskell2010
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Preprocessing library 'mylib' for Includes2-0.1.0.0...
Building library 'mylib' instantiated with Database = <Database>
for Includes2-0.1.0.0...
35 changes: 35 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,68 @@ In order, the following will be built:
- 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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Preprocessing library 'mylib' for Includes2-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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Preprocessing library 'postgresql' for Includes2-0.1.0.0...
Building library 'postgresql' for Includes2-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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Preprocessing library 'mylib' for Includes2-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...
Configuring library 'mylib' instantiated with
Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL
for Includes2-0.1.0.0...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Preprocessing library 'mylib' for Includes2-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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
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...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Preprocessing executable 'exe' for Includes2-0.1.0.0...
Building executable 'exe' for Includes2-0.1.0.0...
# Includes2 exe
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
packages: .
packages: ./Includes2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for mylib-0.1.0.0...
Preprocessing library for mylib-0.1.0.0...
Running Haddock on library instantiated with Database = <Database>
for mylib-0.1.0.0...
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0...
# Setup haddock
Preprocessing library for mysql-0.1.0.0...
Running Haddock on library for mysql-0.1.0.0...
Documentation created: ../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql/
Documentation created: ../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0...
# Setup haddock
Preprocessing library for postgresql-0.1.0.0...
Running Haddock on library for postgresql-0.1.0.0...
Documentation created: ../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql/
Documentation created: ../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0...
Running Haddock on library instantiated with
Database = mysql-0.1.0.0:Database.MySQL
for mylib-0.1.0.0...
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0...
Running Haddock on library instantiated with
Database = postgresql-0.1.0.0:Database.PostgreSQL
for mylib-0.1.0.0...
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -84,7 +84,7 @@ Building library for src-0.1.0.0...
# Setup haddock
Preprocessing library for src-0.1.0.0...
Running Haddock on library for src-0.1.0.0...
Documentation created: ../setup-external.cabal.dist/work/src/dist/doc/html/src/
Documentation created: ../setup-external.cabal.dist/work/src/dist/doc/html/src/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for mylib-0.1.0.0...
Preprocessing library for mylib-0.1.0.0...
Running Haddock on library instantiated with Database = <Database>
for mylib-0.1.0.0...
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0...
# Setup haddock
Preprocessing library for mysql-0.1.0.0...
Running Haddock on library for mysql-0.1.0.0...
Documentation created: ../setup-external.dist/work/mysql/dist/doc/html/mysql/
Documentation created: ../setup-external.dist/work/mysql/dist/doc/html/mysql/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0...
# Setup haddock
Preprocessing library for postgresql-0.1.0.0...
Running Haddock on library for postgresql-0.1.0.0...
Documentation created: ../setup-external.dist/work/postgresql/dist/doc/html/postgresql/
Documentation created: ../setup-external.dist/work/postgresql/dist/doc/html/postgresql/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0...
Running Haddock on library instantiated with
Database = mysql-0.1.0.0:Database.MySQL
for mylib-0.1.0.0...
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0...
Running Haddock on library instantiated with
Database = postgresql-0.1.0.0:Database.PostgreSQL
for mylib-0.1.0.0...
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand All @@ -84,7 +84,7 @@ Building library for src-0.1.0.0...
# Setup haddock
Preprocessing library for src-0.1.0.0...
Running Haddock on library for src-0.1.0.0...
Documentation created: ../setup-external.dist/work/src/dist/doc/html/src/
Documentation created: ../setup-external.dist/work/src/dist/doc/html/src/index.html
# Setup copy
Installing library in <PATH>
# Setup register
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Setup configure
Configuring fail-0.1.0.0...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Error:
- Cannot match module names
Database.MySQL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Setup configure
Configuring fail-0.1.0.0...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Error:
- Cannot match module names
Database.MySQL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
r <- fails $ setup' "configure" ["--cabal-file", "Includes2.cabal.fail"]
r <- fails $ setup'' "Includes2-fail" "configure" []
assertOutputContains "mysql" r
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Setup configure
Configuring Includes2-0.1.0.0...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
# Setup build
Preprocessing library 'postgresql' for Includes2-0.1.0.0...
Building library 'postgresql' for Includes2-0.1.0.0...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Setup configure
Configuring Includes2-0.1.0.0...
Warning: 'hs-source-dirs: ../src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mylib' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../mysql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../postgresql' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'hs-source-dirs: ../exe' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
# Setup build
Preprocessing library 'postgresql' for Includes2-0.1.0.0...
Building library 'postgresql' for Includes2-0.1.0.0...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
withPackageDb $ do
setup_install ["--cabal-file", "Includes2.cabal"]
-- TODO: haddock for internal method doesn't work
runExe "exe" []
withPackageDb $
withDirectory "Includes2" $ do
setup_install []
-- TODO: haddock for internal method doesn't work
runExe "exe" []
Loading

0 comments on commit 1ea8a0d

Please sign in to comment.