aboutsummaryrefslogtreecommitdiff
path: root/guix/tests.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/tests.scm')
-rw-r--r--guix/tests.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/tests.scm b/guix/tests.scm
index 87e6cc2830..a19eda250c 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -63,8 +63,16 @@
store)))
+(define (random-seed)
+ (or (and=> (getenv "GUIX_TESTS_RANDOM_SEED")
+ number->string)
+ (logxor (getpid) (car (gettimeofday)))))
+
(define %seed
- (seed->random-state (logxor (getpid) (car (gettimeofday)))))
+ (let ((seed (random-seed)))
+ (format (current-error-port) "random seed for tests: ~a~%"
+ seed)
+ (seed->random-state seed)))
(define (random-text)
"Return the hexadecimal representation of a random number."