On 2019-01-10 18:12, megane wrote:
> Evan Hanson writes:
> > Here's a signed-off version of the first patch in this set. I've also
> > updated the Windows test script and added the new files to the
> > distribution manifest.
> >
> > Please feel free to review and apply this one without waiting for the
> > others in megane's message. Doing it gradually is the only way we'll get
> > through all these.
>
> You'll have to redo your changes to the first patch, sorry about that.
No worries, here's the same again with a sign-off.
> Do you agree with approach I took about gensym'd variables in the second
> patch? If not, I think I'll have to come up with something else.
That's a nice idea, I think it's probably fine. But if we're going to do
that, why not wipe line numbers in all the expected files rather than
just the new one?
> diff --git a/tests/redact-gensyms.scm b/tests/redact-gensyms.scm
> new file mode 100644
> index 000..c6abb7b
> --- /dev/null
> +++ b/tests/redact-gensyms.scm
> @@ -0,0 +1,25 @@
> + (define prefixes (if (null? (command-line-arguments))
> + '("tmp" "g")
> + (string-split (car (command-line-arguments)) ",")))
> +
> + (let ((rege (irregex `(: ($ (or ,@prefixes)) (+ numeric)
This regex could be `(: bow ($ (or ,@prefixes)) (+ numeric)) so you avoid
accidentally replacing numbers in something like a variable called "dog1".
Evan
>From 76d260fab399e4cb6679e923ffdef496201d2fcd Mon Sep 17 00:00:00 2001
From: megane
Date: Mon, 19 Nov 2018 10:01:33 +0200
Subject: [PATCH] Add new test for scrutinizer message formatting
This makes it easy to see how scrutinizer changes affect the user facing
output messages.
In the test scripts, move scrutiny-tests-2.scm up so all output is
generated before diffing anything. This way you can update all expected
message files at the same time.
Signed-off-by: Evan Hanson
---
distribution/manifest | 2 +
tests/runtests.bat| 10 +-
tests/runtests.sh | 6 +-
tests/scrutinizer-message-format.expected | 261 ++
tests/test-scrutinizer-message-format.scm | 87 ++
5 files changed, 362 insertions(+), 4 deletions(-)
create mode 100644 tests/scrutinizer-message-format.expected
create mode 100644 tests/test-scrutinizer-message-format.scm
diff --git a/distribution/manifest b/distribution/manifest
index 9c1dcfdb..c1a615ea 100644
--- a/distribution/manifest
+++ b/distribution/manifest
@@ -176,6 +176,8 @@ tests/scrutiny-tests-2.scm
tests/scrutiny-tests-3.scm
tests/scrutiny.expected
tests/scrutiny-2.expected
+tests/test-scrutinizer-message-format.scm
+tests/scrutinizer-message-format.expected
tests/syntax-rule-stress-test.scm
tests/syntax-tests.scm
tests/syntax-tests-2.scm
diff --git a/tests/runtests.bat b/tests/runtests.bat
index f739a297..47d80c0c 100644
--- a/tests/runtests.bat
+++ b/tests/runtests.bat
@@ -92,19 +92,25 @@ echo scrutiny tests ...
if errorlevel 1 exit /b 1
a.out
if errorlevel 1 exit /b 1
+
%compile% scrutiny-tests.scm -A -verbose 2>scrutiny.out
if errorlevel 1 exit /b 1
rem this is sensitive to gensym-names, so make it optional
if not exist scrutiny.expected copy /Y scrutiny.out scrutiny.expected
-fc /lb%FCBUFSIZE% /w scrutiny.expected scrutiny.out
+%compile% scrutiny-tests-2.scm -A -verbose 2>scrutiny-2.out
if errorlevel 1 exit /b 1
+%compile% test-scrutinizer-message-format.scm -A -verbose 2>scrutinizer-message-format.out
+rem this is expected to fail, so no errorlevel check
-%compile% scrutiny-tests-2.scm -A -verbose 2>scrutiny-2.out
+fc /lb%FCBUFSIZE% /w scrutinizer-message-format.expected scrutinizer-message-format.out
+if errorlevel 1 exit /b 1
+fc /lb%FCBUFSIZE% /w scrutiny.expected scrutiny.out
if errorlevel 1 exit /b 1
if not exist scrutiny-2.expected copy /Y scrutiny-2.out scrutiny-2.expected
+
fc /lb%FCBUFSIZE% /w scrutiny-2.expected scrutiny-2.out
if errorlevel 1 exit /b 1
diff --git a/tests/runtests.sh b/tests/runtests.sh
index 6da7630d..c6f9252e 100755
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -123,11 +123,13 @@ if test \! -f specialization.expected; then
cp specialization.expected specialization.out
fi
+$compile scrutiny-tests-2.scm -A -verbose 2>scrutiny-2.out
+$compile test-scrutinizer-message-format.scm -A -verbose 2>scrutinizer-message-format.out || true
+
+diff $DIFF_OPTS scrutinizer-message-format.expected scrutinizer-message-format.out
diff $DIFF_OPTS scrutiny.expected scrutiny.out
diff $DIFF_OPTS specialization.expected specialization.out
-$compile scrutiny-tests-2.scm -A 2>scrutiny-2.out -verbose
-
# this is sensitive to gensym-names, so make it optional
if test \! -f scrutiny-2.expected; then
cp scrutiny-2.expected scrutiny-2.out
diff --git a/tests/scrutinizer-message-format.expected b/tests/scrutinizer-message-format.expected
new file mode 100644
index ..f41fb898