on master help sign in
Test/bench the disable-tup-instances flag
4455512Vladislav Zavialov
.travis.yml+6−2
@@ -4,6 +4,10 @@ cache:
4 directories:
4 directories:
5 - $HOME/.stack/
5 - $HOME/.stack/
6
6
7+env:
8+ - FLAGS=""
9+ - FLAGS="--flag ether:disable-tup-instances"
10+
7before_install:
11before_install:
8 - mkdir -p ~/.local/bin
12 - mkdir -p ~/.local/bin
9 - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
13 - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
@@ -15,8 +19,8 @@ install:
15 - stack install --only-dependencies --no-terminal
19 - stack install --only-dependencies --no-terminal
16
20
17script:
21script:
18− - stack test ether:regression --no-terminal --ghc-options -Werror
22+ - stack test ether:regression --no-terminal --ghc-options -Werror $FLAGS
19− - stack bench ether:bench --no-terminal --ghc-options -Werror
23+ - stack bench ether:bench --no-terminal --ghc-options -Werror $FLAGS
20
24
21addons:
25addons:
22 apt:
26 apt:
bench/Bench.hs+1
@@ -8,6 +8,7 @@ import qualified Control.Monad.Reader as M
8import qualified Control.Monad.State as M
8import qualified Control.Monad.State as M
9import Criterion.Main
9import Criterion.Main
10import Ether
10import Ether
11+import TupleInstances ()
11
12
12id' :: a -> a
13id' :: a -> a
13id' = id
14id' = id
bench/TupleInstances.hsnew file+9
@@ -0,0 +1,9 @@
1+{-# OPTIONS -fno-warn-orphans #-}
2+{-# LANGUAGE CPP #-}
3+
4+module TupleInstances () where
5+
6+#ifdef DISABLE_TUP_INSTANCES
7+import Ether.Internal (makeTupleInstancesHasLens)
8+makeTupleInstancesHasLens [4,5,9]
9+#endif
ether.cabal+10
@@ -125,6 +125,7 @@ test-suite regression
125 Regression.hs
125 Regression.hs
126
126
127 other-modules:
127 other-modules:
128+ TupleInstances
128 Regression.T1
129 Regression.T1
129 Regression.T2
130 Regression.T2
130 Regression.T3
131 Regression.T3
@@ -175,6 +176,9 @@ test-suite regression
175 ghc-options:
176 ghc-options:
176 -Wall -fno-warn-missing-signatures
177 -Wall -fno-warn-missing-signatures
177
178
179+ if flag(disable-tup-instances)
180+ cpp-options: -DDISABLE_TUP_INSTANCES
181+
178
182
179benchmark bench
183benchmark bench
180
184
@@ -190,6 +194,9 @@ benchmark bench
190 main-is:
194 main-is:
191 Bench.hs
195 Bench.hs
192
196
197+ other-modules:
198+ TupleInstances
199+
193 type:
200 type:
194 exitcode-stdio-1.0
201 exitcode-stdio-1.0
195
202
@@ -229,3 +236,6 @@ benchmark bench
229
236
230 ghc-prof-options:
237 ghc-prof-options:
231 -fprof-auto
238 -fprof-auto
239+
240+ if flag(disable-tup-instances)
241+ cpp-options: -DDISABLE_TUP_INSTANCES
test/Regression/T1.hs+1
@@ -1,6 +1,7 @@
1module Regression.T1 (test1) where
1module Regression.T1 (test1) where
2
2
3import Ether
3import Ether
4+import TupleInstances ()
4import Data.List (group)
5import Data.List (group)
5
6
6import Test.Tasty
7import Test.Tasty
test/TupleInstances.hsnew file+9
@@ -0,0 +1,9 @@
1+{-# OPTIONS -fno-warn-orphans #-}
2+{-# LANGUAGE CPP #-}
3+
4+module TupleInstances () where
5+
6+#ifdef DISABLE_TUP_INSTANCES
7+import Ether.Internal (makeTupleInstancesHasLens)
8+makeTupleInstancesHasLens [2]
9+#endif