Skip to content

Commit 30e6e90

Browse files
authored
Merge pull request #2469 from GaloisInc/error-line-numbers
Hide the line number of "error" in the test suite
2 parents c2ad086 + c391b9b commit 30e6e90

File tree

8 files changed

+15
-7
lines changed

8 files changed

+15
-7
lines changed

intTests/support/test-and-diff.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,20 @@ run-tests() {
136136
# use default Show instances and the saw-core positions carry
137137
# the directory and filename separately. This becomes
138138
# "interesting" from a quoting perspective...
139+
#
140+
# Furthermore, prune the line number from the results of
141+
# hitting the Haskell "error" function. SAW isn't supposed to
142+
# use "error", but it does, and some things trigger it, and
143+
# having the source line number in the reference outputs is
144+
# super aggravating because it changes all the time, usually
145+
# when you aren't expecting it.
139146
sed < $TEST.rawlog '
140147
/^\[[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]\] /{
141148
s/^..............//
142149
}
143150
s,'"$CURDIR"'/,,g
144151
s,"'"$CURDIR"'",".",g
152+
/^ error, called at [^ :]*\.hs:[0-9:]* in saw-/s/\.hs:.*/.hs/
145153
' | (
146154
# If there's a custom postprocess script for this test,
147155
# chain it in.

intTests/test1646/test2.log.good

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
x=a
33
fromValue Text
44
CallStack (from HasCallStack):
5-
error, called at saw-script/src/SAWScript/Interpreter.hs:1110:19 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
5+
error, called at saw-script/src/SAWScript/Interpreter.hs
66
FAILED
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Loading file "undefined2.saw"
22
interpret: undefined
33
CallStack (from HasCallStack):
4-
error, called at saw-script/src/SAWScript/Interpreter.hs:4052:14 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
4+
error, called at saw-script/src/SAWScript/Interpreter.hs
55
FAILED
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Loading file "undefined3.saw"
22
interpret: undefined
33
CallStack (from HasCallStack):
4-
error, called at saw-script/src/SAWScript/Interpreter.hs:4052:14 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
4+
error, called at saw-script/src/SAWScript/Interpreter.hs
55
FAILED

intTests/test_sawscript_builtins/undefined4.log.good

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
not dead yet
33
interpret: undefined
44
CallStack (from HasCallStack):
5-
error, called at saw-script/src/SAWScript/Interpreter.hs:4052:14 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
5+
error, called at saw-script/src/SAWScript/Interpreter.hs
66
FAILED

intTests/test_sawscript_builtins/undefined5.log.good

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
still not dead
44
interpret: undefined
55
CallStack (from HasCallStack):
6-
error, called at saw-script/src/SAWScript/Interpreter.hs:4052:14 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
6+
error, called at saw-script/src/SAWScript/Interpreter.hs
77
FAILED

intTests/test_sawscript_builtins/undefined6.log.good

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
still not dead
44
interpret: undefined
55
CallStack (from HasCallStack):
6-
error, called at saw-script/src/SAWScript/Interpreter.hs:4052:14 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
6+
error, called at saw-script/src/SAWScript/Interpreter.hs
77
FAILED
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Loading file "undefined7.saw"
22
interpret: undefined
33
CallStack (from HasCallStack):
4-
error, called at saw-script/src/SAWScript/Interpreter.hs:4052:14 in saw-1.3.0.99-inplace-saw-script:SAWScript.Interpreter
4+
error, called at saw-script/src/SAWScript/Interpreter.hs
55
FAILED

0 commit comments

Comments
 (0)