Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHC 7.10 support #94

Closed
sol opened this issue Dec 24, 2014 · 12 comments
Closed

GHC 7.10 support #94

sol opened this issue Dec 24, 2014 · 12 comments

Comments

@sol
Copy link
Owner

sol commented Dec 24, 2014

The current version of Doctest does now work with GHC 7.10.

@sol
Copy link
Owner Author

sol commented Dec 24, 2014

I don't have time to look into this, @kazu-yamamoto can you help?

@kazu-yamamoto
Copy link
Collaborator

OK. I will try. But I cannot compile GHC 7.10 so far.

@peti
Copy link

peti commented Jan 9, 2015

We have support for GHC 7.10.1-rc1 in NixOS now, and we're running into trouble because the released version of doctest won't compile. Running

nix-build -o /tmp/doctest --option extra-binary-caches http://hydra.nixos.org '<nixpkgs>' -A haskell-ng.packages.ghcHEAD.ghc

in a recent version of Nixpkgs gives you a working GHC 7.10.1-rc1 compiler.

@kazu-yamamoto
Copy link
Collaborator

@peti See #96

@peti
Copy link

peti commented Jan 10, 2015

Very cool, thank you! We've upgraded to the current Git version in NixOS, and it works fine with GHC 7.10.x. FYI, the test suite failures we get for doctest itself look like this:

running tests
Running 2 test suites...
Test suite spec: RUNNING...

Extract
  extract
    extracts documentation for a top-level declaration
    extracts documentation from argument list
    extracts documentation for a type class function
    extracts documentation from the argument list of a type class function
    extracts documentation from the module header
    extracts documentation from imported modules
    extracts documentation from export list
    extracts documentation from named chunks
    returns docstrings in the same order they appear in the source
    extracts $setup code
    fails on invalid flags
  extract (regression tests)
    works with infix operators
    works with parallel list comprehensions
    works with list comprehensions in instance definitions
    works with foreign imports
    works for rewrite rules
    works for rewrite rules with type signatures
    strips CR from dos line endings
    works with a module that splices in an expression from an other module
    works for type families and GHC 7.6.1
Interpreter
  Interpreter
    knows whether it works
    terminates on SIGINT FAILED [1]
  ghcInfo
    includes "Have interpreter"
  eval
    shows literals
    shows string literals containing Unicode
    evaluates simple expressions
    supports let bindings
    allows import statements
    captures stdout
    captures stdout (Unicode)
    captures stdout (empty line)
    captures stdout (multiple lines)
    captures stderr
    captures stderr (Unicode)
    shows exceptions (undefined)
    shows exceptions (ExitCode)
    gives an error message for identifiers that are not in scope
  safeEval
    evaluates an expression
    returns Left on unterminated multiline command
Location
  toLocation
    works for a regular SrcSpan
    works for a single-line SrcSpan
    works for a SrcSpan that corresponds to single point
    works for a bad SrcSpan
    works for a SrcLoc with bad locations
  enumerate
    replicates UnhelpfulLocation
    enumerates Location
Main
  doctest
    testSimple
    failing
    skips subsequent examples from the same group if an example fails
    testImport
    testCommentLocation
    testPutStr
    fails on multi-line expressions, introduced with :{
    testBlankline
    examples from the same Haddock comment share the same scope
    testDocumentationForArguments
    template-haskell
    handles source files with CRLF line endings
    runs $setup before each test group
    skips subsequent tests from a module, if $setup fails
    works with additional object files
    ignores trailing whitespace when matching test output
  doctest as a runner for QuickCheck properties
    runs a boolean property
    runs an explicitly quantified property FAILED [2]
    runs an implicitly quantified property FAILED [3]
    reports a failing property
    runs a boolean property with an explicit type signature
    runs $setup before each property
  doctest (regression tests)
    bugfixWorkingDirectory
    bugfixOutputToStdErr
    bugfixImportHierarchical
    bugfixMultipleModules
    testCPP
    template-haskell-bugfix
Parse
  getDocTests
    extracts properties from a module
    extracts examples from a module
    extracts examples from documentation for non-exported names
    extracts multiple examples from a module
    returns an empty list, if documentation contains no examples
    sets setup code to Nothing, if it does not contain any tests
    keeps modules that only contain setup code
  parseInteractions (an internal function)
    parses an interaction
    drops whitespace as appropriate
    parses an interaction without a result
    works with a complex example
    attaches location information to parsed interactions
    basic multiline
    multiline align output
    multiline align output with >>>
   parseProperties (an internal function)
    parses a property
Property
  runProperty
    reports a failing property
    runs a Bool property
    runs a Bool property with an explicit type signature
    runs an implicitly quantified property
    runs an implicitly quantified property even with GHC 7.4
    runs an explicitly quantified property
    allows to mix implicit and explicit quantification FAILED [4]
    reports the value for which a property fails FAILED [5]
    reports the values for which a property that takes multiple arguments fails FAILED [6]
    defaults ambiguous type variables to Integer
  freeVariables
    finds a free variables in a term
    ignores duplicates
    works for terms with multiple names
    works for names that contain a prime
    works for names that are similar to other names that are in scope
  parseNotInScope
    when error message was produced by GHC 7.4.1
      extracts a variable name of variable that is not in scope from error an message
      ignores duplicates
      works for error messages with suggestions
      works for variable names that contain a prime
Run
  doctest
    exits with ExitFailure if at least one test case fails
    prints help on --help
    prints version on --version
    accepts arbitrary GHC options
    accepts GHC options with --optghc
    prints a deprecation message for --optghc
    prints error message on invalid option
    respects HASKELL_PACKAGE_SANDBOX FAILED [7]
  doctest_
    on parse error
      aborts with (ExitFailure 1)
      prints a useful error message
  stripOptGhc (an internal function)
    strips --optghc=
    strips --optghc
    indicates when nothing got striped
Runner.Example
  mkResult
    returns Equal when output matches
    ignores trailing whitespace
    when output does not matche
      constructs failure message
      constructs failure message for multi-line output
      when any output line contains "unsafe" characters
        uses show to format output lines
Runner
  report
    when mode is interactive
      writes to stderr
      overwrites any intermediate output
      blank out intermediate output if necessary
    when mode is non-interactive
      writes to stderr
  report_
    when mode is interactive
      writes intermediate output to stderr
      overwrites any intermediate output
      blank out intermediate output if necessary
    when mode is non-interactive
      is ignored
      does not influence a subsequent call to `report`
      does not require `report` to blank out any intermediate output
Sandbox
  getPackageDbDir
    parses a config file and extracts package db
    throws an error if a config file is broken
Util
  convertDosLineEndings
    converts CRLF to LF
    strips a trailing CR
  takeWhileEnd
    returns the longest suffix of elements that satisfy a given predicate

Failures:

  1) Interpreter.Interpreter terminates on SIGINT
       uncaught exception: IOException of type NoSuchThing (test/interpreter/termination/test_script.sh: readProcess: runInteractiveProcess: exec: does not exist (No such file or directory))

     # test/InterpreterSpec.hs:31 (best-effort)

  2) Main, doctest as a runner for QuickCheck properties, runs an explicitly quantified property
       property-quantified ["Foo.hs"]
       expected: Examples: 1  Tried: 1  Errors: 0  Failures: 0
        but got: Examples: 1  Tried: 1  Errors: 0  Failures: 1

     # test/MainSpec.hs:111 (best-effort)

  3) Main, doctest as a runner for QuickCheck properties, runs an implicitly quantified property
       property-implicitly-quantified ["Foo.hs"]
       expected: Examples: 1  Tried: 1  Errors: 0  Failures: 0
        but got: Examples: 1  Tried: 1  Errors: 0  Failures: 1

     # test/MainSpec.hs:115 (best-effort)

  4) Property.runProperty allows to mix implicit and explicit quantification
       expected: Success
        but got: Failure "\n<interactive>:27:3:\n    Exception when trying to run compile-time code:\n      Higher-kinded type variables in type: forall (a_0 :: *) . (GHC.Classes.Eq a_0, GHC.Num.Num a_0) =>\n                    a_0 -> a_0 -> GHC.Types.Bool\n    Code: polyQuickCheck (mkName \"doctest_prop\")\n    In the splice: $(polyQuickCheck (mkName \"doctest_prop\"))"

     # test/PropertySpec.hs:48 (best-effort)

  5) Property.runProperty reports the value for which a property fails
       expected: Failure "Falsifiable (after 1 test): \n0"
        but got: Failure "\n<interactive>:27:3:\n    Exception when trying to run compile-time code:\n      Higher-kinded type variables in type: forall (a_0 :: *) . (GHC.Classes.Eq a_0, GHC.Num.Num a_0) =>\n                    a_0 -> GHC.Types.Bool\n    Code: polyQuickCheck (mkName \"doctest_prop\")\n    In the splice: $(polyQuickCheck (mkName \"doctest_prop\"))"

     # test/PropertySpec.hs:51 (best-effort)

  6) Property.runProperty reports the values for which a property that takes multiple arguments fails
       expected: ["False","0","\"\""]
        but got: ["<interactive>:27:3:","    Exception when trying to run compile-time code:","      Higher-kinded type variables in type: forall (a_0 :: *) . (GHC.Classes.Eq a_0, GHC.Num.Num a_0) =>","                    GHC.Types.Bool -> a_0 -> [GHC.Types.Char] -> GHC.Types.Bool","    Code: polyQuickCheck (mkName \"doctest_prop\")","    In the splice: $(polyQuickCheck (mkName \"doctest_prop\"))"]

     # test/PropertySpec.hs:54 (best-effort)

  7) Run.doctest respects HASKELL_PACKAGE_SANDBOX
       uncaught exception: IOException of type NoSuchThing (cabal: rawSystem: runInteractiveProcess: exec: does not exist (No such file or directory))

     # test/RunSpec.hs:80 (best-effort)

Source locations marked with "best-effort" are calculated heuristically and may be incorrect.

Randomized with seed 1644586060

Finished in 15.6448 seconds
142 examples, 7 failures
Test suite spec: FAIL
Test suite logged to: dist/test/doctest-0.9.11.1-spec.log
Test suite doctests: RUNNING...
Test suite doctests: PASS
Test suite logged to: dist/test/doctest-0.9.11.1-doctests.log
1 of 2 test suites (1 of 2 test cases) passed.

@sol
Copy link
Owner Author

sol commented Jan 11, 2015

I think the test failures are due to nick8325/quickcheck#42.

@sol
Copy link
Owner Author

sol commented Jan 11, 2015

I just tried with the latest git version of QuickCheck, and all tests pass.

@nick8325 can you make a new Hackage release?

@nick8325
Copy link
Contributor

Yep, I will fix a few more things and try to get a release out this week.

@nick8325
Copy link
Contributor

The new version of QuickCheck is now on Hackage, so hopefully all the tests now pass. Sorry for not getting the release out sooner, been a bit overrun.

@andreasabel
Copy link
Collaborator

Why is this issue still open?

@sol
Copy link
Owner Author

sol commented Jan 2, 2018

@andreasabel Thanks Andreas for helping with ticket triage.

@sol sol closed this as completed Jan 2, 2018
@andreasabel
Copy link
Collaborator

Welcome. ;-) I stumbled over it randomly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants