handle syntax only code as missing
This commit is contained in:
parent
ae0ce4491c
commit
d5d433d802
|
@ -81,8 +81,9 @@
|
||||||
(let loop ([stx stx] [first? #t])
|
(let loop ([stx stx] [first? #t])
|
||||||
(define (loop* stx) (loop stx #f))
|
(define (loop* stx) (loop stx #f))
|
||||||
(syntax-parse stx
|
(syntax-parse stx
|
||||||
#:datum-literals (module module* module+)
|
#:datum-literals (module module* module+ begin-for-syntax define-syntax define-syntaxes)
|
||||||
[((~or module module* module+) e ...)
|
[((~or module module* module+ begin-for-syntax define-syntax define-syntaxes)
|
||||||
|
e ...)
|
||||||
#:when (not first?)
|
#:when (not first?)
|
||||||
(define ?start (syntax-position stx))
|
(define ?start (syntax-position stx))
|
||||||
(when ?start
|
(when ?start
|
||||||
|
|
6
raco.rkt
6
raco.rkt
|
@ -83,7 +83,7 @@
|
||||||
(flatten
|
(flatten
|
||||||
(for/list ([f (in-list files)])
|
(for/list ([f (in-list files)])
|
||||||
(if (not (directory-exists? f))
|
(if (not (directory-exists? f))
|
||||||
f
|
(->absolute f)
|
||||||
(parameterize ([current-directory
|
(parameterize ([current-directory
|
||||||
(if (absolute-path? f)
|
(if (absolute-path? f)
|
||||||
f
|
f
|
||||||
|
@ -190,7 +190,9 @@
|
||||||
;; Coverage -> Coverage
|
;; Coverage -> Coverage
|
||||||
(define (remove-excluded-paths cover paths)
|
(define (remove-excluded-paths cover paths)
|
||||||
(for/hash ([(k v) (in-hash cover)]
|
(for/hash ([(k v) (in-hash cover)]
|
||||||
#:unless (is-excluded-path? k paths))
|
#:unless (and (is-excluded-path? k paths)
|
||||||
|
(vprintf "excluding path ~s from output\n" k)))
|
||||||
|
(vprintf "including path ~s in output\n" k)
|
||||||
(values k v)))
|
(values k v)))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
|
|
|
@ -48,8 +48,9 @@ in that file is covered. By default it checks character locations.
|
||||||
|
|
||||||
There are three possible results:
|
There are three possible results:
|
||||||
@itemize[@item{@racket['irrelevant] --- The location is not considered relevant to coverage information.
|
@itemize[@item{@racket['irrelevant] --- The location is not considered relevant to coverage information.
|
||||||
It is either not in the coverage information, is in a submodule, or lexes (in the sense of that languages
|
It is either not in the coverage information; is in a submodule; is a @racket[define-syntax],
|
||||||
@racket[_color-lexer]) as a comment or whitespace.}
|
@racket[define-syntaxes], or @racket[begin-for-syntax] form;
|
||||||
|
or lexes (in the sense of that languages, @racket[_color-lexer]) as a comment or whitespace.}
|
||||||
@item{@racket['covered] --- The location is not @racket['irrelevant] and is
|
@item{@racket['covered] --- The location is not @racket['irrelevant] and is
|
||||||
covered}
|
covered}
|
||||||
@item{@racket['uncovered] --- The location is not @racket['uncovered]
|
@item{@racket['uncovered] --- The location is not @racket['uncovered]
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
(<= start i (+ start range))]))
|
(<= start i (+ start range))]))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(define-runtime-path-list test-dirs '("basic" "simple-multi"))
|
(define-runtime-path-list test-dirs '("basic" "simple-multi" "syntax"))
|
||||||
(for-each (compose test-dir path->string) test-dirs))
|
(for-each (compose test-dir path->string) test-dirs))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
|
|
2
tests/syntax/syntax.rkt
Normal file
2
tests/syntax/syntax.rkt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#lang racket
|
||||||
|
(begin-for-syntax 5)
|
2
tests/syntax/syntax.rktl
Normal file
2
tests/syntax/syntax.rktl
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
((1 12))
|
||||||
|
()
|
Loading…
Reference in New Issue
Block a user