mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
tests: Add a mechanism to describe and discover system tests.
* gnu/tests.scm (<system-test>): New record type. (write-system-test, test-modules, fold-system-tests) (all-system-tests): New procedures. * gnu/tests/base.scm (%test-basic-os): Turn into a <system-test>. * gnu/tests/install.scm (%test-installed-os): Likewise. * build-aux/run-system-tests.scm (%system-tests): Remove. (run-system-tests): Use 'all-system-tests'.
This commit is contained in:
parent
2a6ba87086
commit
98b65b5ff6
5 changed files with 112 additions and 38 deletions
|
@ -17,8 +17,7 @@
|
|||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (run-system-tests)
|
||||
#:use-module (gnu tests base)
|
||||
#:use-module (gnu tests install)
|
||||
#:use-module (gnu tests)
|
||||
#:use-module (guix store)
|
||||
#:use-module (guix monads)
|
||||
#:use-module (guix derivations)
|
||||
|
@ -45,14 +44,16 @@
|
|||
lst)
|
||||
(lift1 reverse %store-monad))))
|
||||
|
||||
(define %system-tests
|
||||
(list %test-basic-os
|
||||
%test-installed-os))
|
||||
|
||||
(define (run-system-tests . args)
|
||||
(define tests
|
||||
(all-system-tests))
|
||||
|
||||
(format (current-error-port) "Running ~a system tests...~%"
|
||||
(length tests))
|
||||
|
||||
(with-store store
|
||||
(run-with-store store
|
||||
(mlet* %store-monad ((drv (sequence %store-monad %system-tests))
|
||||
(mlet* %store-monad ((drv (mapm %store-monad system-test-value tests))
|
||||
(out -> (map derivation->output-path drv)))
|
||||
(mbegin %store-monad
|
||||
(show-what-to-build* drv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue