Fix tests. Add test for hooks.
This commit is contained in:
parent
42ef358459
commit
1fa209a689
6 changed files with 49 additions and 8 deletions
|
|
@ -39,4 +39,6 @@ template after*(action: untyped, body: untyped): untyped =
|
|||
template builtin = discard
|
||||
|
||||
proc getPkgDir*(): string =
|
||||
## Returns the package directory containing the .nimble file currently
|
||||
## being evaluated.
|
||||
builtin
|
||||
|
|
@ -229,7 +229,7 @@ proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
|||
body
|
||||
|
||||
cbApi getPkgDir:
|
||||
setResult(a, "FOOBAR")
|
||||
setResult(a, scriptName.splitFile.dir)
|
||||
|
||||
compileSystemModule()
|
||||
processModule(m, llStreamOpen(scriptName, fmRead), nil)
|
||||
|
|
|
|||
|
|
@ -230,7 +230,8 @@ proc readPackageInfo*(nf: NimbleFile, options: Options,
|
|||
raise newException(NimbleError, msg)
|
||||
|
||||
validatePackageInfo(result, nf)
|
||||
options.pkgInfoCache[nf] = result
|
||||
if not result.isMinimal:
|
||||
options.pkgInfoCache[nf] = result
|
||||
|
||||
proc getPkgInfo*(dir: string, options: Options): PackageInfo =
|
||||
## Find the .nimble file in ``dir`` and parses it, returning a PackageInfo.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue