mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Skip tests that require STATPROF when not supported
* test-suite/tests/statprof.test (when-implemented): throw unresolved when SIGPROF unavailable
This commit is contained in:
parent
f187c46bd9
commit
d512ec0657
1 changed files with 11 additions and 9 deletions
|
@ -36,15 +36,17 @@
|
|||
;; on platforms such as GNU/Hurd or Cygwin where `ITIMER_PROF' is is
|
||||
;; currently unimplemented.
|
||||
(define-syntax-rule (when-implemented body ...)
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
body ...)
|
||||
(lambda args
|
||||
(let ((errno (system-error-errno args)))
|
||||
(false-if-exception (statprof-stop))
|
||||
(if (or (= errno ENOSYS) (= errno EINVAL))
|
||||
(throw 'unresolved)
|
||||
(apply throw args))))))
|
||||
(begin
|
||||
(unless (defined? 'SIGPROF) (throw 'unresolved))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
body ...)
|
||||
(lambda args
|
||||
(let ((errno (system-error-errno args)))
|
||||
(false-if-exception (statprof-stop))
|
||||
(if (or (= errno ENOSYS) (= errno EINVAL))
|
||||
(throw 'unresolved)
|
||||
(apply throw args)))))))
|
||||
|
||||
(pass-if-equal "return values"
|
||||
'(42 77)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue