on master help sign in
Test/bench the disable-tup-instances flag
commit4455512563873c8affc9db422b570292b1591575 authorVladislav Zavialov <vlad.z.4096@gmail.com> dateMon 5 Jun 2017, 23:24 (9 years ago) parent0c0c26f
6 files changed+36−2
.travis.yml+6−2 bench/Bench.hs+1 bench/TupleInstances.hs+9 ether.cabal+10 test/Regression/T1.hs+1 test/TupleInstances.hs+9
.travis.yml+6−2
@@ -4,6 +4,10 @@ cache:
44 directories:
55 - $HOME/.stack/
66
7+env:
8+ - FLAGS=""
9+ - FLAGS="--flag ether:disable-tup-instances"
10+
711before_install:
812 - mkdir -p ~/.local/bin
913 - 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:
1519 - stack install --only-dependencies --no-terminal
1620
1721script:
18− - stack test ether:regression --no-terminal --ghc-options -Werror
19− - stack bench ether:bench --no-terminal --ghc-options -Werror
22+ - stack test ether:regression --no-terminal --ghc-options -Werror $FLAGS
23+ - stack bench ether:bench --no-terminal --ghc-options -Werror $FLAGS
2024
2125addons:
2226 apt:
bench/Bench.hs+1
@@ -8,6 +8,7 @@ import qualified Control.Monad.Reader as M
88import qualified Control.Monad.State as M
99import Criterion.Main
1010import Ether
11+import TupleInstances ()
1112
1213id' :: a -> a
1314id' = 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
125125 Regression.hs
126126
127127 other-modules:
128+ TupleInstances
128129 Regression.T1
129130 Regression.T2
130131 Regression.T3
@@ -175,6 +176,9 @@ test-suite regression
175176 ghc-options:
176177 -Wall -fno-warn-missing-signatures
177178
179+ if flag(disable-tup-instances)
180+ cpp-options: -DDISABLE_TUP_INSTANCES
181+
178182
179183benchmark bench
180184
@@ -190,6 +194,9 @@ benchmark bench
190194 main-is:
191195 Bench.hs
192196
197+ other-modules:
198+ TupleInstances
199+
193200 type:
194201 exitcode-stdio-1.0
195202
@@ -229,3 +236,6 @@ benchmark bench
229236
230237 ghc-prof-options:
231238 -fprof-auto
239+
240+ if flag(disable-tup-instances)
241+ cpp-options: -DDISABLE_TUP_INSTANCES
test/Regression/T1.hs+1
@@ -1,6 +1,7 @@
11module Regression.T1 (test1) where
22
33import Ether
4+import TupleInstances ()
45import Data.List (group)
56
67import 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