raco pkg tests: adjust to make tests less dependent on installation
In particular, instead of relying on the default scope as "user" set up an installation with an indirection that configures the scope to "user".
This commit is contained in:
parent
b2f76bd8cc
commit
ad437eee46
|
@ -29,14 +29,6 @@
|
|||
(shelly-case "All tests"
|
||||
(for-each (λ (x) (x)) l)))))
|
||||
|
||||
(let ([v (getenv "PLT_PKG_NOSETUP")])
|
||||
(unless (and v (not (string=? v "")))
|
||||
(error "Set the PLT_PKG_NOSETUP environment variable before running these tests\n")))
|
||||
|
||||
(unless (equal? "user\n" (with-output-to-string
|
||||
(lambda () (pkg-config-command #:installation #t "default-scope"))))
|
||||
(error "Run this test suite with `user' default package scope"))
|
||||
|
||||
(run-tests
|
||||
"name"
|
||||
"basic" "create" "install" "permissions"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
(and (file-exists? p)
|
||||
p))
|
||||
|
||||
(define (with-fake-installation* t)
|
||||
(define (with-fake-installation* t #:default-scope [default-scope "installation"])
|
||||
(define tmp-dir
|
||||
(make-temporary-file ".racket.fake-installation~a" 'directory
|
||||
(find-system-path 'temp-dir)))
|
||||
|
@ -41,7 +41,7 @@
|
|||
"test"
|
||||
|
||||
'default-scope
|
||||
"installation"
|
||||
default-scope
|
||||
|
||||
;; Find existing links and packages from the
|
||||
;; old configuration:
|
||||
|
@ -150,10 +150,15 @@
|
|||
(run-pkg-tests* run-pkg-tests)))))]))
|
||||
|
||||
(define (run-pkg-tests* t)
|
||||
(putenv "PLT_PKG_NOSETUP" "y")
|
||||
(with-servers
|
||||
(with-fake-installation*
|
||||
#:default-scope "user"
|
||||
(lambda ()
|
||||
(shelly-case "setup info cache" $ "raco setup -nDKxiI --no-foreign-libs")
|
||||
(with-fake-root
|
||||
(parameterize ([current-directory test-directory])
|
||||
(t)))))
|
||||
(t)))))))
|
||||
|
||||
(define-syntax-rule (shelly-install** message pkg rm-pkg (pre ...) (more ...))
|
||||
(with-fake-root
|
||||
|
|
Loading…
Reference in New Issue
Block a user