Skip to content

Commit b5f6d74

Browse files
committed
test: Remove mutation of the exit-status
And instead exit as soon as something fails. It will now only return the value of EXIT_SUCCESS or EXIT_FAILURE depending if it succeeded or not.
1 parent 7925566 commit b5f6d74

1 file changed

Lines changed: 10 additions & 21 deletions

File tree

‎tests/runner.scm‎

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,7 @@ Fredrik \"PlaTFooT\" Salomonsson
613613
(format #t " sender: ~a~%" sender)
614614
(format #t " receiver: ~a~%" receiver)
615615
(format #t " expected: ~a~%" expected)
616-
(let ((exit-status 0)
617-
(sender-snapshots
616+
(let ((sender-snapshots
618617
(map (lambda (input)
619618
(make-snapshot-from input))
620619
sender))
@@ -628,7 +627,6 @@ Fredrik \"PlaTFooT\" Salomonsson
628627
(let ((snapshot (make-snapshot-from input)))
629628
(cons (snapshot-id snapshot) snapshot)))
630629
expected))))
631-
;; Setup
632630
(setup sender-snapshots
633631
sender-dir
634632
receiver-snapshots
@@ -637,22 +635,13 @@ Fredrik \"PlaTFooT\" Salomonsson
637635
(match type
638636
('denotebak create-denotebak-snapshot)
639637
(_ create-snapper-snapshot)))
640-
641-
;; Run command
642-
(set! exit-status
643-
(run command configfile options test-dir sender-dir receiver-dir))
644-
645-
;; Check
646-
(when (not (check receiver-dir
647-
expected-snapshots
648-
(option-ref options 'expected-latest #f)
649-
(match type
650-
('denotebak make-snapshot-from-denotebak-read)
651-
(_ make-snapshot-from-snapper-read))))
652-
(set! exit-status 1))
653-
654-
;; Clean up
655-
(clean-up test-dir)
656-
657-
(exit exit-status)))))
638+
(exit (and
639+
(= (run command configfile options test-dir sender-dir receiver-dir) 0)
640+
(check receiver-dir
641+
expected-snapshots
642+
(option-ref options 'expected-latest #f)
643+
(match type
644+
('denotebak make-snapshot-from-denotebak-read)
645+
(_ make-snapshot-from-snapper-read)))
646+
(clean-up test-dir)))))))
658647

0 commit comments

Comments
 (0)