Implements basic support for building with .nimble-link'ed packages.
This commit is contained in:
parent
5f1de1e4ff
commit
97dc0ffb45
8 changed files with 90 additions and 31 deletions
12
tests/develop/dependent/dependent.nimble
Normal file
12
tests/develop/dependent/dependent.nimble
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Package
|
||||
|
||||
version = "1.0"
|
||||
author = "Dominik Picheta"
|
||||
description = "dependent"
|
||||
license = "MIT"
|
||||
|
||||
srcDir = "src"
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 0.16.0", "srcdirtest"
|
||||
3
tests/develop/dependent/src/dependent.nim
Normal file
3
tests/develop/dependent/src/dependent.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import srcdirtest
|
||||
|
||||
doAssert foo() == "correct"
|
||||
|
|
@ -1 +1,4 @@
|
|||
proc foo*(): string =
|
||||
return "correct"
|
||||
|
||||
echo("hello")
|
||||
|
|
@ -24,10 +24,11 @@ test "can compile with --os:windows":
|
|||
template cd*(dir: string, body: untyped) =
|
||||
## Sets the current dir to ``dir``, executes ``body`` and restores the
|
||||
## previous working dir.
|
||||
let lastDir = getCurrentDir()
|
||||
setCurrentDir(dir)
|
||||
body
|
||||
setCurrentDir(lastDir)
|
||||
block:
|
||||
let lastDir = getCurrentDir()
|
||||
setCurrentDir(dir)
|
||||
body
|
||||
setCurrentDir(lastDir)
|
||||
|
||||
proc execNimble(args: varargs[string]): tuple[output: string, exitCode: int] =
|
||||
var quotedArgs = @args
|
||||
|
|
@ -500,4 +501,10 @@ suite "develop feature":
|
|||
let split = readFile(path).splitLines()
|
||||
check split.len == 2
|
||||
check split[0].endsWith("develop/srcdirtest/srcdirtest.nimble")
|
||||
check split[1].endsWith("develop/srcdirtest/src")
|
||||
check split[1].endsWith("develop/srcdirtest/src")
|
||||
|
||||
cd "develop/dependent":
|
||||
let (output, exitCode) = execNimble("c", "-r", "src/dependent")
|
||||
checkpoint output
|
||||
check(output.processOutput.inLines("hello"))
|
||||
check exitCode == QuitSuccess
|
||||
Loading…
Add table
Add a link
Reference in a new issue