tasty-travis: Fancy Travis CI output for tasty tests.

[ bsd3, library, testing ] [ Propose Tags ] [ Report a vulnerability ]

Fancy Travis CI output for tasty tests. Features include:

  • Folded output

  • Coloured output

  • Hiding successful tests


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.2.0.1, 0.2.0.2 (info)
Change log CHANGELOG.md
Dependencies base (>=4.6 && <5), semigroups (>=0.18 && <0.20), tasty (>=0.12 && <1.5) [details]
Tested with ghc ==7.6.3, ghc ==7.8.4, ghc ==7.10.3, ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.4, ghc ==8.10.2
License BSD-3-Clause
Copyright Copyright © 2017-2020 Merijn Verstraaten
Author Merijn Verstraaten
Maintainer Merijn Verstraaten <merijn@inconsistent.nl>
Revised Revision 5 made by MerijnVerstraaten at 2020-11-02T14:35:14Z
Category Testing
Home page https://github.com/merijn/tasty-travis
Bug tracker https://github.com/merijn/tasty-travis/issues
Source repo head: git clone ssh://github.com:merijn/tasty-travis.git
Uploaded by MerijnVerstraaten at 2018-09-11T13:18:16Z
Distributions NixOS:0.2.0.2
Reverse Dependencies 1 direct, 1 indirect [details]
Downloads 3620 total (23 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for tasty-travis-0.2.0.2

[back to package description]

Tasty Travis: Fancy Travis CI output for tasty tests

BSD3 Hackage Build Status

Tasty Travis provides fancy Tasty test output on Travis CI.

It allows you get coloured test output, folding and collapsing groups of tests, and hiding the output of successful tests.

Example

Here's what an example test.hs might look:

import Data.List
import Data.Ord
import Data.Tagged (Tagged)
import Data.Typeable (Typeable)
import Options.Applicative (switch, long, help)

import Test.Tasty
import Test.Tasty.Options
import Test.Tasty.Travis (travisTestReporter, defaultConfig)
import Test.Tasty.HUnit

newtype EnableTravis = EnableTravis Bool
  deriving (Eq, Ord, Typeable)

instance IsOption EnableTravis where
  defaultValue = EnableTravis False
  parseValue = fmap EnableTravis . safeRead
  optionName = return "enable-travis"
  optionHelp = return "Run Travis tests."
  optionCLParser =
    fmap EnableTravis $
    switch
      (  long (untag (optionName :: Tagged EnableTravis String))
      <> help (untag (optionHelp :: Tagged EnableTravis String))
      )

main = travisTestReporter cfg [] tests
  where
    cfg = defaultConfig { travisTestOptions = setOption (EnableTravis True) }

tests :: TestTree
tests = testGroup "Unit tests"
  [ testCase "List comparison (different length)" $
      [1, 2, 3] `compare` [1,2] @?= GT

  -- the following test does not hold
  , testCase "List comparison (same length)" $
      [1, 2, 3] `compare` [1,2,2] @?= LT
  , askOption $ \(EnableTravis enable) ->
    if enable then travisTests else testGroup "" []
  ]

travisTests :: TestTree
travisTests = testGroup "Travis" [ {- Travis tests here -} ]