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:
- export PATH="nim-$BRANCH/bin${PATH:+:$PATH}"
script:
- nim tests --verbosity:0
- nim yamlTestSuite --verbosity:0
- nim tests
cache:
directories:
- nim-master

View File

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

View File

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