mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-20 07:51:32 +00:00
committed by
Andreas Rumpf
parent
a4c244aef0
commit
06571f5495
@@ -608,16 +608,18 @@ proc myProcess(context: PPassContext, n: PNode): PNode =
|
||||
rod.storeNode(c.graph, c.module, result)
|
||||
|
||||
proc testExamples(c: PContext) =
|
||||
let outputDir = c.config.getNimcacheDir / "runnableExamples"
|
||||
createDir(outputDir)
|
||||
let inp = toFullPath(c.config, c.module.info)
|
||||
let outp = inp.changeFileExt"" & "_examples.nim"
|
||||
let outp = outputDir / extractFilename(inp.changeFileExt"" & "_examples.nim")
|
||||
let nimcache = outp.changeFileExt"" & "_nimcache"
|
||||
renderModule(c.runnableExamples, inp, outp)
|
||||
renderModule(c.runnableExamples, inp, outp, conf = c.config)
|
||||
let backend = if isDefined(c.config, "js"): "js"
|
||||
elif isDefined(c.config, "cpp"): "cpp"
|
||||
elif isDefined(c.config, "objc"): "objc"
|
||||
else: "c"
|
||||
if os.execShellCmd(os.getAppFilename() & " " & backend & " --nimcache:" & nimcache & " -r " & outp) != 0:
|
||||
quit "[Examples] failed"
|
||||
quit "[Examples] failed: see " & outp
|
||||
else:
|
||||
removeFile(outp)
|
||||
removeFile(outp.changeFileExt(ExeExt))
|
||||
|
||||
Reference in New Issue
Block a user