aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/tests.scm
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2022-04-26 08:20:08 +0000
committerNIIBE Yutaka <[email protected]>2022-04-26 08:20:08 +0000
commitf27a70ecc268f9318dbf87d23c451a3bad464ed1 (patch)
treee7b5769bd2951d9f463e4381d199605fae1d5513 /tests/gpgscm/tests.scm
parenttests: Support single invocation with variant. (diff)
downloadgnupg-f27a70ecc268f9318dbf87d23c451a3bad464ed1.tar.gz
gnupg-f27a70ecc268f9318dbf87d23c451a3bad464ed1.zip
tests: Avoid auto-removal when test fails.
* tests/gpgscm/init.scm (*exit-status*): New. (exit): Set *exit-status*. * tests/gpgscm/tests.scm (mkdtemp-autoremove): Check exit-status and only remove the directory if not zero. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'tests/gpgscm/tests.scm')
-rw-r--r--tests/gpgscm/tests.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index 51410020e..dbeda74d7 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -288,7 +288,7 @@
;; Otherwise this works like mkdtemp.
(define (mkdtemp-autoremove . components)
(let ((dir (apply mkdtemp components)))
- (atexit (lambda () (unlink-recursively dir)))
+ (atexit (lambda () (if (= *exit-status* 0) (unlink-recursively dir))))
dir))
(define-macro (with-temporary-working-directory . expressions)