From add4c026ad10b5311c5699e3412e5d8dbdbb8129 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 25 Aug 2019 12:16:16 +0200 Subject: [PATCH 2/2] Run scrutiny tests with -specialize There used to be cases where you'd get errors when specializing but not when just analyzing. Fixes #1470 (the test in question is gone now, though) --- tests/runtests.sh | 8 +- tests/scrutiny-2.expected | 355 +++++++++++++++++++++++++++++++++++++- tests/scrutiny.expected | 16 +- 3 files changed, 361 insertions(+), 18 deletions(-) diff --git a/tests/runtests.sh b/tests/runtests.sh index 1811cc35..2c85d71c 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -113,10 +113,10 @@ $compile scrutinizer-tests.scm -analyze-only $compile typematch-tests.scm -specialize -no-warnings ./a.out -$compile test-scrutinizer-message-format.scm -A -specialize 2>scrutinizer-message-format.out || true -$compile scrutiny-tests.scm -A 2>scrutiny.out -$compile scrutiny-tests-2.scm -A 2>scrutiny-2.out -$compile specialization-tests.scm -A -specialize 2>specialization.out +$compile test-scrutinizer-message-format.scm -analyze-only -specialize 2>scrutinizer-message-format.out || true +$compile scrutiny-tests.scm -analyze-only -specialize 2>scrutiny.out +$compile scrutiny-tests-2.scm -analyze-only -specialize 2>scrutiny-2.out +$compile specialization-tests.scm -analyze-only -specialize -specialize 2>specialization.out # Replace foo123 -> fooXX so gensyms don't trigger failures $compile redact-gensyms.scm -o redact-gensyms diff --git a/tests/scrutiny-2.expected b/tests/scrutiny-2.expected index cd406985..dc369518 100644 --- a/tests/scrutiny-2.expected +++ b/tests/scrutiny-2.expected @@ -18,6 +18,18 @@ Note: Predicate is always true (pair fixnum fixnum) +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(pair? p))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -35,6 +47,18 @@ Note: Predicate is always false null +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -52,6 +76,18 @@ Note: Predicate is always false null +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -69,6 +105,18 @@ Note: Predicate is always false fixnum +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -86,6 +134,18 @@ Note: Predicate is always false float +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -103,6 +163,18 @@ Note: Predicate is always true null +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(list? l))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -120,6 +192,47 @@ Note: Predicate is always true null +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(list? n))) + + Test condition has always true value of type: + + true + +Note: Predicate is always false + In file `scrutiny-tests-2.scm:XXX', + At the toplevel, + In procedure call: + + (scheme#list? p) + + The predicate will always return false. + + Procedure `list?' from module `scheme' is a predicate for: + + list + + The given argument has this type: + + (pair fixnum fixnum) + +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -137,6 +250,18 @@ Note: Predicate is always false fixnum +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -154,6 +279,18 @@ Note: Predicate is always false float +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -171,6 +308,18 @@ Note: Predicate is always true null +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(null? n))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -188,6 +337,18 @@ Note: Predicate is always true null +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(null? l))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -203,7 +364,19 @@ Note: Predicate is always false The given argument has this type: - pair + (pair fixnum fixnum) + +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', @@ -222,6 +395,18 @@ Note: Predicate is always false fixnum +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -239,6 +424,18 @@ Note: Predicate is always false float +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -256,6 +453,18 @@ Note: Predicate is always true fixnum +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(fixnum? i))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -273,6 +482,47 @@ Note: Predicate is always false float +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + +Note: Predicate is always false + In file `scrutiny-tests-2.scm:XXX', + At the toplevel, + In procedure call: + + (chicken.base#fixnum? u) + + The predicate will always return false. + + Procedure `fixnum?' from module `chicken.base' is a predicate for: + + fixnum + + The given argument has this type: + + float + +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -290,6 +540,47 @@ Note: Predicate is always true float +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(flonum? f))) + + Test condition has always true value of type: + + true + +Note: Predicate is always true + In file `scrutiny-tests-2.scm:XXX', + At the toplevel, + In procedure call: + + (chicken.base#flonum? u) + + The predicate will always return true. + + Procedure `flonum?' from module `chicken.base' is a predicate for: + + float + + The given argument has this type: + + float + +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(flonum? u))) + + Test condition has always true value of type: + + true + Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -307,6 +598,18 @@ Note: Predicate is always false fixnum +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -324,6 +627,18 @@ Note: Predicate is always true fixnum +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(number? i))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -341,6 +656,18 @@ Note: Predicate is always true float +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(number? f))) + + Test condition has always true value of type: + + true + Note: Predicate is always true In file `scrutiny-tests-2.scm:XXX', At the toplevel, @@ -356,7 +683,19 @@ Note: Predicate is always true The given argument has this type: - number + float + +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(number? u))) + + Test condition has always true value of type: + + true Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', @@ -374,3 +713,15 @@ Note: Predicate is always false The given argument has this type: null + +Note: Test is always true + At the toplevel, + In conditional expression: + + (if tmp + tmp + (##sys#error "(scrutiny-tests-2.scm:XXX) assertion failed" '(not ...))) + + Test condition has always true value of type: + + true diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected index b93f9d23..afc7b415 100644 --- a/tests/scrutiny.expected +++ b/tests/scrutiny.expected @@ -661,22 +661,14 @@ Note: Predicate is always false fixnum -Note: Predicate is always false +Note: Test is always false In file `scrutiny-tests.scm:XXX', At the toplevel, - In procedure call: - - (scheme#symbol? x) - - The predicate will always return false. - - Procedure `symbol?' from module `scheme' is a predicate for: - - symbol + In conditional expression: - The given argument has this type: + (if (char-or-string? x) (scheme#symbol? x) (scheme#string? x)) - (or char string) + Test condition is always false. Note: Predicate is always false In file `scrutiny-tests.scm:XXX', -- 2.20.1