@@ -221,53 +221,6 @@ proc callNimCompiler(cmdTemplate, filename, options, nimcache: string,
221221 result .msg = matches[0 ]
222222 trimUnitSep result .msg
223223
224- proc callCCompiler (cmdTemplate, filename, options: string ,
225- target: TTarget ): TSpec =
226- let cmd = prepareTestCmd (cmdTemplate, filename, options, nimcache = " " , target)
227- doAssert false
228- #[
229- this code hasn't been run in a while, and should be removed which simplifies code
230- there are better ways to do this anyways (e.g. running c code from a nim file)
231-
232- the only place where this is called is:
233- `testC r, makeTest("tests/realtimeGC/cmain", cOptions, cat), actionRun`
234- which isn't run unless you call:
235- XDG_CONFIG_HOME= nim r --lib:lib --stacktrace:on testament/testament.nim r longgc
236-
237- and this fails since at least nim 1.0 with:
238- testament/testament.nim(851) testament
239- testament/testament.nim(822) main
240- testament/categories.nim(713) processCategory
241- testament/categories.nim(189) longGCTests
242- testament/testament.nim(644) makeTest
243- testament/specs.nim(251) parseSpec
244- testament/specs.nim(184) extractSpec
245- lib/system/io.nim(861) readFile
246- Error: unhandled exception: cannot open: tests/realtimeGC/cmain.nim [IOError]
247-
248- Also, `c[5 .. ^1]` is too magical.
249- ]#
250- let c = cmd.parseCmdLine
251- var p = startProcess (command = " gcc" , args = c[5 .. ^ 1 ],
252- options = {poStdErrToStdOut, poUsePath, poEvalCommand})
253- let outp = p.outputStream
254- var x = newStringOfCap (120 )
255- result .nimout = " "
256- result .msg = " "
257- result .file = " "
258- result .output = " "
259- result .line = - 1
260- while true :
261- if outp.readLine (x):
262- result .nimout.add (x & '\n ' )
263- elif not running (p):
264- break
265- close (p)
266- if p.peekExitCode == 0 :
267- result .err = reSuccess
268- else :
269- result .err = reNimcCrash
270-
271224proc initResults : TResults =
272225 result .total = 0
273226 result .passed = 0
@@ -628,22 +581,6 @@ proc testSpecWithNimcache(r: var TResults, test: TTest; nimcache: string) {.used
628581 var testClone = test
629582 testSpecHelper (r, testClone, test.spec, target, nimcache)
630583
631- proc testC (r: var TResults , test: TTest , action: TTestAction ) =
632- # runs C code. Doesn't support any specs, just goes by exit code.
633- if not checkDisabled (r, test): return
634-
635- let tname = test.name.addFileExt (" .c" )
636- inc (r.total)
637- maybeStyledEcho " Processing " , fgCyan, extractFilename (tname)
638- var given = callCCompiler (getCmd (TSpec ()), test.name & " .c" , test.options, targetC)
639- if given.err != reSuccess:
640- r.addResult (test, targetC, " " , given.msg, given.err)
641- elif action == actionRun:
642- let exeFile = changeFileExt (test.name, ExeExt )
643- var (_, exitCode) = execCmdEx (exeFile, options = {poStdErrToStdOut, poUsePath})
644- if exitCode != 0 : given.err = reExitcodesDiffer
645- if given.err == reSuccess: inc (r.passed)
646-
647584proc makeTest (test, options: string , cat: Category ): TTest =
648585 result .cat = cat
649586 result .name = test
0 commit comments