From 663c9f1a96dba6233b9b3f5cf6697a4e25c568bb Mon Sep 17 00:00:00 2001 From: Mark Karpov Date: Sat, 17 Mar 2018 03:16:11 +0700 Subject: [PATCH] =?UTF-8?q?Use=20new=20CI=20script,=20drop=20=E2=80=98stac?= =?UTF-8?q?k.yaml=E2=80=99=20from=20repo=20(#284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .travis.yml | 20 +++++++++----------- bench/speed/Main.hs | 5 +++++ megaparsec.cabal | 8 +++++--- stack.yaml | 5 ----- tests/Main.hs | 7 +++++++ tests/Spec.hs | 2 +- 7 files changed, 28 insertions(+), 20 deletions(-) delete mode 100644 stack.yaml create mode 100644 tests/Main.hs diff --git a/.gitignore b/.gitignore index d6c3007..cbc004a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ cabal.project.local cabal.sandbox.config dist-*/ dist/ +stack.yaml diff --git a/.travis.yml b/.travis.yml index 24b8cb3..0ac181a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ sudo: false cache: directories: - - ~/.ghc - - ~/.cabal + - ~/.cabal/packages + - ~/.cabal/store matrix: include: @@ -24,17 +24,15 @@ before_install: - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH install: - - cabal --version - - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" - - travis_retry cabal update - - cabal install --only-dependencies --enable-tests + - cabal --version + - ghc --version + - travis_retry cabal update script: - - cabal configure --enable-tests --enable-coverage -v2 -f dev - - travis_wait 60 cabal build - - travis_wait 20 cabal test --show-details=always --test-option=--qc-max-success=1000 - - cabal sdist - - cabal haddock | grep "100%" | wc -l | grep "11" + - cabal new-build --enable-tests --enable-benchmarks --flags=dev + - cabal new-test + - cabal new-haddock + - cabal sdist notifications: email: false diff --git a/bench/speed/Main.hs b/bench/speed/Main.hs index 74b3765..bafc936 100644 --- a/bench/speed/Main.hs +++ b/bench/speed/Main.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Main (main) where @@ -12,6 +13,10 @@ import Text.Megaparsec.Char import qualified Data.Text as T import qualified Text.Megaparsec.Char.Lexer as L +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative hiding (many, some) +#endif + -- | The type of parser that consumes 'String's. type Parser = Parsec Void Text diff --git a/megaparsec.cabal b/megaparsec.cabal index 57b3b50..08e5bc7 100644 --- a/megaparsec.cabal +++ b/megaparsec.cabal @@ -1,6 +1,6 @@ name: megaparsec version: 6.3.0 -cabal-version: >= 1.18 +cabal-version: 1.18 tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1 license: BSD2 license-file: LICENSE.md @@ -67,14 +67,15 @@ library default-language: Haskell2010 test-suite tests - main-is: Spec.hs + main-is: Main.hs hs-source-dirs: tests type: exitcode-stdio-1.0 if flag(dev) ghc-options: -O0 -Wall -Werror else ghc-options: -O2 -Wall - other-modules: Control.Applicative.CombinatorsSpec + other-modules: Spec + , Control.Applicative.CombinatorsSpec , Control.Monad.CombinatorsSpec , Test.Hspec.Megaparsec , Test.Hspec.Megaparsec.AdHoc @@ -99,6 +100,7 @@ test-suite tests , scientific >= 0.3.1 && < 0.4 , text >= 0.2 && < 1.3 , transformers >= 0.4 && < 0.6 + build-tools: hspec-discover >= 2.0 && < 3.0 if !impl(ghc >= 8.0) build-depends: semigroups == 0.18.* if !impl(ghc >= 7.10) diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 66dde90..0000000 --- a/stack.yaml +++ /dev/null @@ -1,5 +0,0 @@ -resolver: lts-10.0 -packages: -- '.' -extra-deps: -- parser-combinators-0.4.0 diff --git a/tests/Main.hs b/tests/Main.hs new file mode 100644 index 0000000..9457c4a --- /dev/null +++ b/tests/Main.hs @@ -0,0 +1,7 @@ +module Main (main) where + +import Test.Hspec.Runner +import Spec (spec) + +main :: IO () +main = hspecWith defaultConfig { configQuickCheckMaxSuccess = Just 1000 } spec diff --git a/tests/Spec.hs b/tests/Spec.hs index a824f8c..5416ef6 100644 --- a/tests/Spec.hs +++ b/tests/Spec.hs @@ -1 +1 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover #-} +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}