test case for #9180 and re-enables the disabled tcompilerapi test (#9181)

* add findNimStdLibCompileTime and un-disable tcompilerapi test; add test case for #9180

* address comments
This commit is contained in:
Timothee Cour 2018-10-11 00:44:35 -07:00 • committed by Andreas Rumpf
commit a58c982a49
2 changed files with 29 additions and 22 deletions

View file

@ -89,6 +89,13 @@ proc findNimStdLib*(): string =
except OSError, ValueError:
return ""
proc findNimStdLibCompileTime*(): string =
## Same as ``findNimStdLib`` but uses source files used at compile time,
## and asserts on error.
const sourcePath = currentSourcePath()
result = sourcePath.parentDir.parentDir / "lib"
doAssert fileExists(result / "system.nim"), "result:" & result
proc createInterpreter*(scriptName: string;
searchPaths: openArray[string];
flags: TSandboxFlags = {}): Interpreter =