aboutsummaryrefslogtreecommitdiff
path: root/tests/multipkg
diff options
context:
space:
mode:
Diffstat (limited to 'tests/multipkg')
-rw-r--r--tests/multipkg/.gitignore1
-rw-r--r--tests/multipkg/gen.sh39
-rw-r--r--tests/multipkg/packages.list4
-rw-r--r--tests/multipkg/pkg-oot/Exe.hs1
-rw-r--r--tests/multipkg/pkg-oot/Lib.hs2
-rw-r--r--tests/multipkg/pkg-oot/pkg-oot.cabal24
-rw-r--r--tests/multipkg/proj/Exe.hs1
-rw-r--r--tests/multipkg/proj/Lib.hs2
-rw-r--r--tests/multipkg/proj/cabal.project1
-rw-r--r--tests/multipkg/proj/pkg-a/Exe.hs1
-rw-r--r--tests/multipkg/proj/pkg-a/Lib.hs2
-rw-r--r--tests/multipkg/proj/pkg-a/pkg-a.cabal24
-rw-r--r--tests/multipkg/proj/pkg-b/Exe.hs1
-rw-r--r--tests/multipkg/proj/pkg-b/Lib.hs2
-rw-r--r--tests/multipkg/proj/pkg-b/pkg-b.cabal24
-rw-r--r--tests/multipkg/proj/proj.cabal25
-rw-r--r--tests/multipkg/proj/stack.yaml6
17 files changed, 160 insertions, 0 deletions
diff --git a/tests/multipkg/.gitignore b/tests/multipkg/.gitignore
new file mode 100644
index 0000000..18add1c
--- /dev/null
+++ b/tests/multipkg/.gitignore
@@ -0,0 +1 @@
+/package-paths.list \ No newline at end of file
diff --git a/tests/multipkg/gen.sh b/tests/multipkg/gen.sh
new file mode 100644
index 0000000..670b94e
--- /dev/null
+++ b/tests/multipkg/gen.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+printf '' > package-paths.list
+
+while read -r path name deps; do
+ mkdir -p "$path"
+ printf '%s\n' "$path" >> package-paths.list
+ cat > "$path/$name.cabal" <<EOF
+name: ${name}
+version: 0
+build-type: Simple
+cabal-version: >=1.10
+
+library
+ exposed-modules: Lib
+ build-depends: base, filepath, directory ${deps}
+ default-language: Haskell2010
+
+executable ${name}-exe
+ main-is: Exe.hs
+ build-depends: base, ${name} ${deps}
+ default-language: Haskell2010
+
+test-suite ${name}-test
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, ${name} ${deps}
+
+benchmark ${name}-bench
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, ${name} ${deps}
+EOF
+done <<EOF
+proj/ proj ,pkg-a,pkg-b,pkg-oot
+proj/pkg-a pkg-a
+proj/pkg-b pkg-b
+pkg-oot/ pkg-oot
+EOF
diff --git a/tests/multipkg/packages.list b/tests/multipkg/packages.list
new file mode 100644
index 0000000..e334777
--- /dev/null
+++ b/tests/multipkg/packages.list
@@ -0,0 +1,4 @@
+proj/
+proj/pkg-a
+proj/pkg-b
+pkg-oot/
diff --git a/tests/multipkg/pkg-oot/Exe.hs b/tests/multipkg/pkg-oot/Exe.hs
new file mode 100644
index 0000000..d5e55cc
--- /dev/null
+++ b/tests/multipkg/pkg-oot/Exe.hs
@@ -0,0 +1 @@
+main = putStrLn "Hello World!"
diff --git a/tests/multipkg/pkg-oot/Lib.hs b/tests/multipkg/pkg-oot/Lib.hs
new file mode 100644
index 0000000..b851fd6
--- /dev/null
+++ b/tests/multipkg/pkg-oot/Lib.hs
@@ -0,0 +1,2 @@
+module Lib where
+lib = ()
diff --git a/tests/multipkg/pkg-oot/pkg-oot.cabal b/tests/multipkg/pkg-oot/pkg-oot.cabal
new file mode 100644
index 0000000..8d61599
--- /dev/null
+++ b/tests/multipkg/pkg-oot/pkg-oot.cabal
@@ -0,0 +1,24 @@
+name: pkg-oot
+version: 0
+build-type: Simple
+cabal-version: >=1.10
+
+library
+ exposed-modules: Lib
+ build-depends: base, filepath, directory
+ default-language: Haskell2010
+
+executable pkg-oot-exe
+ main-is: Exe.hs
+ build-depends: base, pkg-oot
+ default-language: Haskell2010
+
+test-suite pkg-oot-test
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, pkg-oot
+
+benchmark pkg-oot-bench
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, pkg-oot
diff --git a/tests/multipkg/proj/Exe.hs b/tests/multipkg/proj/Exe.hs
new file mode 100644
index 0000000..d5e55cc
--- /dev/null
+++ b/tests/multipkg/proj/Exe.hs
@@ -0,0 +1 @@
+main = putStrLn "Hello World!"
diff --git a/tests/multipkg/proj/Lib.hs b/tests/multipkg/proj/Lib.hs
new file mode 100644
index 0000000..b851fd6
--- /dev/null
+++ b/tests/multipkg/proj/Lib.hs
@@ -0,0 +1,2 @@
+module Lib where
+lib = ()
diff --git a/tests/multipkg/proj/cabal.project b/tests/multipkg/proj/cabal.project
new file mode 100644
index 0000000..ecd97d5
--- /dev/null
+++ b/tests/multipkg/proj/cabal.project
@@ -0,0 +1 @@
+packages: ./ ./pkg-a ./pkg-b ../pkg-oot \ No newline at end of file
diff --git a/tests/multipkg/proj/pkg-a/Exe.hs b/tests/multipkg/proj/pkg-a/Exe.hs
new file mode 100644
index 0000000..d5e55cc
--- /dev/null
+++ b/tests/multipkg/proj/pkg-a/Exe.hs
@@ -0,0 +1 @@
+main = putStrLn "Hello World!"
diff --git a/tests/multipkg/proj/pkg-a/Lib.hs b/tests/multipkg/proj/pkg-a/Lib.hs
new file mode 100644
index 0000000..b851fd6
--- /dev/null
+++ b/tests/multipkg/proj/pkg-a/Lib.hs
@@ -0,0 +1,2 @@
+module Lib where
+lib = ()
diff --git a/tests/multipkg/proj/pkg-a/pkg-a.cabal b/tests/multipkg/proj/pkg-a/pkg-a.cabal
new file mode 100644
index 0000000..3fd83f6
--- /dev/null
+++ b/tests/multipkg/proj/pkg-a/pkg-a.cabal
@@ -0,0 +1,24 @@
+name: pkg-a
+version: 0
+build-type: Simple
+cabal-version: >=1.10
+
+library
+ exposed-modules: Lib
+ build-depends: base, filepath, directory
+ default-language: Haskell2010
+
+executable pkg-a-exe
+ main-is: Exe.hs
+ build-depends: base, pkg-a
+ default-language: Haskell2010
+
+test-suite pkg-a-test
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, pkg-a
+
+benchmark pkg-a-bench
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, pkg-a
diff --git a/tests/multipkg/proj/pkg-b/Exe.hs b/tests/multipkg/proj/pkg-b/Exe.hs
new file mode 100644
index 0000000..d5e55cc
--- /dev/null
+++ b/tests/multipkg/proj/pkg-b/Exe.hs
@@ -0,0 +1 @@
+main = putStrLn "Hello World!"
diff --git a/tests/multipkg/proj/pkg-b/Lib.hs b/tests/multipkg/proj/pkg-b/Lib.hs
new file mode 100644
index 0000000..b851fd6
--- /dev/null
+++ b/tests/multipkg/proj/pkg-b/Lib.hs
@@ -0,0 +1,2 @@
+module Lib where
+lib = ()
diff --git a/tests/multipkg/proj/pkg-b/pkg-b.cabal b/tests/multipkg/proj/pkg-b/pkg-b.cabal
new file mode 100644
index 0000000..b8d39e6
--- /dev/null
+++ b/tests/multipkg/proj/pkg-b/pkg-b.cabal
@@ -0,0 +1,24 @@
+name: pkg-b
+version: 0
+build-type: Simple
+cabal-version: >=1.10
+
+library
+ exposed-modules: Lib
+ build-depends: base, filepath, directory
+ default-language: Haskell2010
+
+executable pkg-b-exe
+ main-is: Exe.hs
+ build-depends: base, pkg-b
+ default-language: Haskell2010
+
+test-suite pkg-b-test
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, pkg-b
+
+benchmark pkg-b-bench
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, pkg-b
diff --git a/tests/multipkg/proj/proj.cabal b/tests/multipkg/proj/proj.cabal
new file mode 100644
index 0000000..80fd682
--- /dev/null
+++ b/tests/multipkg/proj/proj.cabal
@@ -0,0 +1,25 @@
+name: proj
+version: 0
+build-type: Simple
+cabal-version: >=1.10
+extra-source-files: stack.yaml
+
+library
+ exposed-modules: Lib
+ build-depends: base, filepath, directory ,pkg-a,pkg-b,pkg-oot
+ default-language: Haskell2010
+
+executable proj-exe
+ main-is: Exe.hs
+ build-depends: base, proj ,pkg-a,pkg-b,pkg-oot
+ default-language: Haskell2010
+
+test-suite proj-test
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, proj ,pkg-a,pkg-b,pkg-oot
+
+benchmark proj-bench
+ type: exitcode-stdio-1.0
+ main-is: Exe.hs
+ build-depends: base, proj ,pkg-a,pkg-b,pkg-oot
diff --git a/tests/multipkg/proj/stack.yaml b/tests/multipkg/proj/stack.yaml
new file mode 100644
index 0000000..7e37d72
--- /dev/null
+++ b/tests/multipkg/proj/stack.yaml
@@ -0,0 +1,6 @@
+resolver: lts-0.0 # will be overridden on the commandline
+packages:
+- ./
+- ./pkg-a
+- ./pkg-b
+- ../pkg-oot