Implements develop command. Refs #240.

This commit is contained in:
Dominik Picheta 2017-08-13 15:04:40 +01:00
commit 56dd401831
12 changed files with 234 additions and 57 deletions

View file

@ -0,0 +1 @@
echo("hello")

View file

@ -0,0 +1,14 @@
# Package
version = "1.0"
author = "Dominik Picheta"
description = "binary"
license = "MIT"
bin = @["binary"]
skipExt = @["nim"]
# Dependencies
requires "nim >= 0.16.0"

View file

@ -0,0 +1 @@
echo("hello")

View file

@ -0,0 +1,12 @@
# Package
version = "1.0"
author = "Dominik Picheta"
description = "hybrid"
license = "MIT"
bin = @["hybrid"]
# Dependencies
requires "nim >= 0.16.0"

View file

@ -0,0 +1 @@
echo("hello")

View file

@ -0,0 +1,12 @@
# Package
version = "1.0"
author = "Dominik Picheta"
description = "srcdir"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 0.16.0"

View file

@ -460,4 +460,41 @@ test "can pass args with spaces to Nim (#351)":
" -d:myVar=\"string with spaces\"" &
" binaryPackage")
checkpoint output
check exitCode == QuitSuccess
check exitCode == QuitSuccess
suite "develop feature":
test "can reject binary packages":
cd "develop/binary":
let (output, exitCode) = execNimble("develop")
checkpoint output
check output.processOutput.inLines("cannot develop packages")
check exitCode == QuitFailure
test "can develop hybrid":
cd "develop/hybrid":
let (output, exitCode) = execNimble("develop")
checkpoint output
check output.processOutput.inLines("will not be compiled")
check exitCode == QuitSuccess
let path = installDir / "pkgs" / "hybrid-#head" / "hybrid.nimble-link"
check fileExists(path)
let split = readFile(path).splitLines()
check split.len == 2
check split[0].endsWith("develop/hybrid/hybrid.nimble")
check split[1].endsWith("develop/hybrid")
test "can develop with srcDir":
cd "develop/srcdirtest":
let (output, exitCode) = execNimble("develop")
checkpoint output
check(not output.processOutput.inLines("will not be compiled"))
check exitCode == QuitSuccess
let path = installDir / "pkgs" / "srcdirtest-#head" /
"srcdirtest.nimble-link"
check fileExists(path)
let split = readFile(path).splitLines()
check split.len == 2
check split[0].endsWith("develop/srcdirtest/srcdirtest.nimble")
check split[1].endsWith("develop/srcdirtest/src")