Skip floating-point trap tests if the host doesn't support them.
authorTaylor R Campbell <campbell@mumble.net>
Tue, 13 Nov 2018 07:25:36 +0000 (07:25 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Tue, 13 Nov 2018 07:25:36 +0000 (07:25 +0000)
tests/microcode/test-flonum-except.scm

index 2eb0a1608eef17b208370f50f5db53d93c52b80c..3cbaa4271b8f9361c5357b422a331723ddb9fe3a 100644 (file)
@@ -68,12 +68,15 @@ USA.
       (flo:preserving-environment
        (lambda ()
         (flo:clear-exceptions! (flo:supported-exceptions))
-        (flo:with-exceptions-untrapped (flo:supported-exceptions)
-          (lambda ()
-            (with-failure-expected xfail?
-              (lambda ()
-                (assertion (procedure))
-                (assert-nonzero (flo:test-exceptions exception)))))))))))
+        ((lambda (body)
+           (if (flo:have-trap-enable/disable?)
+               (flo:with-exceptions-untrapped (flo:supported-exceptions) body)
+               (body)))
+         (lambda ()
+           (with-failure-expected xfail?
+             (lambda ()
+               (assertion (procedure))
+               (assert-nonzero (flo:test-exceptions exception)))))))))))
 
 (define (define-exception-trap-test name excname exception condition-type
          procedure #!optional xfail?)
@@ -81,7 +84,10 @@ USA.
     (lambda ()
       (flo:preserving-environment
        (lambda ()
-        (with-failure-expected xfail?
+        (with-failure-expected
+            (if (flo:have-trap-enable/disable?)
+                xfail?
+                'xerror)
           (lambda ()
             (assert-error
              (lambda ()