Skip to content

Commit ae56173

Browse files
committed
[ travis ] activate testing of GHC 7.0.4
To not trip ghc-7.0 over new warnings/behavior, check in the tests/Makefile for the ghc version and for 7.0: - turn off lazy-unlifted-bindings - don't turn on incomplete-uni-patterns
1 parent 9bc7866 commit ae56173

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
# Keep the list of tested GHC versions in sync with `tested-with` in `alex.cabal`.
44
env:
5-
- GHCVER=8.8.2
6-
- GHCVER=8.6.5
7-
# - GHCVER=7.0.4
5+
- GHCVER=7.0.4
86
- GHCVER=7.4.2
97
- GHCVER=7.6.3
108
- GHCVER=7.8.4
119
- GHCVER=7.10.3
1210
- GHCVER=8.0.2
1311
- GHCVER=8.2.2
1412
- GHCVER=8.4.4
13+
- GHCVER=8.6.5
14+
- GHCVER=8.8.2
1515

1616
before_install:
1717
- sudo add-apt-repository -y ppa:hvr/ghc

alex.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ build-type: Simple
2323

2424
-- Keep the contents of `tested-with` in sync with `env` in `.travis.yml`.
2525
tested-with:
26+
GHC == 7.0.4
2627
GHC == 7.4.2
2728
GHC == 7.6.3
2829
GHC == 7.8.4

tests/Makefile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NOTE: `cabal test` will take care to build the local `alex`
2-
# executable and place it into $PATH for us to pick up.
3-
#
2+
# executable and place it into $PATH for us to pick up.
3+
#
44
# If it doesn't look like the alex binary in $PATH comes from the
55
# build tree, then we'll fall back to pointing to
66
# ../dist/build/alex/alex to support running tests via "runghc
@@ -13,7 +13,19 @@ endif
1313

1414
# NOTE: This assumes that a working `ghc` is on $PATH; this may not necessarily be the same GHC used by `cabal` for building `alex`.
1515
HC=ghc
16-
HC_OPTS=-Wall -fwarn-incomplete-uni-patterns -fno-warn-missing-signatures -fno-warn-unused-imports -fno-warn-tabs -Werror
16+
17+
# Some GHC warnings are only available from a certain version on
18+
# Get the GHC version
19+
GHC_VERSION:=$(shell ghc --numeric-version)
20+
GHC_VERSION_WORDS=$(subst ., ,$(GHC_VERSION))
21+
GHC_MAJOR_VERSION=$(word 1,$(GHC_VERSION_WORDS))
22+
GHC_MINOR_VERSION=$(word 2,$(GHC_VERSION_WORDS))
23+
# -fwarn-incomplete-uni-patterns only from 7.4
24+
WARNS_FOR_GHC_GTEQ_7_4=-fwarn-incomplete-uni-patterns
25+
WARNS_FOR_GHC_LT_7_4=-fno-warn-lazy-unlifted-bindings
26+
WARNS_DEP_GHC_GTEQ_7_4:=$(shell if [ $(GHC_MAJOR_VERSION) -gt 7 -o $(GHC_MAJOR_VERSION) -ge 7 -a $(GHC_MINOR_VERSION) -ge 4 ]; then echo "$(WARNS_FOR_GHC_GTEQ_7_4)"; else echo "$(WARNS_FOR_GHC_LT_7_4)"; fi)
27+
28+
HC_OPTS=-Wall $(WARNS_DEP_GHC_GTEQ_7_4) -fno-warn-missing-signatures -fno-warn-unused-imports -fno-warn-tabs -Werror
1729

1830
.PRECIOUS: %.n.hs %.g.hs %.o %.exe %.bin
1931

@@ -73,7 +85,8 @@ ALL_TESTS = $(patsubst %.hs, %.run, $(ALL_TEST_HS))
7385

7486
all :: $(ALL_TESTS)
7587

76-
.PHONY: clean
88+
.PHONY: clean debug
89+
7790
clean:
7891
rm -f $(CLEAN_FILES)
7992

@@ -82,3 +95,8 @@ interact:
8295
ghci -cpp -i../src -i../dist/build/autogen -i../dist/build/alex/alex-tmp Main -fbreak-on-exception
8396
# -args='--template=.. simple.x -o simple.n.hs'
8497
# :set args --template=.. simple.x -o simple.n.hs
98+
99+
debug :
100+
@echo HC_OPTS=$(HC_OPTS)
101+
102+
# EOF

0 commit comments

Comments
 (0)