Skip to content

Commit d5118aa

Browse files
committed
Break tests dependency cycle
- move source to src/ - Use symbolic links for package replicas
1 parent 7b2bd22 commit d5118aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+217
-237
lines changed

.travis.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This Travis job script has been generated by a script via
22
#
3-
# haskell-ci 'text.cabal'
3+
# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
44
#
55
# To regenerate the script (for example after adjusting tested-with) run
66
#
@@ -85,6 +85,7 @@ before_install:
8585
- set -o pipefail
8686
- TEST=--enable-tests
8787
- BENCH=--enable-benchmarks
88+
- if [ $HCNUMVER -lt 70400 ] ; then BENCH=--disable-benchmarks ; fi
8889
- HEADHACKAGE=false
8990
- rm -f $CABALHOME/config
9091
- |
@@ -117,18 +118,28 @@ install:
117118
- touch cabal.project
118119
- |
119120
echo "packages: ." >> cabal.project
121+
echo "packages: tests" >> cabal.project
122+
echo "packages: th-tests" >> cabal.project
123+
if [ $HCNUMVER -ge 71000 ] ; then echo "packages: benchmarks" >> cabal.project ; fi
120124
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package text' >> cabal.project ; fi
121125
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
126+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package text-tests' >> cabal.project ; fi
127+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
128+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package th-tests' >> cabal.project ; fi
129+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
130+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package text-benchmarks' >> cabal.project ; fi
131+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
122132
- |
123-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(text)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
133+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(parsec|text|text-benchmarks|text-tests|th-tests)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
124134
- cat cabal.project || true
125135
- cat cabal.project.local || true
126136
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
137+
- if [ -f "tests/configure.ac" ]; then (cd "tests" && autoreconf -i); fi
138+
- if [ -f "th-tests/configure.ac" ]; then (cd "th-tests" && autoreconf -i); fi
139+
- if [ -f "benchmarks/configure.ac" ]; then (cd "benchmarks" && autoreconf -i); fi
127140
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
128141
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
129142
- rm cabal.project.freeze
130-
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
131-
- travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
132143
script:
133144
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
134145
# Packaging...
@@ -139,15 +150,27 @@ script:
139150
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
140151
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
141152
- PKGDIR_text="$(find . -maxdepth 1 -type d -regex '.*/text-[0-9.]*')"
153+
- PKGDIR_text_tests="$(find . -maxdepth 1 -type d -regex '.*/text-tests-[0-9.]*')"
154+
- PKGDIR_th_tests="$(find . -maxdepth 1 -type d -regex '.*/th-tests-[0-9.]*')"
155+
- PKGDIR_text_benchmarks="$(find . -maxdepth 1 -type d -regex '.*/text-benchmarks-[0-9.]*')"
142156
# Generate cabal.project
143157
- rm -rf cabal.project cabal.project.local cabal.project.freeze
144158
- touch cabal.project
145159
- |
146160
echo "packages: ${PKGDIR_text}" >> cabal.project
161+
echo "packages: ${PKGDIR_text_tests}" >> cabal.project
162+
echo "packages: ${PKGDIR_th_tests}" >> cabal.project
163+
if [ $HCNUMVER -ge 71000 ] ; then echo "packages: ${PKGDIR_text_benchmarks}" >> cabal.project ; fi
147164
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package text' >> cabal.project ; fi
148165
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
166+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package text-tests' >> cabal.project ; fi
167+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
168+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package th-tests' >> cabal.project ; fi
169+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
170+
- if [ $HCNUMVER -ge 80200 ] ; then echo 'package text-benchmarks' >> cabal.project ; fi
171+
- "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi"
149172
- |
150-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(text)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
173+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(parsec|text|text-benchmarks|text-tests|th-tests)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
151174
- cat cabal.project || true
152175
- cat cabal.project.local || true
153176
# Building...
@@ -160,11 +183,14 @@ script:
160183
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
161184
# cabal check...
162185
- (cd ${PKGDIR_text} && ${CABAL} -vnormal check)
186+
- (cd ${PKGDIR_text_tests} && ${CABAL} -vnormal check)
187+
- (cd ${PKGDIR_th_tests} && ${CABAL} -vnormal check)
188+
- if [ $HCNUMVER -ge 71000 ] ; then (cd ${PKGDIR_text_benchmarks} && ${CABAL} -vnormal check) ; fi
163189
# haddock...
164190
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
165191
# Building without installed constraints for packages in global-db...
166192
- rm -f cabal.project.local
167193
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
168194

169-
# REGENDATA ("0.10.1",["text.cabal"])
195+
# REGENDATA ("0.10.1",["--config=cabal.haskell-ci","cabal.project"])
170196
# EOF

benchmarks/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

benchmarks/cbits

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../cbits
File renamed without changes.

benchmarks/include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../include

benchmarks/src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../src

benchmarks/text-benchmarks.cabal

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@ cabal-version: 1.12
22
name: text-benchmarks
33
version: 0.0.0.0
44
synopsis: Benchmarks for the text package
5-
description: Benchmarks for the text package
5+
description: Benchmarks for the text package.
66
homepage: https://bitbucket.org/bos/text
77
license: BSD2
8-
license-file: ../LICENSE
8+
license-file: LICENSE
99
author: Jasper Van der Jeugt <[email protected]>,
1010
Bryan O'Sullivan <[email protected]>,
1111
Tom Harper <[email protected]>,
1212
Duncan Coutts <[email protected]>
1313
maintainer: [email protected]
1414
category: Text
1515
build-type: Simple
16+
tested-with: GHC==8.10.1, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4,
17+
GHC==8.2.2, GHC==8.0.2, GHC==7.10.3
18+
19+
extra-source-files:
20+
include/*.h
1621

1722
flag bytestring-builder
1823
description: Depend on the bytestring-builder package for backwards compatibility.
@@ -54,7 +59,7 @@ executable text-benchmarks
5459
build-depends: bytestring >= 0.10.4
5560

5661
-- modules for benchmark proper
57-
c-sources: cbits/time_iconv.c
62+
c-sources: cbits-bench/time_iconv.c
5863
hs-source-dirs: haskell
5964
main-is: Benchmarks.hs
6065
other-modules:
@@ -81,9 +86,9 @@ executable text-benchmarks
8186

8287
-- Source code for IUT (implementation under test)
8388
-- "borrowed" from parent folder
84-
include-dirs: ../include
85-
c-sources: ../cbits/cbits.c
86-
hs-source-dirs: ..
89+
include-dirs: include
90+
c-sources: cbits/cbits.c
91+
hs-source-dirs: src
8792
other-modules:
8893
Data.Text
8994
Data.Text.Array
@@ -132,6 +137,7 @@ executable text-benchmarks
132137

133138
default-language: Haskell2010
134139
default-extensions: NondecreasingIndentation
140+
other-extensions: DeriveAnyClass
135141

136142

137143
executable text-multilang

cabal.haskell-ci

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
benchmarks: >=7.4
2+
jobs-selection: any
3+
4+
installed: +all -text -parsec
5+
install-dependencies: False

cabal.project

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
-- See http://cabal.readthedocs.io/en/latest/nix-local-build-overview.html
2-
packages: ., benchmarks, th-tests
2+
packages: .
3+
packages: tests
4+
packages: th-tests
5+
packages: benchmarks
36
tests: True
File renamed without changes.

0 commit comments

Comments
 (0)