guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: tests: Make sure /run/current-system is a GC root.


From: Ludovic Courtès
Subject: 03/04: tests: Make sure /run/current-system is a GC root.
Date: Sun, 28 Aug 2016 22:09:52 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 40d28609f759b1445583f6f77005f92295f1213b
Author: Ludovic Courtès <address@hidden>
Date:   Sun Aug 28 23:15:27 2016 +0200

    tests: Make sure /run/current-system is a GC root.
    
    * gnu/tests/base.scm (run-basic-test)["/run/current-system is a GC
    root"]: New test.
---
 gnu/tests/base.scm |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 7170ab1..0076566 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -190,6 +190,33 @@ info --version")
                                   (setlocale LC_ALL before)))
                              marionette))
 
+          (test-assert "/run/current-system is a GC root"
+            (marionette-eval '(begin
+                                ;; Make sure the (guix …) modules are found.
+                                (eval-when (expand load eval)
+                                  (set! %load-path
+                                    (cons
+                                     (string-append
+                                      
"/run/current-system/profile/share/guile/site/"
+                                      (effective-version))
+                                     %load-path))
+                                  (set! %load-compiled-path
+                                    (cons
+                                     (string-append
+                                      
"/run/current-system/profile/share/guile/site/"
+                                      (effective-version))
+                                     %load-compiled-path)))
+
+                                (use-modules (srfi srfi-34) (guix store))
+
+                                (let ((system (readlink 
"/run/current-system")))
+                                  (guard (c ((nix-protocol-error? c)
+                                             (file-exists? system)))
+                                    (with-store store
+                                      (delete-paths store (list system))
+                                      #f))))
+                             marionette))
+
           (test-assert "screendump"
             (begin
               (marionette-control (string-append "screendump " #$output



reply via email to

[Prev in Thread] Current Thread [Next in Thread]