This might finally fix travis

This commit is contained in:
Felix Krause 2016-10-09 15:53:47 +02:00
parent ea90b4d2db
commit 98c16afb47
1 changed files with 11 additions and 12 deletions

View File

@ -95,20 +95,19 @@ proc parserTest(path: string): bool =
macro genTests(): untyped = macro genTests(): untyped =
let let
pwd = staticExec("pwd") pwd = staticExec("pwd")
absolutePath = pwd / devKitFolder absolutePath = '"' & (pwd / devKitFolder) & '"'
echo "[tparser] Generating tests from " & escape(absolutePath) echo "[tparser] Generating tests from " & absolutePath
ensureDevKitCloneCorrect(pwd) ensureDevKitCloneCorrect(pwd)
result = newStmtList() result = newStmtList()
for kind, dirName in walkDir(absolutePath, true): # walkDir for some crude reason does not work with travis build
echo "[tparser] directory item: kind=", kind, ", name=", dirName let dirItems = staticExec("ls -1d " & absolutePath / "*")
if kind == pcDir: for dirPath in dirItems.splitLines():
if dirName in [".git", "name", "tags", "meta"]: continue if dirPath[^4..^1] in [".git", "name", "tags", "meta"]: continue
echo "[tparser] Test: " & dirName let title = slurp(dirPath / "===")
let title = slurp(absolutePath / dirName / "===") result.add(newCall("test",
result.add(newCall("test", newLit(strip(title) & " [" &
newLit(strip(title) & " [" & dirPath[^4..^1] & ']'), newCall("doAssert", newCall("parserTest",
dirName & ']'), newCall("doAssert", newCall("parserTest", newLit(dirPath)))))
newLit(absolutePath / dirName)))))
result = newCall("suite", newLit("Parser Tests (from yaml-dev-kit)"), result) result = newCall("suite", newLit("Parser Tests (from yaml-dev-kit)"), result)
genTests() genTests()