mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 22:40:34 +02:00
Test suite compile-and-eval tests run -O0 and -O2
* test-suite/test-suite/lib.scm (c&e): Test -O0 and -O2.
This commit is contained in:
parent
2e6f2feefc
commit
21885aa4ba
1 changed files with 22 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
;;;; test-suite/lib.scm --- generic support for testing
|
||||
;;;; Copyright (C) 1999-2001,2004,2006-2007,2009-2014,2018
|
||||
;;;; Copyright (C) 1999-2001,2004,2006-2007,2009-2014,2016,2018,2020
|
||||
;;;; Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This program is free software; you can redistribute it and/or
|
||||
|
@ -466,20 +466,31 @@
|
|||
(c&e (pass-if "[unnamed test]" exp)))
|
||||
((_ (pass-if test-name exp))
|
||||
(begin (pass-if (string-append test-name " (eval)")
|
||||
(primitive-eval 'exp))
|
||||
(pass-if (string-append test-name " (compile)")
|
||||
(compile 'exp #:to 'value #:env (current-module)))))
|
||||
(primitive-eval 'exp))
|
||||
(pass-if (string-append test-name " (compile -O0)")
|
||||
(compile 'exp #:to 'value #:env (current-module)
|
||||
#:optimization-level 0))
|
||||
(pass-if (string-append test-name " (compile -O2)")
|
||||
(compile 'exp #:to 'value #:env (current-module)
|
||||
#:optimization-level 2))))
|
||||
((_ (pass-if-equal test-name val exp))
|
||||
(begin (pass-if-equal (string-append test-name " (eval)") val
|
||||
(primitive-eval 'exp))
|
||||
(pass-if-equal (string-append test-name " (compile)") val
|
||||
(compile 'exp #:to 'value #:env (current-module)))))
|
||||
(pass-if-equal (string-append test-name " (compile -O0)") val
|
||||
(compile 'exp #:to 'value #:env (current-module)
|
||||
#:optimization-level 0))
|
||||
(pass-if-equal (string-append test-name " (compile -O2)") val
|
||||
(compile 'exp #:to 'value #:env (current-module)
|
||||
#:optimization-level 2))))
|
||||
((_ (pass-if-exception test-name exc exp))
|
||||
(begin (pass-if-exception (string-append test-name " (eval)")
|
||||
exc (primitive-eval 'exp))
|
||||
(pass-if-exception (string-append test-name " (compile)")
|
||||
exc (compile 'exp #:to 'value
|
||||
#:env (current-module)))))))
|
||||
(begin (pass-if-exception (string-append test-name " (eval)") exc
|
||||
(primitive-eval 'exp))
|
||||
(pass-if-exception (string-append test-name " (compile -O0)") exc
|
||||
(compile 'exp #:to 'value #:env (current-module)
|
||||
#:optimization-level 0))
|
||||
(pass-if-exception (string-append test-name " (compile -O2)") exc
|
||||
(compile 'exp #:to 'value #:env (current-module)
|
||||
#:optimization-level 2))))))
|
||||
|
||||
;;; (with-test-prefix/c&e PREFIX BODY ...)
|
||||
;;; Same as `with-test-prefix', but the enclosed tests are run both with
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue