testament: remove unused tfile,tline,tcolumn (#17515)
This commit is contained in:
parent
42e895feb1
commit
8049d0befc
2 changed files with 2 additions and 36 deletions
|
|
@ -79,8 +79,6 @@ type
|
||||||
sortoutput*: bool
|
sortoutput*: bool
|
||||||
output*: string
|
output*: string
|
||||||
line*, column*: int
|
line*, column*: int
|
||||||
tfile*: string
|
|
||||||
tline*, tcolumn*: int
|
|
||||||
exitCode*: int
|
exitCode*: int
|
||||||
msg*: string
|
msg*: string
|
||||||
ccodeCheck*: seq[string]
|
ccodeCheck*: seq[string]
|
||||||
|
|
@ -277,12 +275,6 @@ proc parseSpec*(filename: string): TSpec =
|
||||||
if result.msg.len == 0 and result.nimout.len == 0:
|
if result.msg.len == 0 and result.nimout.len == 0:
|
||||||
result.parseErrors.addLine "errormsg or msg needs to be specified before column"
|
result.parseErrors.addLine "errormsg or msg needs to be specified before column"
|
||||||
discard parseInt(e.value, result.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":
|
of "output":
|
||||||
if result.outputCheck != ocSubstr:
|
if result.outputCheck != ocSubstr:
|
||||||
result.outputCheck = ocEqual
|
result.outputCheck = ocEqual
|
||||||
|
|
|
||||||
|
|
@ -82,12 +82,6 @@ type
|
||||||
let
|
let
|
||||||
pegLineError =
|
pegLineError =
|
||||||
peg"{[^(]*} '(' {\d+} ', ' {\d+} ') ' ('Error') ':' \s* {.*}"
|
peg"{[^(]*} '(' {\d+} ', ' {\d+} ') ' ('Error') ':' \s* {.*}"
|
||||||
|
|
||||||
pegLineTemplate =
|
|
||||||
peg"""
|
|
||||||
{[^(]*} '(' {\d+} ', ' {\d+} ') '
|
|
||||||
'template/generic instantiation' ( ' of `' [^`]+ '`' )? ' from here' .*
|
|
||||||
"""
|
|
||||||
pegOtherError = peg"'Error:' \s* {.*}"
|
pegOtherError = peg"'Error:' \s* {.*}"
|
||||||
pegOfInterest = pegLineError / pegOtherError
|
pegOfInterest = pegLineError / pegOtherError
|
||||||
|
|
||||||
|
|
@ -165,7 +159,6 @@ proc callCompiler(cmdTemplate, filename, options, nimcache: string,
|
||||||
let outp = p.outputStream
|
let outp = p.outputStream
|
||||||
var suc = ""
|
var suc = ""
|
||||||
var err = ""
|
var err = ""
|
||||||
var tmpl = ""
|
|
||||||
var x = newStringOfCap(120)
|
var x = newStringOfCap(120)
|
||||||
result.nimout = ""
|
result.nimout = ""
|
||||||
while true:
|
while true:
|
||||||
|
|
@ -174,9 +167,6 @@ proc callCompiler(cmdTemplate, filename, options, nimcache: string,
|
||||||
if x =~ pegOfInterest:
|
if x =~ pegOfInterest:
|
||||||
# `err` should contain the last error/warning message
|
# `err` should contain the last error/warning message
|
||||||
err = x
|
err = x
|
||||||
elif x =~ pegLineTemplate and err == "":
|
|
||||||
# `tmpl` contains the last template expansion before the error
|
|
||||||
tmpl = x
|
|
||||||
elif x.isSuccess:
|
elif x.isSuccess:
|
||||||
suc = x
|
suc = x
|
||||||
elif not running(p):
|
elif not running(p):
|
||||||
|
|
@ -187,14 +177,7 @@ proc callCompiler(cmdTemplate, filename, options, nimcache: string,
|
||||||
result.output = ""
|
result.output = ""
|
||||||
result.line = 0
|
result.line = 0
|
||||||
result.column = 0
|
result.column = 0
|
||||||
result.tfile = ""
|
|
||||||
result.tline = 0
|
|
||||||
result.tcolumn = 0
|
|
||||||
result.err = reNimcCrash
|
result.err = reNimcCrash
|
||||||
if tmpl =~ pegLineTemplate:
|
|
||||||
result.tfile = extractFilename(matches[0])
|
|
||||||
result.tline = parseInt(matches[1])
|
|
||||||
result.tcolumn = parseInt(matches[2])
|
|
||||||
if err =~ pegLineError:
|
if err =~ pegLineError:
|
||||||
result.file = extractFilename(matches[0])
|
result.file = extractFilename(matches[0])
|
||||||
result.line = parseInt(matches[1])
|
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)
|
r.addResult(test, target, expected.msg, given.msg, reMsgsDiffer)
|
||||||
elif expected.nimout.len > 0 and not greedyOrderedSubsetLines(expected.nimout, given.nimout):
|
elif expected.nimout.len > 0 and not greedyOrderedSubsetLines(expected.nimout, given.nimout):
|
||||||
r.addResult(test, target, expected.nimout, given.nimout, reMsgsDiffer)
|
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:
|
"internal error:" notin expected.msg:
|
||||||
r.addResult(test, target, expected.file, given.file, reFilesDiffer)
|
r.addResult(test, target, expected.file, given.file, reFilesDiffer)
|
||||||
elif expected.line != given.line and expected.line != 0 or
|
elif expected.line != given.line and expected.line != 0 or
|
||||||
expected.column != given.column and expected.column != 0:
|
expected.column != given.column and expected.column != 0:
|
||||||
r.addResult(test, target, $expected.line & ':' & $expected.column,
|
r.addResult(test, target, $expected.line & ':' & $expected.column,
|
||||||
$given.line & ':' & $given.column,
|
$given.line & ':' & $given.column, reLinesDiffer)
|
||||||
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)
|
|
||||||
else:
|
else:
|
||||||
r.addResult(test, target, expected.msg, given.msg, reSuccess)
|
r.addResult(test, target, expected.msg, given.msg, reSuccess)
|
||||||
inc(r.passed)
|
inc(r.passed)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue