florence / cover

a code coverage tool for racket
MIT License
38 stars 7 forks source link

Cannot render html when using a local language via #lang reader. #138

Open LeifAndersen opened 7 years ago

LeifAndersen commented 7 years ago

Namely, I run:

raco cover

The coverage runs fine. However, when cover goes to generate the html, I get the error:

dumping coverage info into "coverage"
default-load-handler: cannot open module file
  module path: #<path:/Users/leif/video/viddoclang.rkt>
  path: /Users/leif/video/viddoclang.rkt
  system error: No such file or directory; errno=2
  context...:
   standard-module-name-resolver
   /Users/leif/racket/racket/collects/syntax/module-reader.rkt:249:18: loop
   /Users/leif/racket/racket/collects/syntax/module-reader.rkt:296:4: -read-syntax
   /Users/leif/rsrc/cover/cover/private/html/html.rkt:404:0: expression-coverage/file
   /Users/leif/rsrc/cover/cover/private/html/html.rkt:125:0: make-html-file
   /Users/leif/rsrc/cover/cover/private/html/html.rkt:53:4: for-loop
   /Users/leif/rsrc/cover/cover/private/html/html.rkt:47:0: get-files
   /Users/leif/rsrc/cover/cover/private/html/html.rkt:31:0: generate-html-coverage
   /Users/leif/rsrc/cover/cover/raco.rkt:85:4
   /Users/leif/racket/racket/collects/racket/logging.rkt:43:0
   (submod /Users/leif/rsrc/cover/cover/raco.rkt main): [running body]
   /Users/leif/racket/racket/collects/raco/raco.rkt: [running body]
   /Users/leif/racket/racket/collects/raco/main.rkt: [running body]

Because this is only a problem with html generation and not coverage itself, the error does not happen when using the coveralls or codecov extensions. I should point out that this is one of the commit that is giving raco cover problems. And the file that is giving it problems (video.scrbl), starts out with:

#lang reader "viddoclang.rkt"

(where viddoclang.rkt is in the same directory as vidlang.)

florence commented 7 years ago

Strange. While trying to make a test case for this I get the same error but from a much earlier point (during module instrumentation).

As a work around for now, does this go away if you use the collection path instead of a relative path?

LeifAndersen commented 7 years ago

As in move the file to lang/reader.rkt? If so, ya, that does make the problem go away. Although I would much rather be able to use a relative path if possible. :)

florence commented 7 years ago

Can't you do #lang reader video/test/videolang instead of #lang reader "videolang.rkt"?

LeifAndersen commented 7 years ago

Ah, okay, that's what you meant. Yes, that does seem to work.

~Leif Andersen

On Wed, Aug 23, 2017 at 9:40 PM, Spencer Florence notifications@github.com wrote:

Can't you do #lang reader video/test/videolang instead of #lang reader "videolang.rkt"?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/florence/cover/issues/138#issuecomment-324508404, or mute the thread https://github.com/notifications/unsubscribe-auth/AARc5lvcmwrYynFf3dAX59U84HZetkuBks5sbNSTgaJpZM4O9rBb .