From 443af8c76ee1857366f204e15bdb48306b2b9c32 Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Wed, 7 Jan 2015 19:36:35 -0500 Subject: [PATCH] use racket/base for all modules --- coverage.rkt | 2 +- main.rkt | 5 +++-- private/coveralls.rkt | 19 ++++++++++++++++--- private/format-utils.rkt | 19 ++++++++++++++----- private/html.rkt | 12 +++++++++--- raco.rkt | 9 ++++++--- 6 files changed, 49 insertions(+), 17 deletions(-) diff --git a/coverage.rkt b/coverage.rkt index cd7a237..3256929 100644 --- a/coverage.rkt +++ b/coverage.rkt @@ -1,3 +1,3 @@ -(module coverage '#%kernel +(module coverage '#%kernel (#%provide coverage) (define-values (coverage) (make-hash))) diff --git a/main.rkt b/main.rkt index e50f33c..6c9b2f7 100644 --- a/main.rkt +++ b/main.rkt @@ -1,6 +1,6 @@ #lang racket/base (require "cover.rkt" "format.rkt" "private/contracts.rkt" "private/format-utils.rkt" - racket/contract) + "private/raw.rkt" racket/contract) (provide (contract-out [test-files! (->* () () #:rest (listof path-string?) any/c)] @@ -12,4 +12,5 @@ (#:byte? boolean?) (or/c 'yes 'no 'missing)))] [generate-coveralls-coverage (->* (coverage/c) (path-string?) any)] - [generate-html-coverage (->* (coverage/c) (path-string?) any)])) + [generate-html-coverage (->* (coverage/c) (path-string?) any)] + [generate-raw-coverage (->* (coverage/c) (path-string?) any)])) diff --git a/private/coveralls.rkt b/private/coveralls.rkt index 8c354ff..9ad6784 100644 --- a/private/coveralls.rkt +++ b/private/coveralls.rkt @@ -1,9 +1,22 @@ -#lang racket +#lang racket/base (provide generate-coveralls-coverage) -(require racket/runtime-path json "format-utils.rkt" "shared.rkt" racket/pretty) +(require json + racket/file + racket/function + racket/list + racket/path + racket/port + racket/pretty + racket/runtime-path + racket/string + racket/system + "format-utils.rkt" + "shared.rkt") + (module+ test - (require rackunit "../cover.rkt" racket/runtime-path)) + (require rackunit "../cover.rkt" racket/runtime-path) + (require (for-syntax racket/base))) ;; Coveralls diff --git a/private/format-utils.rkt b/private/format-utils.rkt index e02e673..56e66b6 100644 --- a/private/format-utils.rkt +++ b/private/format-utils.rkt @@ -1,8 +1,17 @@ -#lang racket +#lang racket/base (provide make-covered?) -(require syntax/modread syntax/parse unstable/sequence syntax-color/racket-lexer +(require racket/file + racket/function + racket/list + racket/match + racket/port + racket/set + syntax-color/racket-lexer + syntax/modread + syntax/parse "shared.rkt") -(module+ test (require rackunit "../cover.rkt" racket/runtime-path)) + +(module+ test (require rackunit "../cover.rkt" racket/runtime-path racket/set)) ;;;;; a Coverage is the output of (get-test-coverage) ;;;;; a FileCoverage is the values of the hashmap from (get-test-coverage) @@ -45,7 +54,7 @@ ;; TODO should we only ignore test (and main) submodules? (define (make-irrelevant? lexer f) (define s (mutable-set)) - (define-values (for-lex for-str) (dup-input-port (current-input-port))) + (define-values (for-lex for-str) (replicate-input-port (current-input-port))) (define str (apply vector (string->list (port->string for-str)))) (define init-offset (- (string-length (file->string f)) (vector-length str))) @@ -82,7 +91,7 @@ [_else (void)])) (lambda (i) (set-member? s i))) -(define (dup-input-port p) +(define (replicate-input-port p) (define-values (i1 o1) (make-pipe)) (define-values (i2 o2) (make-pipe)) (copy-port p o1 o2) diff --git a/private/html.rkt b/private/html.rkt index 4adc84b..259cffc 100644 --- a/private/html.rkt +++ b/private/html.rkt @@ -1,6 +1,12 @@ -#lang racket +#lang racket/base (provide generate-html-coverage) -(require racket/runtime-path +(require racket/file + racket/format + racket/function + racket/list + racket/match + racket/runtime-path + racket/string syntax/modread syntax/parse unstable/sequence @@ -10,7 +16,7 @@ (module+ test - (require rackunit "../cover.rkt" racket/runtime-path) + (require rackunit "../cover.rkt" racket/runtime-path racket/set) (define-runtime-path root "..") (define-runtime-path tests/basic/prog.rkt "../tests/basic/prog.rkt")) diff --git a/raco.rkt b/raco.rkt index 7740630..8e77c01 100644 --- a/raco.rkt +++ b/raco.rkt @@ -1,7 +1,10 @@ -#lang racket -(require raco/command-name "cover.rkt" "format.rkt" "private/shared.rkt") +#lang racket/base +(require racket/list racket/cmdline raco/command-name + "main.rkt" + "private/shared.rkt") + (module+ test - (require rackunit racket/runtime-path)) + (require rackunit racket/runtime-path racket/set)) (module+ main