summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gran <spk121@yahoo.com>2023-06-20 11:42:33 -0700
committerMichael Gran <spk121@yahoo.com>2025-03-30 20:12:17 -0700
commit12861e2bc259ef7bb03604ce7ebfc755ba77ad3b (patch)
tree8d554c87f400f5791cdb27b1b5fe93d6be1f7a49
parentd512ec06575a44f3cbefae6524acb8e84791cd8e (diff)
downloadguile-12861e2bc259ef7bb03604ce7ebfc755ba77ad3b.tar.gz
Skip tests that require alarm or SIGALRM when not supported
* test-suite/tests/sandbox.test ("time limit"): skip if unsupported * test-suite/tests/time.test ("gmtime"): skip if unsupported
-rw-r--r--test-suite/tests/sandbox.test4
-rw-r--r--test-suite/tests/time.test4
2 files changed, 7 insertions, 1 deletions
diff --git a/test-suite/tests/sandbox.test b/test-suite/tests/sandbox.test
index 96651a2b1..54fb79495 100644
--- a/test-suite/tests/sandbox.test
+++ b/test-suite/tests/sandbox.test
@@ -40,13 +40,17 @@
(with-test-prefix "time limit"
(pass-if "0 busy loop"
+ (unless (defined? 'SIGALRM) (throw 'unsupported))
(call-with-time-limit 0 busy-loop (lambda () #t)))
(pass-if "0.001 busy loop"
+ (unless (defined? 'SIGALRM) (throw 'unsupported))
(call-with-time-limit 0.001 busy-loop (lambda () #t)))
(pass-if "0 sleep"
+ (unless (defined? 'SIGALRM) (throw 'unsupported))
(call-with-time-limit 0 (lambda () (usleep-loop #e1e6) #f)
(lambda () #t)))
(pass-if "0.001 sleep"
+ (unless (defined? 'SIGALRM) (throw 'unsupported))
(call-with-time-limit 0.001 (lambda () (usleep-loop #e1e6) #f)
(lambda () #t))))
diff --git a/test-suite/tests/time.test b/test-suite/tests/time.test
index b5c7dbc36..72ad5bb15 100644
--- a/test-suite/tests/time.test
+++ b/test-suite/tests/time.test
@@ -29,7 +29,9 @@
(for-each (lambda (t)
(pass-if (list "in another thread after error" t)
- (or (provided? 'threads) (throw 'unsupported))
+ (unless (and (provided? 'threads)
+ (defined? 'alarm))
+ (throw 'unsupported))
(alarm 5)
(false-if-exception (gmtime t))