You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/quad/qtest/paths-to-test.rkt

25 lines
847 B
Racket

#lang racket/base
5 years ago
(require racket/runtime-path
racket/match
quadwriter)
(provide (all-defined-out))
(define-runtime-path here ".")
5 years ago
(define (find-test-paths)
(for/list ([test-path (in-directory here)]
#:when (regexp-match #rx"test-.*.rkt$" (path->string test-path)))
5 years ago
test-path))
(define (test-pdf-name path)
5 years ago
(path-add-extension (path-replace-extension path #".pdf") #"" #"-tester."))
(define (update-test-pdf test-path-arg)
(define test-path (match test-path-arg
[(? absolute-path? ap) ap]
[rp (build-path here rp)]))
(define-values (dir name _) (split-path test-path))
(displayln (path->string name))
(time (parameterize ([quadwriter-test-mode #t])
(render-pdf (dynamic-require test-path 'doc) (test-pdf-name test-path) test-path))))