aboutsummaryrefslogtreecommitdiff
path: root/tests/multipkg/gen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/multipkg/gen.sh')
-rw-r--r--tests/multipkg/gen.sh39
1 files changed, 39 insertions, 0 deletions
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