Skip to content

Commit e8927a7

Browse files
committed
fix tests
1 parent c351172 commit e8927a7

File tree

9 files changed

+23
-18
lines changed

9 files changed

+23
-18
lines changed

compiler/options.nim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -460,15 +460,15 @@ when defined(nimDebugUtils):
460460
import debugutils
461461

462462
proc initConfigRefCommon(conf: ConfigRef) =
463-
conf.selectedGC = gcRefc
464-
conf.verbosity = 1
465-
conf.hintProcessingDots = true
466-
conf.options = DefaultOptions
467-
conf.globalOptions = DefaultGlobalOptions
468-
conf.filenameOption = foAbs
469-
conf.foreignPackageNotes = foreignPackageNotesDefault
470-
conf.notes = NotesVerbosity[1]
471-
conf.mainPackageNotes = NotesVerbosity[1]
463+
conf.selectedGC = gcRefc
464+
conf.verbosity = 1
465+
conf.hintProcessingDots = true
466+
conf.options = DefaultOptions
467+
conf.globalOptions = DefaultGlobalOptions
468+
conf.filenameOption = foAbs
469+
conf.foreignPackageNotes = foreignPackageNotesDefault
470+
conf.notes = NotesVerbosity[1]
471+
conf.mainPackageNotes = NotesVerbosity[1]
472472

473473
proc newConfigRef*(): ConfigRef =
474474
result = ConfigRef(

drnim/tests/config.nims

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ switch("path", "$nim/testament/lib") # so we can `import stdtest/foo` in this di
33
## prevent common user config settings to interfere with testament expectations
44
## Indifidual tests can override this if needed to test for these options.
55
switch("colors", "off")
6-
switch("listFullPaths", "off")
6+
switch("filenames", "canonical")
77
switch("excessiveStackTrace", "off")
88

99
# we only want to check the marked parts in the tests:

nimsuggest/config.nims

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# xxx not sure why this flag isn't needed: switch("processing", "filenames")
2+
switch("filenames", "canonical")

nimsuggest/tester.nim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ proc runEpcTest(filename: string): int =
255255
options={poStdErrToStdOut, poUsePath,
256256
poInteractive, poDaemon})
257257
let outp = p.outputStream
258-
let inp = p.inputStream
259258
var report = ""
260259
var socket = newSocket()
261260
try:
@@ -315,8 +314,12 @@ proc runTest(filename: string): int =
315314
answer.add '\L'
316315
doReport(filename, answer, resp, report)
317316
finally:
318-
inp.writeLine("quit")
319-
inp.flush()
317+
try:
318+
inp.writeLine("quit")
319+
inp.flush()
320+
except:
321+
# assume it's SIGPIPE, ie, the child already died
322+
discard
320323
close(p)
321324
if report.len > 0:
322325
echo "==== STDIN ======================================"

nimsuggest/tests/tchk1.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ proc main =
1717
discard """
1818
$nimsuggest --tester $file
1919
>chk $1
20-
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"tchk1 [Processing]";;0
20+
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"tests/tchk1.nim [Processing]";;0
2121
chk;;skUnknown;;;;Error;;$file;;12;;0;;"identifier expected, but got \'keyword template\'";;0
2222
chk;;skUnknown;;;;Error;;$file;;14;;0;;"nestable statement requires indentation";;0
2323
chk;;skUnknown;;;;Error;;$file;;12;;0;;"implementation of \'foo\' expected";;0

nimsuggest/tests/tchk_compiles.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ discard compiles(2 + "hello")
44
discard """
55
$nimsuggest --tester $file
66
>chk $1
7-
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"tchk_compiles [Processing]";;0
7+
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"tests/tchk_compiles.nim [Processing]";;0
88
"""

nimsuggest/tests/ttempl_inst.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ foo()
77
discard """
88
$nimsuggest --tester $file
99
>chk $1
10-
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"ttempl_inst [Processing]";;0
10+
chk;;skUnknown;;;;Hint;;???;;0;;-1;;"tests/ttempl_inst.nim [Processing]";;0
1111
chk;;skUnknown;;;;Hint;;$file;;4;;3;;"template/generic instantiation from here";;0
1212
chk;;skUnknown;;;;Warning;;$file;;2;;11;;"foo [User]";;0
1313
"""

testament/testament.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ proc isSuccess(input: string): bool =
104104
# not clear how to do the equivalent of pkg/regex's: re"FOO(.*?)BAR" in pegs
105105
# note: this doesn't handle colors, eg: `\e[1m\e[0m\e[32mHint:`; while we
106106
# could handle colors, there would be other issues such as handling other flags
107-
# that may appear in user config (eg: `--listFullPaths`).
107+
# that may appear in user config (eg: `--filenames`).
108108
# Passing `XDG_CONFIG_HOME= testament args...` can be used to ignore user config
109109
# stored in XDG_CONFIG_HOME, refs https://wiki.archlinux.org/index.php/XDG_Base_Directory
110110
input.startsWith("Hint: ") and input.endsWith("[SuccessX]")

tests/misc/trunner.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ else: # don't run twice the same test
9292
of 5: nimcache / htmldocsDirname
9393
else: file.parentDir / htmldocsDirname
9494

95-
var cmd = fmt"{nim} doc --index:on --listFullPaths --hint:successX:on --nimcache:{nimcache} {options[i]} {file}"
95+
var cmd = fmt"{nim} doc --index:on --filenames:abs --hint:successX:on --nimcache:{nimcache} {options[i]} {file}"
9696
removeDir(htmldocsDir)
9797
let (outp, exitCode) = execCmdEx(cmd)
9898
check exitCode == 0

0 commit comments

Comments
 (0)