From 98c16afb47704c4647d865f7ca2775c0f680868c Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Sun, 9 Oct 2016 15:53:47 +0200 Subject: [PATCH] This might finally fix travis --- test/tparser.nim | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/tparser.nim b/test/tparser.nim index 382d68c..9ace20b 100644 --- a/test/tparser.nim +++ b/test/tparser.nim @@ -95,20 +95,19 @@ proc parserTest(path: string): bool = macro genTests(): untyped = let pwd = staticExec("pwd") - absolutePath = pwd / devKitFolder - echo "[tparser] Generating tests from " & escape(absolutePath) + absolutePath = '"' & (pwd / devKitFolder) & '"' + echo "[tparser] Generating tests from " & absolutePath ensureDevKitCloneCorrect(pwd) result = newStmtList() - for kind, dirName in walkDir(absolutePath, true): - echo "[tparser] directory item: kind=", kind, ", name=", dirName - if kind == pcDir: - if dirName in [".git", "name", "tags", "meta"]: continue - echo "[tparser] Test: " & dirName - let title = slurp(absolutePath / dirName / "===") - result.add(newCall("test", - newLit(strip(title) & " [" & - dirName & ']'), newCall("doAssert", newCall("parserTest", - newLit(absolutePath / dirName))))) + # walkDir for some crude reason does not work with travis build + let dirItems = staticExec("ls -1d " & absolutePath / "*") + for dirPath in dirItems.splitLines(): + if dirPath[^4..^1] in [".git", "name", "tags", "meta"]: continue + let title = slurp(dirPath / "===") + result.add(newCall("test", + newLit(strip(title) & " [" & + dirPath[^4..^1] & ']'), newCall("doAssert", newCall("parserTest", + newLit(dirPath))))) result = newCall("suite", newLit("Parser Tests (from yaml-dev-kit)"), result) genTests() \ No newline at end of file