Skip to content

Commit 87fe260

Browse files
committed
Fix some bounds for tests/benchmarks
1 parent d35f41c commit 87fe260

File tree

7 files changed

+66
-48
lines changed

7 files changed

+66
-48
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ install:
3535
- cabal configure
3636

3737
script:
38-
- cabal test unit-tests
38+
- cabal test

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Revision history for language-rust
22

3+
4+
## 0.1.1.26 -- 2018-03-02
5+
6+
* Bump test and benchmark dependencies
7+
38
## 0.1.0.26 -- 2018-03-01
49

510
* Parser module (using Alex and Happy)

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ environment:
66
matrix:
77
# - resolver: lts-6.35 # ghc-7.10.3
88
# - resolver: lts-7.24 # ghc-8.0.1
9-
- resolver: lts-9.8 # ghc-8.0.2
9+
- resolver: lts-9.21 # ghc-8.0.2
10+
- resolver: lts-10.7 # ghc-2.2.2
11+
- resolver: nightly
1012

1113
# Manually fetch stack
1214
install:

bench/timing-benchmarks/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import Criterion
44
import Criterion.Main (defaultConfig)
55
import Criterion.Types (anMean, reportAnalysis, timeLimit, anOutlierVar, ovEffect, OutlierEffect(Moderate))
6-
import Statistics.Resampling.Bootstrap (Estimate(..))
6+
import Statistics.Types (Estimate(..), ConfInt(..))
77

88
import Control.Monad (filterM)
99
import Control.Exception (catch, throwIO)
@@ -58,7 +58,7 @@ main = do
5858
, "upper bound" .= u
5959
]
6060
| (name,report) <- reports
61-
, let Estimate m l u _ = anMean (reportAnalysis report)
61+
, let Estimate m (ConfInt l u _) = anMean (reportAnalysis report)
6262
, ovEffect (anOutlierVar (reportAnalysis report)) < Moderate
6363
]
6464
for_ [ name | (name,report) <- reports, ovEffect (anOutlierVar (reportAnalysis report)) >= Moderate ] $ \n ->

language-rust.cabal

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: language-rust
2-
version: 0.1.0.26
2+
version: 0.1.1.26
33

44
synopsis: Parsing and pretty printing of Rust code
55
description: Language Rust is a library for the analysis of Rust code. It includes a
@@ -79,21 +79,21 @@ library
7979
, BangPatterns
8080
, CPP
8181

82-
build-depends: base >=4.8 && <5.0
83-
, prettyprinter >=1.0
84-
, transformers >=0.4 && <0.6
85-
, array >=0.5 && <0.6
86-
, deepseq >=1.1
82+
build-depends: base >=4.8 && <5.0
83+
, prettyprinter >=1.0 && <2.0
84+
, transformers >=0.4 && <0.6
85+
, array >=0.5 && <0.6
86+
, deepseq >=1.1 && <1.5
8787
if impl(ghc < 8)
88-
build-depends: semigroups >=0.18
88+
build-depends: semigroups >=0.18
8989

9090
if flag(useByteStrings)
9191
cpp-options: -DUSE_BYTESTRING
92-
build-depends: utf8-string >=1.0
93-
, bytestring >=0.10
92+
build-depends: utf8-string >=1.0
93+
, bytestring >=0.10
9494

9595
if flag(enableQuasiquotes)
96-
build-depends: template-haskell >=2.10
96+
build-depends: template-haskell >=2.10
9797

9898

9999
test-suite unit-tests
@@ -113,12 +113,13 @@ test-suite unit-tests
113113

114114
type: exitcode-stdio-1.0
115115
default-language: Haskell2010
116-
build-depends: base >=4.8 && <5.0
117-
, HUnit >=1.3.0.0
118-
, prettyprinter >=1.0
119-
, test-framework >=0.8.0
120-
, test-framework-hunit >= 0.3.0
116+
build-depends: HUnit >=1.3.0.0
117+
, test-framework >=0.8.0
118+
, test-framework-hunit >=0.3.0
119+
121120
, language-rust
121+
, base
122+
, prettyprinter
122123

123124
test-suite rustc-tests
124125
hs-source-dirs: test/rustc-tests
@@ -136,21 +137,22 @@ test-suite rustc-tests
136137
type: exitcode-stdio-1.0
137138
default-language: Haskell2010
138139

139-
build-depends: base >=4.8 && <5.0
140-
, process >= 1.3
141-
, prettyprinter >=1.1
142-
, bytestring >=0.10
143-
, aeson >= 0.11.0.0
144-
, directory >=1.2.5.0
145-
, filepath >=1.4.0.0
146-
, test-framework >=0.8.0
147-
, vector >=0.10.0
148-
, text >=1.2.0
140+
build-depends: process >=1.3
141+
, bytestring >=0.10
142+
, aeson >=0.11.0.0
143+
, directory >=1.2.5.0
144+
, filepath >=1.4.0.0
145+
, test-framework >=0.8.0
146+
, vector >=0.10.0
147+
, text >=1.2.0
149148
, unordered-containers >=0.2.7
149+
, time >=1.2.0.0
150+
150151
, language-rust
151-
, time >=1.2.0.0
152+
, base
153+
, prettyprinter >=1.1
152154
if impl(ghc < 8)
153-
build-depends: semigroups >=0.18
155+
build-depends: semigroups >=0.18
154156

155157
benchmark timing-benchmarks
156158
hs-source-dirs: bench/timing-benchmarks
@@ -161,15 +163,16 @@ benchmark timing-benchmarks
161163

162164
type: exitcode-stdio-1.0
163165
default-language: Haskell2010
164-
build-depends: base >=4.8 && <5.0
165-
, process >= 1.3
166-
, bytestring >=0.10
167-
, directory >= 1.2.5.0
168-
, filepath >= 1.4.0.0
166+
build-depends: process >=1.3
167+
, bytestring >=0.10
168+
, aeson >=0.11.0.0
169+
, directory >=1.2.5.0
170+
, filepath >=1.4.0.0
171+
, criterion >=1.1.1.0
172+
, statistics >=0.14.0
173+
169174
, language-rust
170-
, criterion >=1.1.1.0
171-
, statistics
172-
, aeson >= 0.11.0.0
175+
, base
173176

174177
benchmark allocation-benchmarks
175178
hs-source-dirs: bench/allocation-benchmarks
@@ -181,12 +184,13 @@ benchmark allocation-benchmarks
181184

182185
type: exitcode-stdio-1.0
183186
default-language: Haskell2010
184-
build-depends: base >=4.8 && <5.0
185-
, process >= 1.3
186-
, bytestring >=0.10
187-
, directory >=1.2.5.0
188-
, filepath >=1.4.0.0
187+
build-depends: process >=1.3
188+
, bytestring >=0.10
189+
, aeson >=0.11.0.0
190+
, directory >=1.2.5.0
191+
, filepath >=1.4.0.0
192+
, weigh >=0.0.6
193+
189194
, language-rust
190-
, weigh >=0.0.4
191-
, aeson >= 0.11.0.0
195+
, base
192196

test/rustc-tests/Diff.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ instance Show a => Diffable (QSelf a) where
725725

726726
-- TODO: use gbl to determine crate root
727727
instance Show a => Diffable (Path a) where
728-
Path g segs _ === val = do
728+
Path _ segs _ === val = do
729729
let val' = case val ! "segments" of
730730
j@(Data.Aeson.Array v) | j ! 0 ! "identifier" == "{{root}}" -> Data.Aeson.Array (V.drop 1 v)
731731
j -> j

test/rustc-tests/Main.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ import Language.Rust.Parser (readSourceFile)
1616
import Language.Rust.Pretty (prettyUnresolved, Resolve(..), Issue(..), Severity(Clean))
1717
import Language.Rust.Syntax (SourceFile)
1818

19-
import System.Directory (getCurrentDirectory, getTemporaryDirectory, listDirectory, doesFileExist)
19+
import System.Directory (getCurrentDirectory, getTemporaryDirectory, listDirectory, doesFileExist, findExecutable)
2020
import System.Process (withCreateProcess, proc, CreateProcess(..), StdStream(..), callProcess, readProcess)
2121
import System.FilePath ((</>), takeFileName)
2222
import System.IO (withFile, IOMode(WriteMode,ReadMode))
23+
import System.Exit (exitSuccess)
2324

2425
import Data.Time.Clock (utctDay, getCurrentTime)
2526
import Data.Time.Calendar (fromGregorian, showGregorian, diffDays)
@@ -38,6 +39,12 @@ main = do
3839
when (diffDays today lastDay > 32) $
3940
putStrLn $ "\x1b[33m" ++ "\nThe version of `rustc' the tests will try to use is older than 1 month" ++ "\x1b[0m"
4041

42+
-- Don't bother running the tests if you don't have `rustup` or `rustc` installed.
43+
missingProgs <- any null <$> traverse findExecutable ["rustup","rustc"]
44+
when missingProgs $ do
45+
putStrLn $ "Could not find `rustup`/`rustc`, so skipping these tests"
46+
exitSuccess
47+
4148
-- Setting `rustc` version to the right nightly, just in this directory
4249
callProcess "rustup" ["override", "set", "nightly-" ++ showGregorian lastDay]
4350
version <- readProcess "rustc" ["--version"] ""

0 commit comments

Comments
 (0)