Hopefully fixes travis build

This commit is contained in:
Felix Krause 2016-10-09 15:21:27 +02:00
parent 846b836e92
commit d2e5c9e0a9
3 changed files with 14 additions and 13 deletions

View File

@ -37,8 +37,7 @@ install:
before_script: before_script:
- export PATH="nim-$BRANCH/bin${PATH:+:$PATH}" - export PATH="nim-$BRANCH/bin${PATH:+:$PATH}"
script: script:
- nim tests --verbosity:0 - nim tests
- nim yamlTestSuite --verbosity:0
cache: cache:
directories: directories:
- nim-master - nim-master

View File

@ -40,11 +40,12 @@ proc ensureDevKitCloneCorrect() {.compileTime.} =
else: else:
let cloneOutput = staticExec("git clone https://github.com/ingydotnet/yaml-dev-kit.git -b data") let cloneOutput = staticExec("git clone https://github.com/ingydotnet/yaml-dev-kit.git -b data")
#if cError != 0: #if cError != 0:
# echo "could not clone https://github.com/ingydotnet/yaml-dev-kit.git. Make sure" if not dirExists(devKitFolder):
# echo "you are connected to the internet and your proxy settings are correct. output:\n" echo "could not clone https://github.com/ingydotnet/yaml-dev-kit.git. Make sure"
# echo "$ git clone https://github.com/ingydotnet/yaml-dev-kit.git" echo "you are connected to the internet and your proxy settings are correct. output:\n"
# echo cloneOutput echo "$ git clone https://github.com/ingydotnet/yaml-dev-kit.git"
# quit 1 echo cloneOutput
quit 1
proc parserTest(path: string): bool = proc parserTest(path: string): bool =
var var

View File

@ -1,6 +1,6 @@
import unittest, os, osproc, macros, strutils, streams import unittest, os, osproc, macros, strutils, streams
proc inputTest(basePath, path: string): bool = proc inputTest(basePath, path, nimPath: string): bool =
let let
absolutePath = basePath / path absolutePath = basePath / path
inFileOrig = absolutePath / "01-in.yaml" inFileOrig = absolutePath / "01-in.yaml"
@ -14,7 +14,7 @@ proc inputTest(basePath, path: string): bool =
defer: defer:
removeFile(inFileDest) removeFile(inFileDest)
removeFile(codeFileDest) removeFile(codeFileDest)
var process = startProcess("nim c --hints:off -p:" & escape(basePath) & var process = startProcess(nimPath & " c --hints:off -p:" & escape(basePath) &
" code.nim", absolutePath, [], nil, {poStdErrToStdOut, poEvalCommand}) " code.nim", absolutePath, [], nil, {poStdErrToStdOut, poEvalCommand})
defer: defer:
process.close() process.close()
@ -35,7 +35,7 @@ proc inputTest(basePath, path: string): bool =
result = false result = false
else: result = true else: result = true
proc outputTest(basePath, path: string): bool = proc outputTest(basePath, path, nimPath: string): bool =
let let
absolutePath = basePath / path absolutePath = basePath / path
codeFileOrig = absolutePath / "00-code.nim" codeFileOrig = absolutePath / "00-code.nim"
@ -46,7 +46,7 @@ proc outputTest(basePath, path: string): bool =
outFileActual = absolutePath / "out.yaml" outFileActual = absolutePath / "out.yaml"
copyFile(codeFileOrig, codeFileDest) copyFile(codeFileOrig, codeFileDest)
defer: removeFile(codeFileDest) defer: removeFile(codeFileDest)
var process = startProcess("nim c --hints:off -p:" & escape(basePath) & var process = startProcess(nimPath & " c --hints:off -p:" & escape(basePath) &
" code.nim", absolutePath, [], nil, {poStdErrToStdOut, poEvalCommand}) " code.nim", absolutePath, [], nil, {poStdErrToStdOut, poEvalCommand})
defer: process.close() defer: process.close()
if process.waitForExit() != 0: if process.waitForExit() != 0:
@ -104,15 +104,16 @@ proc testsFor(path: string, root: bool = true, titlePrefix: string = ""):
result = newStmtList() result = newStmtList()
let let
baseDir = staticExec("pwd") baseDir = staticExec("pwd")
nimPath = staticExec("which nim")
title = titlePrefix & slurp(baseDir / path / "title").splitLines()[0] title = titlePrefix & slurp(baseDir / path / "title").splitLines()[0]
if fileExists(path / "00-code.nim"): if fileExists(path / "00-code.nim"):
var test = newCall("test", newLit(title)) var test = newCall("test", newLit(title))
if fileExists(path / "01-in.yaml"): if fileExists(path / "01-in.yaml"):
test.add(newCall("doAssert", newCall("inputTest", newLit(baseDir), test.add(newCall("doAssert", newCall("inputTest", newLit(baseDir),
newLit(path)))) newLit(path), newLit(nimPath))))
elif fileExists(path / "01-out.yaml"): elif fileExists(path / "01-out.yaml"):
test.add(newCall("doAssert", newCall("outputTest", newLit(baseDir), test.add(newCall("doAssert", newCall("outputTest", newLit(baseDir),
newLit(path)))) newLit(path), newLit(nimPath))))
else: else:
echo "Error: neither 01-in.yaml nor 01-out.yaml exists in " & path & '!' echo "Error: neither 01-in.yaml nor 01-out.yaml exists in " & path & '!'
quit 1 quit 1