Giter Club home page Giter Club logo

hunit-plus's People

Contributors

emc2 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jonathancast

hunit-plus's Issues

Timeout mechanism for tests

Design and implement an intelligent, extensible timeout mechanism for tests. This needs to be able to cleanly support long-running tests and tests with unpredictable running times. A crude mechanism like "kill the test after N seconds" is undesirable.

A better mechanism would allow tests to periodically issue a "heartbeat", which would reset the timeout counter. Ideally, the timeout period could be changed on the fly as well.

Make text the default output mode

The terminal output mode can produce extremely large log files when used with 'cabal test'. The default output mode should be switched to text.

testinfo initialized to undefined

I am using HUnit-Plus to write tests to be run with stack test, with type: detailed-0.9, and ran into undefined, even on a test as simple as:

tests :: IO [Test]
tests = return ["testName" ~: True ~?= True]

And I traced it to L133 of Test.HUnitPlus.Base:

testinfo = unsafePerformIO $! newIORef undefined

Indeed, testinfo is used by the ~?= operator, but is reset only by executeTest, which I don't call since cabal or stack should take care of running the tests.

Initializing it to a defined value seems to fix it.

HUnit-Plus-1.0.1 fails to compile with base 4.8

Citing from http://hydra.cryp.to/build/912674/nixlog/1/raw:

Building HUnit-Plus-1.0.1...
Preprocessing library HUnit-Plus-1.0.1...
[ 1 of 10] Compiling Test.HUnitPlus.Terminal ( src/Test/HUnitPlus/Terminal.hs, dist/build/Test/HUnitPlus/Terminal.o )
[ 2 of 10] Compiling Test.HUnitPlus.Filter ( src/Test/HUnitPlus/Filter.hs, dist/build/Test/HUnitPlus/Filter.o )
[ 3 of 10] Compiling Test.HUnitPlus.Reporting ( src/Test/HUnitPlus/Reporting.hs, dist/build/Test/HUnitPlus/Reporting.o )

src/Test/HUnitPlus/Reporting.hs:27:1: Warning:
    The import of ‘Data.Word’ is redundant
      except perhaps to import instances from ‘Data.Word’
    To import instances alone, use: import Data.Word()

<no location info>: 
Failing due to -Werror.

Expand text output and verbose output

Text mode output is a bit lacking. It should report total counts. Verbose mode output should also report starting and ending suites, and execution time.

Synthetic test names should be different

Currently, when a test is given a synthetic name, the result is that all such tests have the name "synthetic". The name of every synthetically-named test should be different.

Add assertThrows

There should be an assertion that a given computation throws an exception

Test count in console differs from text report for 2 test suites on Windows

The code:

import Test.HUnitPlus
suite name = testSuite name [name ~: assertSuccess]
main = createMain [suite "Foo", suite "Bar"]

Console output:

Cases: 1  Tried: 1  Errors: 0  Failures: 0  Assertions: 1  Skipped: 0

Text report:

Test suite Foo starting
Test case Foo starting
Test Foo completed in 0.000000 sec
Test suiteFoo completed in 0.000000 sec
Test suite Bar starting
Test case Bar starting
Test Bar completed in 0.000000 sec
Test suiteBar completed in 0.000000 sec
Tests completed in 0.000000 sec
Cases: 2  Tried: 2  Errors: 0  Failures: 0  Assertions: 2  Skipped: 0

Same difference is observed between -c text and -c terminal.

Full support for options

Options should be fully supported. This includes the following:

  • Test execution should properly maintain options state during execution
  • Tests need a better way of accessing options than what Distribution.TestSuite provides (possible additions to TestData)
  • It should be possible to specify options in filter expressions
  • Execution may need to execute a test or a test suite multiple times, with different options
  • Some options should be automatically set by the test environment (OS, architecture, time of day, hostname, haskell version, etc)

Tests broken by unordered-containers 0.2.16.0

Output is very vague, but since this has been happening a lot, I expect that this is because the test suite is checking something returned from unordered-containers in a way that is ordering-sensitive which is not guaranteed to be stable between releases.

Running 1 test suites...
Test suite RunTests: RUNNING...




Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Tests completed in 0.000000 sec
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Tests completed in 0.000001 sec
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Tests completed in 0.000001 sec
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Tests completed in 0.000001 sec
Cases: 0  Tried: 0  Errors: 0  Failures: 0  Assertions: 0  Skipped: 0
Tried: 14030  Errors: 0  Failures: 76
Test suite RunTests: FAIL
Test suite logged to: dist/test/HUnit-Plus-2.0.0-RunTests.log
0 of 1 test suites (0 of 1 test cases) passed.

Should be reproducible with cabal v2-test --constraint='unordered-containers == 0.2.16.0'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.