;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2018-2020, 2022 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
(use-modules (gnu tests)
(gnu packages package-management)
- ((gnu ci) #:select (channel-source->package))
+ (guix monads)
+ (guix store)
((guix git-download) #:select (git-predicate))
((guix utils) #:select (current-source-directory))
(git)
;; of tests to run in the usual way:
;;
;; make check-system TESTS=installed-os
- (parameterize ((current-guix-package
- (channel-source->package source #:commit commit)))
- (match (getenv "TESTS")
- (#f
- (all-system-tests))
- ((= string-tokenize (tests ...))
- (filter (lambda (test)
- (member (system-test-name test) tests))
- (all-system-tests))))))
+ (let ((guix (channel-source->package source #:commit commit)))
+ (map (lambda (test)
+ (system-test
+ (inherit test)
+ (value (mparameterize %store-monad ((current-guix-package guix))
+ (system-test-value test)))))
+ (match (getenv "TESTS")
+ (#f
+ (all-system-tests))
+ ((= string-tokenize (tests ...))
+ (filter (lambda (test)
+ (member (system-test-name test) tests))
+ (all-system-tests)))))))
(define (system-test->manifest-entry test)
"Return a manifest entry for TEST, a system test."
;; Intern SOURCE so that 'build-from-source' in (guix channels) sees
;; "fresh" file names and thus doesn't find itself loading .go files
;; from ~/.cache/guile when it loads 'build-aux/build-self.scm'.
- (let* ((source (local-file source "guix-source"
+ (let* ((source (local-file source
+ (if commit
+ (string-append "guix-"
+ (string-take commit 7))
+ "guix-source")
#:recursive? #t
#:select?
(or (git-predicate source)