diff options
-rw-r--r-- | koch.nim | 25 | ||||
-rw-r--r-- | tools/kochdocs.nim | 9 |
2 files changed, 23 insertions, 11 deletions
diff --git a/koch.nim b/koch.nim index f70cf2142..d21c5240e 100644 --- a/koch.nim +++ b/koch.nim @@ -80,6 +80,9 @@ let kochExe* = when isMainModule: os.getAppFilename() # always correct when koch proc kochExec*(cmd: string) = exec kochExe.quoteShell & " " & cmd +proc kochExecFold*(desc, cmd: string) = + execFold(desc, kochExe.quoteShell & " " & cmd) + template withDir(dir, body) = let old = getCurrentDir() try: @@ -453,11 +456,11 @@ proc runCI(cmd: string) = # note(@araq): Do not replace these commands with direct calls (eg boot()) # as that would weaken our testing efforts. when defined(posix): # appveyor (on windows) didn't run this - kochExec "boot" - kochExec "boot -d:release" + kochExecFold("Boot", "boot") + kochExecFold("Boot in release mode", "boot -d:release") ## build nimble early on to enable remainder to depend on it if needed - kochExec "nimble" + kochExecFold("Build Nimble", "nimble") when false: for pkg in "zip opengl sdl1 jester@#head niminst".split: @@ -466,23 +469,23 @@ proc runCI(cmd: string) = buildTools() # altenatively, kochExec "tools --toolsNoNimble" ## run tests - exec "nim e tests/test_nimscript.nims" + execFold("Test nimscript", "nim e tests/test_nimscript.nims") when defined(windows): # note: will be over-written below - exec "nim c -d:nimCoroutines --os:genode -d:posix --compileOnly testament/tester" + execFold("Compile tester", "nim c -d:nimCoroutines --os:genode -d:posix --compileOnly testament/tester") # main bottleneck here - exec "nim c -r -d:nimCoroutines testament/tester --pedantic all -d:nimCoroutines" + execFold("Run tester", "nim c -r -d:nimCoroutines testament/tester --pedantic all -d:nimCoroutines") - exec "nim c -r nimdoc/tester" - exec "nim c -r nimpretty/tester.nim" + execFold("Run nimdoc tests", "nim c -r nimdoc/tester") + execFold("Run nimpretty tests", "nim c -r nimpretty/tester.nim") when defined(posix): - exec "nim c -r nimsuggest/tester" + execFold("Run nimsuggest tests", "nim c -r nimsuggest/tester") ## remaining actions when defined(posix): - kochExec "docs --git.commit:devel" - kochExec "csource" + kochExecFold("Docs", "docs --git.commit:devel") + kochExecFold("C sources", "csource") elif defined(windows): when false: kochExec "csource" diff --git a/tools/kochdocs.nim b/tools/kochdocs.nim index 376f33ae5..fc53c1eea 100644 --- a/tools/kochdocs.nim +++ b/tools/kochdocs.nim @@ -38,6 +38,15 @@ proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") = if execShellCmd(cmd) != 0: quit("FAILURE", errorcode) putEnv("PATH", prevPath) +proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath = "") = + ## Execute shell command. Add log folding on Travis CI. + # https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719 + if existsEnv("TRAVIS"): + echo "travis_fold:start:" & desc.replace(" ", "") + exec(cmd, errorcode, additionalPath) + if existsEnv("TRAVIS"): + echo "travis_fold:end:" & desc.replace(" ", "") + proc execCleanPath*(cmd: string, additionalPath = ""; errorcode: int = QuitFailure) = # simulate a poor man's virtual environment |