From 541d219dbcf097c0c50b4ee0216f270c9c8c1342 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 22 Jan 2019 00:34:05 +0100 Subject: Add support and test coverage for mulit-pkg projects --- tests/multipkg/proj/Exe.hs | 1 + tests/multipkg/proj/Lib.hs | 2 ++ tests/multipkg/proj/cabal.project | 1 + tests/multipkg/proj/pkg-a/Exe.hs | 1 + tests/multipkg/proj/pkg-a/Lib.hs | 2 ++ tests/multipkg/proj/pkg-a/pkg-a.cabal | 24 ++++++++++++++++++++++++ tests/multipkg/proj/pkg-b/Exe.hs | 1 + tests/multipkg/proj/pkg-b/Lib.hs | 2 ++ tests/multipkg/proj/pkg-b/pkg-b.cabal | 24 ++++++++++++++++++++++++ tests/multipkg/proj/proj.cabal | 25 +++++++++++++++++++++++++ tests/multipkg/proj/stack.yaml | 6 ++++++ 11 files changed, 89 insertions(+) create mode 100644 tests/multipkg/proj/Exe.hs create mode 100644 tests/multipkg/proj/Lib.hs create mode 100644 tests/multipkg/proj/cabal.project create mode 100644 tests/multipkg/proj/pkg-a/Exe.hs create mode 100644 tests/multipkg/proj/pkg-a/Lib.hs create mode 100644 tests/multipkg/proj/pkg-a/pkg-a.cabal create mode 100644 tests/multipkg/proj/pkg-b/Exe.hs create mode 100644 tests/multipkg/proj/pkg-b/Lib.hs create mode 100644 tests/multipkg/proj/pkg-b/pkg-b.cabal create mode 100644 tests/multipkg/proj/proj.cabal create mode 100644 tests/multipkg/proj/stack.yaml (limited to 'tests/multipkg/proj') 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 -- cgit v1.2.3