Implements develop command. Refs #240.
This commit is contained in:
parent
84d63c8988
commit
56dd401831
12 changed files with 234 additions and 57 deletions
1
tests/develop/binary/binary.nim
Normal file
1
tests/develop/binary/binary.nim
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo("hello")
|
||||
14
tests/develop/binary/binary.nimble
Normal file
14
tests/develop/binary/binary.nimble
Normal 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"
|
||||
1
tests/develop/hybrid/hybrid.nim
Normal file
1
tests/develop/hybrid/hybrid.nim
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo("hello")
|
||||
12
tests/develop/hybrid/hybrid.nimble
Normal file
12
tests/develop/hybrid/hybrid.nimble
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Package
|
||||
|
||||
version = "1.0"
|
||||
author = "Dominik Picheta"
|
||||
description = "hybrid"
|
||||
license = "MIT"
|
||||
|
||||
bin = @["hybrid"]
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 0.16.0"
|
||||
1
tests/develop/srcdirtest/src/srcdirtest.nim
Normal file
1
tests/develop/srcdirtest/src/srcdirtest.nim
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo("hello")
|
||||
12
tests/develop/srcdirtest/srcdirtest.nimble
Normal file
12
tests/develop/srcdirtest/srcdirtest.nimble
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Package
|
||||
|
||||
version = "1.0"
|
||||
author = "Dominik Picheta"
|
||||
description = "srcdir"
|
||||
license = "MIT"
|
||||
|
||||
srcDir = "src"
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 0.16.0"
|
||||
|
|
@ -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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue