Implemented flags and arguments for NimScript's setCommand.

This commit is contained in:
Dominik Picheta 2015-12-25 16:32:46 +00:00
commit 84f371982b
6 changed files with 249 additions and 82 deletions

View file

@ -13,3 +13,10 @@ requires "nim >= 0.12.1"
task test, "test description":
echo(5+5)
task c_test, "Testing `setCommand \"c\", \"nimscript.nim\"`":
setCommand "c", "nimscript.nim"
task cr, "Testing `nimble c -r nimscript.nim` via setCommand":
--r
setCommand "c", "nimscript.nim"

View file

@ -29,10 +29,25 @@ test "can execute nimscript tasks":
check exitCode == QuitSuccess
check lines[^1] == "10"
test "can use nimscript's setCommand":
cd "nimscript":
let (output, exitCode) = execCmdEx("../" & path & " cTest")
let lines = output.strip.splitLines()
check exitCode == QuitSuccess
check "Hint: operation successful".normalize in lines[^1].normalize
test "can use nimscript's setCommand with flags":
cd "nimscript":
let (output, exitCode) = execCmdEx("../" & path & " cr")
let lines = output.strip.splitLines()
check exitCode == QuitSuccess
check "Hint: operation successful".normalize in lines[^2].normalize
check "Hello World".normalize in lines[^1].normalize
test "can list nimscript tasks":
cd "nimscript":
let (output, exitCode) = execCmdEx("../" & path & " tasks")
check output.strip == "test test description"
check "test test description".normalize in output.normalize
check exitCode == QuitSuccess
test "can install packagebin2":