diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cefdbe1..e586513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: # dependencies, so it is probably okay we aren't testing on OSX. # - macOS-latest cabal: - - "latest" + - "3.12.1.0" ghc: - "8.0.2" - "8.2.2" @@ -37,6 +37,10 @@ jobs: - "8.10.7" - "9.0.2" - "9.2.4" + - "9.4.8" + - "9.6.6" + - "9.8.4" + - "9.10.1" steps: - uses: actions/checkout@v2 @@ -73,9 +77,14 @@ jobs: rm ./cabal.project cabal build package:pretty-simple --enable-tests --enable-benchmarks --write-ghc-environment-files=always --flags="buildexample" + - name: Install doctest + run: | + cabal install --ignore-project doctest --flag cabal-doctest + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + - name: Test run: | - cabal test package:pretty-simple --enable-tests + cabal doctest stack: name: stack / ubuntu-latest @@ -104,10 +113,6 @@ jobs: run: | stack build --test --bench --no-run-tests --no-run-benchmarks --flag pretty-simple:buildexample - - name: Test - run: | - stack test - nix-build-web: name: Nix build GHCJS web runs-on: ubuntu-latest diff --git a/README.md b/README.md index edc6ab3..d454a16 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,14 @@ Feel free to open an [PR](https://github.com/cdepillabout/pretty-simple/pulls) for any bugs/problems/suggestions/improvements. +### Testing + +To run the test suite locally, one must install the executables `doctest` and +`cabal-doctest`, e.g. with +`cabal install --ignore-project doctest --flag cabal-doctest`. + +Then run the command `cabal doctest`. + ## Maintainers - [@cdepillabout](https://github.com/cdepillabout) diff --git a/Setup.hs b/Setup.hs deleted file mode 100644 index 1715887..0000000 --- a/Setup.hs +++ /dev/null @@ -1,33 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -Wall #-} -module Main (main) where - -#ifndef MIN_VERSION_cabal_doctest -#define MIN_VERSION_cabal_doctest(x,y,z) 0 -#endif - -#if MIN_VERSION_cabal_doctest(1,0,0) - -import Distribution.Extra.Doctest ( defaultMainWithDoctests ) -main :: IO () -main = defaultMainWithDoctests "pretty-simple-doctest" - -#else - -#ifdef MIN_VERSION_Cabal --- If the macro is defined, we have new cabal-install, --- but for some reason we don't have cabal-doctest in package-db --- --- Probably we are running cabal sdist, when otherwise using new-build --- workflow -#warning You are configuring this package without cabal-doctest installed. \ - The doctests test-suite will not work as a result. \ - To fix this, install cabal-doctest before configuring. -#endif - -import Distribution.Simple - -main :: IO () -main = defaultMain - -#endif diff --git a/pretty-simple.cabal b/pretty-simple.cabal index 925117e..d7cd32a 100644 --- a/pretty-simple.cabal +++ b/pretty-simple.cabal @@ -9,17 +9,12 @@ author: Dennis Gosnell maintainer: cdep.illabout@gmail.com copyright: 2017-2019 Dennis Gosnell category: Text -build-type: Custom +build-type: Simple extra-source-files: CHANGELOG.md , README.md , img/pretty-simple-example-screenshot.png cabal-version: >=1.10 -custom-setup - setup-depends: base - , Cabal >= 1.24 - , cabal-doctest >=1.0.2 - flag buildexe description: Build an small command line program that pretty-print anything from stdin. default: True @@ -96,18 +91,6 @@ executable pretty-simple-json-example else buildable: False -test-suite pretty-simple-doctest - type: exitcode-stdio-1.0 - main-is: DocTest.hs - hs-source-dirs: test - build-depends: base - , doctest >= 0.13 - , Glob - , QuickCheck - , template-haskell - default-language: Haskell2010 - ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N - benchmark pretty-simple-bench type: exitcode-stdio-1.0 main-is: Bench.hs diff --git a/test/DocTest.hs b/test/DocTest.hs deleted file mode 100644 index 93f7655..0000000 --- a/test/DocTest.hs +++ /dev/null @@ -1,12 +0,0 @@ -module Main where - -import Build_doctests (flags, pkgs, module_sources) --- import Data.Foldable (traverse_) -import Test.DocTest (doctest) - -main :: IO () -main = do - -- traverse_ putStrLn args - doctest args - where - args = flags ++ pkgs ++ module_sources