This commit is contained in:
parent
6b3c77e7f4
commit
afc0259b12
2 changed files with 16 additions and 4 deletions
5
koch.nim
5
koch.nim
|
|
@ -592,6 +592,11 @@ proc runCI(cmd: string) =
|
||||||
execFold("Run rst2html tests", "nim r nimdoc/rsttester")
|
execFold("Run rst2html tests", "nim r nimdoc/rsttester")
|
||||||
execFold("Run nimpretty tests", "nim r nimpretty/tester.nim")
|
execFold("Run nimpretty tests", "nim r nimpretty/tester.nim")
|
||||||
when defined(posix):
|
when defined(posix):
|
||||||
|
# refs #18385, build with -d:release instead of -d:danger for testing
|
||||||
|
# We could also skip building nimsuggest in buildTools, or build it with -d:release
|
||||||
|
# in bundleNimsuggest depending on some environment variable when we are in CI. One advantage
|
||||||
|
# of rebuilding is this won't affect bin/nimsuggest when running runCI locally
|
||||||
|
execFold("build nimsuggest_testing", "nim c -o:bin/nimsuggest_testing -d:release nimsuggest/nimsuggest")
|
||||||
execFold("Run nimsuggest tests", "nim r nimsuggest/tester")
|
execFold("Run nimsuggest tests", "nim r nimsuggest/tester")
|
||||||
|
|
||||||
execFold("Run atlas tests", "nim c -r -d:atlasTests tools/atlas/atlas.nim clone https://github.com/disruptek/balls")
|
execFold("Run atlas tests", "nim c -r -d:atlasTests tools/atlas/atlas.nim clone https://github.com/disruptek/balls")
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
# `nim r nimsuggest/tester.nim nimsuggest/tests/tsug_accquote.nim`
|
# `nim r nimsuggest/tester.nim nimsuggest/tests/tsug_accquote.nim`
|
||||||
|
|
||||||
import os, osproc, strutils, streams, re, sexp, net
|
import os, osproc, strutils, streams, re, sexp, net
|
||||||
|
from sequtils import toSeq
|
||||||
|
|
||||||
type
|
type
|
||||||
Test = object
|
Test = object
|
||||||
|
|
@ -23,7 +24,7 @@ import std/compilesettings
|
||||||
|
|
||||||
proc parseTest(filename: string; epcMode=false): Test =
|
proc parseTest(filename: string; epcMode=false): Test =
|
||||||
const cursorMarker = "#[!]#"
|
const cursorMarker = "#[!]#"
|
||||||
let nimsug = "bin" / addFileExt("nimsuggest", ExeExt)
|
let nimsug = "bin" / addFileExt("nimsuggest_testing", ExeExt)
|
||||||
doAssert nimsug.fileExists, nimsug
|
doAssert nimsug.fileExists, nimsug
|
||||||
const libpath = querySetting(libPath)
|
const libpath = querySetting(libPath)
|
||||||
result.filename = filename
|
result.filename = filename
|
||||||
|
|
@ -272,6 +273,7 @@ proc runEpcTest(filename: string): int =
|
||||||
let a = outp.readAll().strip()
|
let a = outp.readAll().strip()
|
||||||
let port = parseInt(a)
|
let port = parseInt(a)
|
||||||
socket.connect("localhost", Port(port))
|
socket.connect("localhost", Port(port))
|
||||||
|
|
||||||
for req, resp in items(s.script):
|
for req, resp in items(s.script):
|
||||||
if not runCmd(req, s.dest):
|
if not runCmd(req, s.dest):
|
||||||
socket.sendEpcStr(req)
|
socket.sendEpcStr(req)
|
||||||
|
|
@ -279,8 +281,12 @@ proc runEpcTest(filename: string): int =
|
||||||
if not req.startsWith("mod "):
|
if not req.startsWith("mod "):
|
||||||
let answer = sexpToAnswer(sx)
|
let answer = sexpToAnswer(sx)
|
||||||
doReport(filename, answer, resp, report)
|
doReport(filename, answer, resp, report)
|
||||||
finally:
|
|
||||||
socket.sendEpcStr "return arg"
|
socket.sendEpcStr "return arg"
|
||||||
|
# bugfix: this was in `finally` block, causing the original error to be
|
||||||
|
# potentially masked by another one in case `socket.sendEpcStr` raises
|
||||||
|
# (e.g. if socket couldn't connect in the 1st place)
|
||||||
|
finally:
|
||||||
close(p)
|
close(p)
|
||||||
if report.len > 0:
|
if report.len > 0:
|
||||||
echo "==== EPC ========================================"
|
echo "==== EPC ========================================"
|
||||||
|
|
@ -336,8 +342,9 @@ proc main() =
|
||||||
failures += runTest(xx)
|
failures += runTest(xx)
|
||||||
failures += runEpcTest(xx)
|
failures += runEpcTest(xx)
|
||||||
else:
|
else:
|
||||||
for x in walkFiles(tpath / "t*.nim"):
|
let files = toSeq(walkFiles(tpath / "t*.nim"))
|
||||||
echo "Test ", x
|
for i, x in files:
|
||||||
|
echo "$#/$# test: $#" % [$i, $files.len, x]
|
||||||
when defined(i386):
|
when defined(i386):
|
||||||
if x == "nimsuggest/tests/tmacro_highlight.nim":
|
if x == "nimsuggest/tests/tmacro_highlight.nim":
|
||||||
echo "skipping" # workaround bug #17945
|
echo "skipping" # workaround bug #17945
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue