Adding --deps

This commit is contained in:
Jay McCarthy 2017-10-20 11:32:04 -04:00
parent 62b17db270
commit 5662ed8e99

View File

@ -972,6 +972,21 @@
s))
n)
(define check-pkg-deps? #f)
(define (maybe-expand-package-deps l)
(cond
[(and packages? check-pkg-deps?)
(hash-keys
(for/fold ([h (hash)]) ([p (in-list l)])
(define-values (sum _ deps)
(get-pkg-content (pkg-desc p 'name p #f #f)
#:extract-info extract-pkg-dependencies
#:use-cache? #t))
(for/fold ([h h]) ([d (in-list (cons p deps))])
(hash-set h d #t))))]
[else
l]))
(command-line
#:program (short-program+command-name)
#:once-any
@ -1059,6 +1074,9 @@
[("--check-stderr" "-e")
"Treat stderr output as a test failure"
(set! check-stderr? #t)]
[("--deps")
"If treating arguments as packages, also test dependencies"
(set! check-pkg-deps? #t)]
#:multi
[("++ignore-stderr") pattern
"Ignore stderr output that matches #px\"<pattern>\""
@ -1074,8 +1092,11 @@
[("--table" "-t")
"Print a summary table"
(set! table? #t)]
#:args file-or-directory
(begin (unless (= 1 (length file-or-directory))
#:args file-or-directory-or-collects-or-pkgs
(let ()
(define file-or-directory
(maybe-expand-package-deps file-or-directory-or-collects-or-pkgs))
(unless (= 1 (length file-or-directory))
(set! single-file? #f))
(when (and (eq? configure-runtime 'default)
(or (and (not single-file?)