base: Check 'run-job'
* tests/base.scm ("run-job: basic"): New test.
This commit is contained in:
parent
526ce502e5
commit
d1e0d2a8f7
1 changed files with 16 additions and 0 deletions
|
|
@ -158,6 +158,7 @@
|
|||
|
||||
;;; Import private procedures.
|
||||
(define update-number-children! (@@ (mcron base) update-number-children!))
|
||||
(define run-job (@@ (mcron base) run-job))
|
||||
|
||||
;;; Check 'number-children' initial value.
|
||||
(let ((schdl (make-schedule '() '() 'user)))
|
||||
|
|
@ -180,4 +181,19 @@
|
|||
1
|
||||
(unbox number-children)))
|
||||
|
||||
;;; Check 'run-job' basic call.
|
||||
;;; XXX: Having to use the filesystem for a unit test is wrong.
|
||||
(let* ((filename (tmpnam))
|
||||
(action (λ () (close-port (open-output-file filename))))
|
||||
(job (make-dummy-job #:user (getpw (getuid)) #:action action)))
|
||||
(dynamic-wind
|
||||
(λ ()
|
||||
(run-job job)
|
||||
(waitpid WAIT_ANY))
|
||||
(λ ()
|
||||
(test-assert "run-job: basic"
|
||||
(access? filename F_OK)))
|
||||
(λ ()
|
||||
(delete-file filename))))
|
||||
|
||||
(test-end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue