mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
testament: remove unused tfile,tline,tcolumn (#17515)
This commit is contained in:
@@ -79,8 +79,6 @@ type
|
||||
sortoutput*: bool
|
||||
output*: string
|
||||
line*, column*: int
|
||||
tfile*: string
|
||||
tline*, tcolumn*: int
|
||||
exitCode*: int
|
||||
msg*: string
|
||||
ccodeCheck*: seq[string]
|
||||
@@ -277,12 +275,6 @@ proc parseSpec*(filename: string): TSpec =
|
||||
if result.msg.len == 0 and result.nimout.len == 0:
|
||||
result.parseErrors.addLine "errormsg or msg needs to be specified before column"
|
||||
discard parseInt(e.value, result.column)
|
||||
of "tfile":
|
||||
result.tfile = e.value
|
||||
of "tline":
|
||||
discard parseInt(e.value, result.tline)
|
||||
of "tcolumn":
|
||||
discard parseInt(e.value, result.tcolumn)
|
||||
of "output":
|
||||
if result.outputCheck != ocSubstr:
|
||||
result.outputCheck = ocEqual
|
||||
|
||||
@@ -82,12 +82,6 @@ type
|
||||
let
|
||||
pegLineError =
|
||||
peg"{[^(]*} '(' {\d+} ', ' {\d+} ') ' ('Error') ':' \s* {.*}"
|
||||
|
||||
pegLineTemplate =
|
||||
peg"""
|
||||
{[^(]*} '(' {\d+} ', ' {\d+} ') '
|
||||
'template/generic instantiation' ( ' of `' [^`]+ '`' )? ' from here' .*
|
||||
"""
|
||||
pegOtherError = peg"'Error:' \s* {.*}"
|
||||
pegOfInterest = pegLineError / pegOtherError
|
||||
|
||||
@@ -165,7 +159,6 @@ proc callCompiler(cmdTemplate, filename, options, nimcache: string,
|
||||
let outp = p.outputStream
|
||||
var suc = ""
|
||||
var err = ""
|
||||
var tmpl = ""
|
||||
var x = newStringOfCap(120)
|
||||
result.nimout = ""
|
||||
while true:
|
||||
@@ -174,9 +167,6 @@ proc callCompiler(cmdTemplate, filename, options, nimcache: string,
|
||||
if x =~ pegOfInterest:
|
||||
# `err` should contain the last error/warning message
|
||||
err = x
|
||||
elif x =~ pegLineTemplate and err == "":
|
||||
# `tmpl` contains the last template expansion before the error
|
||||
tmpl = x
|
||||
elif x.isSuccess:
|
||||
suc = x
|
||||
elif not running(p):
|
||||
@@ -187,14 +177,7 @@ proc callCompiler(cmdTemplate, filename, options, nimcache: string,
|
||||
result.output = ""
|
||||
result.line = 0
|
||||
result.column = 0
|
||||
result.tfile = ""
|
||||
result.tline = 0
|
||||
result.tcolumn = 0
|
||||
result.err = reNimcCrash
|
||||
if tmpl =~ pegLineTemplate:
|
||||
result.tfile = extractFilename(matches[0])
|
||||
result.tline = parseInt(matches[1])
|
||||
result.tcolumn = parseInt(matches[2])
|
||||
if err =~ pegLineError:
|
||||
result.file = extractFilename(matches[0])
|
||||
result.line = parseInt(matches[1])
|
||||
@@ -374,22 +357,13 @@ proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest, target: TTarg
|
||||
r.addResult(test, target, expected.msg, given.msg, reMsgsDiffer)
|
||||
elif expected.nimout.len > 0 and not greedyOrderedSubsetLines(expected.nimout, given.nimout):
|
||||
r.addResult(test, target, expected.nimout, given.nimout, reMsgsDiffer)
|
||||
elif expected.tfile == "" and extractFilename(expected.file) != extractFilename(given.file) and
|
||||
elif extractFilename(expected.file) != extractFilename(given.file) and
|
||||
"internal error:" notin expected.msg:
|
||||
r.addResult(test, target, expected.file, given.file, reFilesDiffer)
|
||||
elif expected.line != given.line and expected.line != 0 or
|
||||
expected.column != given.column and expected.column != 0:
|
||||
r.addResult(test, target, $expected.line & ':' & $expected.column,
|
||||
$given.line & ':' & $given.column,
|
||||
reLinesDiffer)
|
||||
elif expected.tfile != "" and extractFilename(expected.tfile) != extractFilename(given.tfile) and
|
||||
"internal error:" notin expected.msg:
|
||||
r.addResult(test, target, expected.tfile, given.tfile, reFilesDiffer)
|
||||
elif expected.tline != given.tline and expected.tline != 0 or
|
||||
expected.tcolumn != given.tcolumn and expected.tcolumn != 0:
|
||||
r.addResult(test, target, $expected.tline & ':' & $expected.tcolumn,
|
||||
$given.tline & ':' & $given.tcolumn,
|
||||
reLinesDiffer)
|
||||
$given.line & ':' & $given.column, reLinesDiffer)
|
||||
else:
|
||||
r.addResult(test, target, expected.msg, given.msg, reSuccess)
|
||||
inc(r.passed)
|
||||
|
||||
Reference in New Issue
Block a user