SummaryRefsLogTreeCommitDiffStats
path: root/tests/base.scm
diff options
context:
space:
mode:
authorDale Mellor <mcron-lsfnyl@rdmp.org>2022-07-07 16:51:31 +0100
committerDale Mellor <mcron-lsfnyl@rdmp.org>2022-07-07 16:51:31 +0100
commite2ecb8045bc9789b109b1e7e0b282269a33ca9fb (patch)
tree1cc499e54f84052838260537cc94ecd46ccd0db6 /tests/base.scm
parenta7a456cd6fab22eab69303a4430edf5501187299 (diff)
downloadmcron-e2ecb8045bc9789b109b1e7e0b282269a33ca9fb.tar.gz
mcron-e2ecb8045bc9789b109b1e7e0b282269a33ca9fb.tar.bz2
mcron-e2ecb8045bc9789b109b1e7e0b282269a33ca9fb.zip
Give mcron --log option to turn logging on.
This makes the behaviour backwards compatible with all previous uses of mcron. * src/mcron/base.scm: establish %do-logging parameter and act on it * src/mcron/scripts/mcron.scm: set %do-logging according to command line * tests/base.scm: some tests require %do-logging to be set
Diffstat (limited to 'tests/base.scm')
-rw-r--r--tests/base.scm18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/base.scm b/tests/base.scm
index 914b4c6..7d7b6d7 100644
--- a/tests/base.scm
+++ b/tests/base.scm
@@ -234,13 +234,14 @@
(sigaction SIGCHLD SIG_DFL))))))
(test-assert "run-job, output"
- (let ((output (dummy-job/capture-output
- (lambda ()
- (format #t "output line 1~%")
- (format #t "output line 2\nand 3~%")
- (system "echo poutine")
- (format (current-error-port)
- "some error~%")))))
+ (let ((output (parameterize ((%do-logging #t))
+ (dummy-job/capture-output
+ (lambda ()
+ (format #t "output line 1~%")
+ (format #t "output line 2\nand 3~%")
+ (system "echo poutine")
+ (format (current-error-port)
+ "some error~%"))))))
(assert (string-contains output "dummy: running"))
(assert (string-contains output "dummy: output line 1"))
(assert (string-contains output "dummy: and 3"))
@@ -270,7 +271,8 @@
(const #t)))
(test-assert "run-job, output with custom format"
- (let ((output (parameterize ((%log-format "the message only: ~3@*~a~%"))
+ (let ((output (parameterize ((%do-logging #t)
+ (%log-format "the message only: ~3@*~a~%"))
(dummy-job/capture-output
(lambda ()
(format #t "output line 1~%"))))))