Implements basic support for building with .nimble-link'ed packages.

This commit is contained in:
Dominik Picheta 2017-08-16 22:22:00 +01:00
commit 97dc0ffb45
8 changed files with 90 additions and 31 deletions

View 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"

View file

@ -0,0 +1,3 @@
import srcdirtest
doAssert foo() == "correct"

View file

@ -1 +1,4 @@
proc foo*(): string =
return "correct"
echo("hello")

View file

@ -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