Compare commits
No commits in common. "master" and "fix-div-by-zero--issue-118" have entirely different histories.
master
...
fix-div-by
|
@ -4,6 +4,11 @@ env:
|
||||||
global:
|
global:
|
||||||
- RACKET_DIR=~/racket
|
- RACKET_DIR=~/racket
|
||||||
matrix:
|
matrix:
|
||||||
|
- RACKET_VERSION=6.1.1
|
||||||
|
- RACKET_VERSION=6.2
|
||||||
|
- RACKET_VERSION=6.2.1
|
||||||
|
- RACKET_VERSION=6.3
|
||||||
|
- RACKET_VERSION=6.4
|
||||||
- RACKET_VERSION=HEAD
|
- RACKET_VERSION=HEAD
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -187,7 +187,7 @@ Thus, In essence this module has three responsibilites:
|
||||||
|
|
||||||
;; ModulePath -> Any
|
;; ModulePath -> Any
|
||||||
(define (run-mod to-run)
|
(define (run-mod to-run)
|
||||||
(vprintf "running ~s in environment ~s" to-run (get-topic))
|
(vprintf "running ~s in envoronment ~s" to-run (get-topic))
|
||||||
(dynamic-require to-run 0)
|
(dynamic-require to-run 0)
|
||||||
(vprintf "finished running ~s" to-run))
|
(vprintf "finished running ~s" to-run))
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ Thus, In essence this module has three responsibilites:
|
||||||
(not file))
|
(not file))
|
||||||
e]
|
e]
|
||||||
[else
|
[else
|
||||||
(vprintf "compiling ~s with coverage annotations in environment ~s"
|
(vprintf "compiling ~s with coverage annotations in enviornment ~s"
|
||||||
file
|
file
|
||||||
(get-topic))
|
(get-topic))
|
||||||
((annotate-top file)
|
((annotate-top file)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang info
|
#lang setup/infotab
|
||||||
|
|
||||||
(define cover-formats
|
(define cover-formats
|
||||||
'(("html" cover generate-html-coverage)
|
'(("html" cover generate-html-coverage)
|
||||||
|
@ -14,5 +14,3 @@
|
||||||
'(("cover" (submod cover/raco main) "a code coverage tool" 30)))
|
'(("cover" (submod cover/raco main) "a code coverage tool" 30)))
|
||||||
|
|
||||||
(define scribblings '(("scribblings/cover.scrbl" (multi-page))))
|
(define scribblings '(("scribblings/cover.scrbl" (multi-page))))
|
||||||
|
|
||||||
(define pkg-authors '("spencer@florence.io"))
|
|
||||||
|
|
|
@ -24,10 +24,7 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
(define vector-name #'cover-coverage-vector)
|
(define vector-name #'cover-coverage-vector)
|
||||||
(define make-log-receiver-name #'make-log-receiver)
|
(define make-log-receiver-name #'make-log-receiver)
|
||||||
(define sync-name #'sync)
|
(define sync-name #'sync)
|
||||||
(define app-name #'#%app)
|
|
||||||
(define hash-ref-name #'hash-ref)
|
(define hash-ref-name #'hash-ref)
|
||||||
(define bfs-name #'begin-for-syntax)
|
|
||||||
(define begin-name #'begin)
|
|
||||||
|
|
||||||
;; symbol [Hash srcloclist index] [Hash pathstring vector]
|
;; symbol [Hash srcloclist index] [Hash pathstring vector]
|
||||||
;; -> (pathstring -> annotator)
|
;; -> (pathstring -> annotator)
|
||||||
|
@ -46,9 +43,7 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
(cond [(cross-phase-persist? stx)
|
(cond [(cross-phase-persist? stx)
|
||||||
;; special case: cross-phase-pesistant files
|
;; special case: cross-phase-pesistant files
|
||||||
;; are not coverable, but immutable so basically always covered
|
;; are not coverable, but immutable so basically always covered
|
||||||
(define loc (stx->srcloc stx))
|
(initialize-test-coverage-point stx)
|
||||||
(when loc
|
|
||||||
(initialize-test-coverage-point stx loc))
|
|
||||||
(do-final-init! #t)
|
(do-final-init! #t)
|
||||||
stx]
|
stx]
|
||||||
[else
|
[else
|
||||||
|
@ -69,8 +64,8 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
e #f
|
e #f
|
||||||
[(begin e mod)
|
[(begin e mod)
|
||||||
(begin
|
(begin
|
||||||
(syntax-case #'e (quote)
|
(syntax-case #'e (#%plain-app)
|
||||||
[(_ #;#%app vector-set vec (quote loc) (quote #t))
|
[(#%plain-app vector-set vec loc #t)
|
||||||
(vector-set! (hash-ref vecmapping file) (syntax-e #'loc) #t)])
|
(vector-set! (hash-ref vecmapping file) (syntax-e #'loc) #t)])
|
||||||
#'mod)]
|
#'mod)]
|
||||||
[_ e]))
|
[_ e]))
|
||||||
|
@ -78,27 +73,21 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
(define initialize-test-coverage-point
|
(define initialize-test-coverage-point
|
||||||
(if initialized?
|
(if initialized?
|
||||||
void
|
void
|
||||||
(lambda (stx loc)
|
(lambda (stx)
|
||||||
|
(define loc (stx->srcloc stx))
|
||||||
(unless (hash-has-key? loc->vecref loc)
|
(unless (hash-has-key? loc->vecref loc)
|
||||||
(hash-set! loc->vecref loc (list file count))
|
(hash-set! loc->vecref loc (list file count))
|
||||||
(set! count (add1 count))))))
|
(set! count (add1 count))))))
|
||||||
|
|
||||||
(define (test-covered stx loc)
|
(define (test-covered stx)
|
||||||
|
(define loc (stx->srcloc stx))
|
||||||
(with-syntax ([vector-name vector-name]
|
(with-syntax ([vector-name vector-name]
|
||||||
[#%papp app-name]
|
|
||||||
[unsafe-vector-set! unsafe-vector-set!-name]
|
[unsafe-vector-set! unsafe-vector-set!-name]
|
||||||
[vecloc (cadr (hash-ref loc->vecref loc))])
|
[vecloc (cadr (hash-ref loc->vecref loc))])
|
||||||
#`(#%papp unsafe-vector-set! vector-name 'vecloc '#t)))
|
#`(#%plain-app unsafe-vector-set! vector-name vecloc #t)))
|
||||||
|
|
||||||
(define (test-coverage-point body expr phase)
|
|
||||||
(define loc (stx->srcloc expr))
|
|
||||||
(cond [loc
|
|
||||||
(initialize-test-coverage-point expr loc)
|
|
||||||
#`(#,begin-name #,(test-covered expr loc) #,body)]
|
|
||||||
[else body]))
|
|
||||||
|
|
||||||
;; ---- IN ----
|
;; ---- IN ----
|
||||||
(define-values/invoke-unit/infer stacktrace/annotator@)
|
(define-values/invoke-unit/infer stacktrace@)
|
||||||
(make-cover-annotate-top annotate-top))
|
(make-cover-annotate-top annotate-top))
|
||||||
|
|
||||||
;; -------- Annotation Helpers --------------
|
;; -------- Annotation Helpers --------------
|
||||||
|
@ -168,21 +157,17 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
|
|
||||||
;; Syntax -> Natural
|
;; Syntax -> Natural
|
||||||
;; Maxiumum depth of begin-for-syntaxes
|
;; Maxiumum depth of begin-for-syntaxes
|
||||||
(define (get-syntax-depth expr [phase 0])
|
(define (get-syntax-depth expr)
|
||||||
(kernel-syntax-case/phase
|
(kernel-syntax-case
|
||||||
(disarm expr) phase
|
(disarm expr) #f
|
||||||
[(module _ _ mb)
|
[(module _ _ mb)
|
||||||
(get-syntax-depth #'mb)]
|
(get-syntax-depth #'mb)]
|
||||||
[(module* _ _ mb)
|
[(module* _ _ mb)
|
||||||
(get-syntax-depth #'mb)]
|
(get-syntax-depth #'mb)]
|
||||||
[(begin-for-syntax b ...)
|
[(begin-for-syntax b ...)
|
||||||
(add1 (apply max 1 (for/list ([b (in-list (syntax->list #'(b ...)))])
|
(add1 (apply max 1 (map get-syntax-depth (syntax->list #'(b ...)))))]
|
||||||
(get-syntax-depth b (add1 phase)))))]
|
|
||||||
[(define-syntaxes a ...)
|
|
||||||
2]
|
|
||||||
[(b ...)
|
[(b ...)
|
||||||
(apply max 1 (for/list ([b (in-list (syntax->list #'(b ...)))])
|
(apply max 1 (map get-syntax-depth (syntax->list #'(b ...))))]
|
||||||
(get-syntax-depth b phase)))]
|
|
||||||
[_ 1]))
|
[_ 1]))
|
||||||
|
|
||||||
;; Natural PathString Symbol -> Syntax
|
;; Natural PathString Symbol -> Syntax
|
||||||
|
@ -197,32 +182,17 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
[sync sync-name]
|
[sync sync-name]
|
||||||
[file file]
|
[file file]
|
||||||
[hash-ref hash-ref-name]
|
[hash-ref hash-ref-name]
|
||||||
[#%papp app-name]
|
[#%papp #'#%app]
|
||||||
[pdefine-values #'define-values]
|
[pdefine-values #'define-values]
|
||||||
[pbegin begin-name]
|
[pbegin #'begin]
|
||||||
[prequire '#%require]
|
[prequire '#%require]
|
||||||
[pbegin-for-syntax bfs-name]
|
|
||||||
[send-name (format-symbol "~a~a" topic 'cover-internal-send-vector-mapping)]
|
[send-name (format-symbol "~a~a" topic 'cover-internal-send-vector-mapping)]
|
||||||
[req-name (format-symbol "~a~a" topic 'cover-internal-request-vector-mapping)])
|
[req-name (format-symbol "~a~a" topic 'cover-internal-request-vector-mapping)])
|
||||||
(define startup-code
|
|
||||||
#`(pbegin
|
|
||||||
(pdefine-values (lgr) (#%papp current-logger))
|
|
||||||
(pdefine-values (rec) (#%papp make-log-receiver lgr 'info 'send-name))
|
|
||||||
(pdefine-values (vector-name)
|
|
||||||
(pbegin
|
|
||||||
(#%papp log-message lgr 'info 'req-name '"" '#f)
|
|
||||||
(#%papp hash-ref
|
|
||||||
(#%papp unsafe-vector-ref
|
|
||||||
(#%papp sync rec)
|
|
||||||
'2)
|
|
||||||
'file)))))
|
|
||||||
#`(#,@(for/list ([i bfs-depth])
|
#`(#,@(for/list ([i bfs-depth])
|
||||||
#`(#%require
|
#`(#%require (for-meta #,i (rename '#%kernel prequire #%require))))
|
||||||
(for-meta #,i (only '#%kernel quote))
|
|
||||||
(for-meta #,i (rename '#%kernel prequire #%require))))
|
|
||||||
#,@(for/list ([i bfs-depth])
|
#,@(for/list ([i bfs-depth])
|
||||||
#`(prequire (for-meta #,i (rename '#%kernel log-message log-message))
|
#`(prequire (only '#%kernel quote)
|
||||||
(for-meta #,i (rename '#%kernel pbegin-for-syntax begin-for-syntax))
|
(for-meta #,i (rename '#%kernel log-message log-message))
|
||||||
(for-meta #,i (rename '#%kernel current-logger current-logger))
|
(for-meta #,i (rename '#%kernel current-logger current-logger))
|
||||||
(for-meta #,i (rename '#%kernel make-log-receiver make-log-receiver))
|
(for-meta #,i (rename '#%kernel make-log-receiver make-log-receiver))
|
||||||
(for-meta #,i (rename '#%kernel sync sync))
|
(for-meta #,i (rename '#%kernel sync sync))
|
||||||
|
@ -232,9 +202,16 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
(for-meta #,i (rename '#%kernel pbegin begin))
|
(for-meta #,i (rename '#%kernel pbegin begin))
|
||||||
(for-meta #,i (rename '#%unsafe unsafe-vector-ref unsafe-vector-ref))
|
(for-meta #,i (rename '#%unsafe unsafe-vector-ref unsafe-vector-ref))
|
||||||
(for-meta #,i (rename '#%unsafe unsafe-vector-set! unsafe-vector-set!))))
|
(for-meta #,i (rename '#%unsafe unsafe-vector-set! unsafe-vector-set!))))
|
||||||
(prequire (for-meta #,bfs-depth (rename '#%kernel pbegin begin)))
|
(pdefine-values (lgr) (#%papp current-logger))
|
||||||
#,(for/fold ([stx #'(pbegin)]) ([i bfs-depth])
|
(pdefine-values (rec) (#%papp make-log-receiver lgr 'info 'send-name))
|
||||||
#`(pbegin #,startup-code (pbegin-for-syntax #,stx))))))
|
(pdefine-values (vector-name)
|
||||||
|
(pbegin
|
||||||
|
(#%papp log-message lgr 'info 'req-name "" #f)
|
||||||
|
(#%papp hash-ref
|
||||||
|
(#%papp unsafe-vector-ref
|
||||||
|
(#%papp sync rec)
|
||||||
|
2)
|
||||||
|
file))))))
|
||||||
|
|
||||||
(define inspector (variable-reference->module-declaration-inspector
|
(define inspector (variable-reference->module-declaration-inspector
|
||||||
(#%variable-reference)))
|
(#%variable-reference)))
|
||||||
|
@ -265,6 +242,7 @@ The module implements code coverage annotations as described in cover.rkt
|
||||||
|
|
||||||
;; -------- Generic `stacktrace^` Imports --------------
|
;; -------- Generic `stacktrace^` Imports --------------
|
||||||
(define (with-mark src dest phase) dest)
|
(define (with-mark src dest phase) dest)
|
||||||
|
(define test-coverage-enabled (make-parameter #t))
|
||||||
(define profile-key (gensym))
|
(define profile-key (gensym))
|
||||||
(define profiling-enabled (make-parameter #f))
|
(define profiling-enabled (make-parameter #f))
|
||||||
(define initialize-profile-point void)
|
(define initialize-profile-point void)
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#lang racket/base
|
|
||||||
|
|
||||||
(require (for-meta 1 racket/base)
|
|
||||||
(for-meta 2 racket/base))
|
|
||||||
|
|
||||||
(begin-for-syntax (define-syntax x #f))
|
|
|
@ -1,46 +1,2 @@
|
||||||
#lang racket
|
#lang racket
|
||||||
;; this is a comment
|
(begin-for-syntax 1)
|
||||||
(+ 1 2)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module+ test 20)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module+ test 20)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module+ test 20)
|
|
||||||
|
|
||||||
(begin-for-syntax
|
|
||||||
(require (for-syntax (only-in racket/base require for-syntax #%app begin-for-syntax #%datum only-in)))
|
|
||||||
;; this is a comment
|
|
||||||
(+ 1 2)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module+ test1 20)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module+ test1 20)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module+ test1 20)
|
|
||||||
(begin-for-syntax
|
|
||||||
(require (only-in racket/base + λ module*))
|
|
||||||
(require (for-syntax (only-in racket/base require for-syntax #%app begin-for-syntax #%datum only-in)))
|
|
||||||
(+ 1 2)
|
|
||||||
(λ (x) 3)
|
|
||||||
(λ (x) 3)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module* test2 racket 20)
|
|
||||||
|
|
||||||
(begin-for-syntax
|
|
||||||
(require (only-in racket/base + λ module*))
|
|
||||||
(require (for-syntax (only-in racket/base require for-syntax #%app begin-for-syntax #%datum only-in)))
|
|
||||||
(+ 1 2)
|
|
||||||
(λ (x) 3)
|
|
||||||
(λ (x) 3)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module* test3 racket 20)
|
|
||||||
|
|
||||||
(begin-for-syntax
|
|
||||||
(require (only-in racket/base + λ module*))
|
|
||||||
(require (for-syntax (only-in racket/base require for-syntax #%app begin-for-syntax #%datum only-in)))
|
|
||||||
(+ 1 2)
|
|
||||||
(λ (x) 3)
|
|
||||||
(λ (x) 3)
|
|
||||||
(λ (x) 3)
|
|
||||||
(module* test4 racket 20)))))
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
(define-runtime-path-list others
|
(define-runtime-path-list others
|
||||||
(list "bfs+module-nolex.rkt"
|
(list "bfs+module-nolex.rkt"
|
||||||
"bfs+module.rkt"
|
"bfs+module.rkt"
|
||||||
"bfs+define-syntax.rkt"
|
|
||||||
"lazy-require.rkt"))
|
"lazy-require.rkt"))
|
||||||
(test-case
|
(test-case
|
||||||
"begin-for-syntax with modules should be okay"
|
"begin-for-syntax with modules should be okay"
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
#lang racket
|
#lang racket
|
||||||
;; These tests modified from https://github.com/jackfirth/point-free
|
;; These tests modified from https://github.com/jackfirth/point-free
|
||||||
(provide arg-count
|
(provide define/compose
|
||||||
|
arg-count
|
||||||
define/arg-count)
|
define/arg-count)
|
||||||
|
|
||||||
|
(define-syntax-rule (define/compose id f ...)
|
||||||
|
(define id (compose f ...)))
|
||||||
|
|
||||||
(define-syntax-rule (arg-count n expr)
|
(define-syntax-rule (arg-count n expr)
|
||||||
(lambda args
|
(lambda args
|
||||||
|
|
11
info.rkt
11
info.rkt
|
@ -1,17 +1,14 @@
|
||||||
#lang info
|
#lang setup/infotab
|
||||||
|
|
||||||
(define name "cover")
|
(define name "cover")
|
||||||
(define collection 'multi)
|
(define collection 'multi)
|
||||||
|
|
||||||
(define version "3.1.1")
|
(define version "3.0.3")
|
||||||
|
|
||||||
(define deps '(("base" #:version "6.5.0.4") ("errortrace-lib" #:version "1.1")
|
(define deps '(("base" #:version "6.1.1") "errortrace-lib" "rackunit-lib"
|
||||||
"rackunit-lib" "syntax-color-lib" "compiler-lib"
|
"syntax-color-lib" "compiler-lib" "custom-load" "data-lib"))
|
||||||
"custom-load" "data-lib"))
|
|
||||||
|
|
||||||
(define build-deps
|
(define build-deps
|
||||||
'("racket-doc" "scribble-lib" "typed-racket-doc" "htdp-lib"
|
'("racket-doc" "scribble-lib" "typed-racket-doc" "htdp-lib"
|
||||||
"net-doc" "scribble-doc" "at-exp-lib" "scheme-lib" "typed-racket-lib"
|
"net-doc" "scribble-doc" "at-exp-lib" "scheme-lib" "typed-racket-lib"
|
||||||
"macro-debugger"))
|
"macro-debugger"))
|
||||||
|
|
||||||
(define pkg-authors '("spencer@florence.io"))
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user