mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 19:57:58 +00:00
remove some custom logic in testament around flags, testExec (#18090)
* remove some custom logic in testament around flags, testExec * remove testExec, custom logic around flags from testament * fixup
This commit is contained in:
@@ -23,7 +23,6 @@ const
|
||||
"debugger",
|
||||
"dll",
|
||||
"examples",
|
||||
"flags",
|
||||
"gc",
|
||||
"io",
|
||||
"js",
|
||||
@@ -48,26 +47,6 @@ proc isTestFile*(file: string): bool =
|
||||
let (_, name, ext) = splitFile(file)
|
||||
result = ext == ".nim" and name.startsWith("t")
|
||||
|
||||
# --------------------- flags tests -------------------------------------------
|
||||
|
||||
proc flagTests(r: var TResults, cat: Category, options: string) =
|
||||
# --genscript
|
||||
const filename = testsDir/"flags"/"tgenscript"
|
||||
const genopts = " --genscript"
|
||||
let nimcache = nimcacheDir(filename, genopts, targetC)
|
||||
testSpec r, makeTest(filename, genopts, cat)
|
||||
|
||||
when defined(windows):
|
||||
testExec r, makeTest(filename, " cmd /c cd " & nimcache &
|
||||
" && compile_tgenscript.bat", cat)
|
||||
|
||||
elif defined(posix):
|
||||
testExec r, makeTest(filename, " sh -c \"cd " & nimcache &
|
||||
" && sh compile_tgenscript.sh\"", cat)
|
||||
|
||||
# Run
|
||||
testExec r, makeTest(filename, " " & nimcache / "tgenscript", cat)
|
||||
|
||||
# --------------------- DLL generation tests ----------------------------------
|
||||
|
||||
proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) =
|
||||
@@ -705,8 +684,6 @@ proc processCategory(r: var TResults, cat: Category,
|
||||
jsTests(r, cat, options)
|
||||
of "dll":
|
||||
dllTests(r, cat, options)
|
||||
of "flags":
|
||||
flagTests(r, cat, options)
|
||||
of "gc":
|
||||
gcTests(r, cat, options)
|
||||
of "longgc":
|
||||
|
||||
@@ -621,22 +621,6 @@ proc testC(r: var TResults, test: TTest, action: TTestAction) =
|
||||
if exitCode != 0: given.err = reExitcodesDiffer
|
||||
if given.err == reSuccess: inc(r.passed)
|
||||
|
||||
proc testExec(r: var TResults, test: TTest) =
|
||||
# runs executable or script, just goes by exit code
|
||||
if not checkDisabled(r, test): return
|
||||
|
||||
inc(r.total)
|
||||
let (outp, errC) = execCmdEx(test.options.strip())
|
||||
var given: TSpec
|
||||
if errC == 0:
|
||||
given.err = reSuccess
|
||||
else:
|
||||
given.err = reExitcodesDiffer
|
||||
given.msg = outp
|
||||
|
||||
if given.err == reSuccess: inc(r.passed)
|
||||
r.addResult(test, targetC, "", given.msg, given.err)
|
||||
|
||||
proc makeTest(test, options: string, cat: Category): TTest =
|
||||
result.cat = cat
|
||||
result.name = test
|
||||
|
||||
Reference in New Issue
Block a user