[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/10: tests: Write the random seed to the error port.
From: |
Ludovic Courtès |
Subject: |
08/10: tests: Write the random seed to the error port. |
Date: |
Thu, 11 Jun 2015 21:33:44 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 79477def6b08437e4eacaf67c012ae8717bd64e3
Author: Ludovic Courtès <address@hidden>
Date: Thu Jun 11 23:17:16 2015 +0200
tests: Write the random seed to the error port.
* guix/tests.scm (random-seed): New procedure.
(%seed): Use it, and write the random seed to the error port.
---
guix/tests.scm | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/guix/tests.scm b/guix/tests.scm
index 87e6cc2..a19eda2 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."
- branch master updated (b45ce07 -> 6c35641), Ludovic Courtès, 2015/06/11
- 02/10: records: Separate default-value handling., Ludovic Courtès, 2015/06/11
- 04/10: records: "options" → "properties"., Ludovic Courtès, 2015/06/11
- 03/10: records: Factorize field property predicates., Ludovic Courtès, 2015/06/11
- 01/10: records: Replace 'eval-when' with a proper 'define-syntax'., Ludovic Courtès, 2015/06/11
- 05/10: records: Add support for 'innate' fields., Ludovic Courtès, 2015/06/11
- 07/10: gnu: guix: Update snapshot., Ludovic Courtès, 2015/06/11
- 06/10: packages: Make 'location' field innate., Ludovic Courtès, 2015/06/11
- 08/10: tests: Write the random seed to the error port.,
Ludovic Courtès <=
- 10/10: tests: Avoid sequence of zero expressions., Ludovic Courtès, 2015/06/11
- 09/10: records: Remove unnecessary 'begin'., Ludovic Courtès, 2015/06/11