Squashed merge of #635 by @genotrance.
Squashed commit of the following:
commit e86a376f2faf9d26109405a3a9f73f986185f62d
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Sun Apr 28 15:37:22 2019 -0500
Fix caching issue
commit 640ce3f2e464e52668b5350fdc5a8fe506e79d38
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Thu Apr 25 18:38:48 2019 -0500
Clean up per feedback
commit ae3ef9f7a0cbad574b725d1bc7a83bd6115e19cc
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Thu Apr 25 16:39:26 2019 -0500
Fix for 0.19.4
commit 915d6b2be43e33bc51327585193b1899386ee250
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Thu Apr 25 16:13:42 2019 -0500
Keep nimscript separate, pin devel
commit c278bd6ba09771dc079029a87e3a375998f0b447
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Mon Apr 22 14:57:44 2019 -0500
Hardcode version, json{}, code width 80, isScriptResultCached, no blank paramStr check
commit 64e5489e256d5fc5abbfe3345789f65edf5980b7
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Wed Apr 17 21:07:03 2019 -0500
Remove compiler dependency
commit a031fffd70c118c16eb3e16d3b1ed10472baf5d7
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Wed Apr 17 16:49:09 2019 -0500
Add devel to travis
commit d49916e2a05b6bd7716f45bd8f74253fc8037827
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Wed Apr 17 16:43:14 2019 -0500
Interactive live, json to file
commit 24131deea4693199922f9a5697aa3d072cceaee1
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Wed Apr 17 12:40:27 2019 -0500
Fix empty param, json echo
commit b22fe37d47fd03367d49129ea4d2d56a779a6f26
Merge: 5cf0240 2942f11
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 22:23:17 2019 -0500
Merge branch 'nocompiler' of https://github.com/genotrance/nimble into nocompiler
commit 5cf0240b728ab6ff4a39ddf629ba5833eb8985f5
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 22:23:06 2019 -0500
No hints, live output
commit 2942f116c7774e0fa91f770cebde32bc431923a5
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 21:02:28 2019 -0500
Remove osx, test with stable
commit 85f3865ef195c7b813f0b9e30b5cc8c9b2756518
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 18:19:42 2019 -0500
Remove ospaths, fix tests for Windows
commit 74201bcfe4de00bdece5b31715618975f9ce8e6e
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 14:00:14 2019 -0500
No success for missing task
commit 8c2e65e223d32366b03004d9711364504c5d7916
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 13:44:32 2019 -0500
Fix packageName to name
commit b05d9480281ebae7a0f5fd0331c8627bbf2a77d5
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 13:29:37 2019 -0500
Add switch support
commit deecd903102a9baa5d4674cb9871cd9dbb658a04
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 12:24:01 2019 -0500
API cleanup, json setCommand fix
commit 1e95fd4104ec3ffb69fe67b9c2fac23f991e163a
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 10:45:12 2019 -0500
getParams once, hash nimscriptapi, fix loop in setcommand
commit 51d03b3845cd562796bb32d41d5ad17cd09a91e7
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Apr 16 07:21:32 2019 -0500
getPkgDir impl
commit 7d0a40aa286d114d7557b229852f3c314795dc5d
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Mon Apr 15 14:24:02 2019 -0500
Before/after hook info
commit cbb3af3e970b20322030331d4849436b821f25ca
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Mon Apr 15 13:44:56 2019 -0500
Remove nims from package dir after exec
commit 0ed53d60bcdc8bb11beddb965590ed3ee63349d4
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Sat Apr 13 00:44:26 2019 -0500
Return bool from hooks
commit ab38b81b81e68cfccf3ca84fd854422cd3733c84
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Fri Apr 12 23:20:13 2019 -0500
Initial version
commit b9ef88b9f79b48435e7b4beeff959b4223f4b8ba
Merge: 220ebae c8d79fc
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Tue Mar 26 20:16:21 2019 -0500
Merge remote-tracking branch 'upstream/master' into nocompiler
commit 220ebae355c945963591b002a43b262a70640aa5
Merge: 3d7227c 119be48
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Wed Dec 12 18:02:10 2018 -0600
Merge remote-tracking branch 'upstream/master'
commit 3d7227c8900c205aada488d60565c90e17759639
Merge: cf7263d 66d79bf
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Wed Oct 17 13:39:51 2018 -0500
Merge remote-tracking branch 'upstream/master'
commit cf7263d6caf27ca4930ed54b05d4aa4f36e1dff1
Merge: 2fc3106 ee4c0ae
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Thu Sep 13 23:03:41 2018 -0500
Merge remote-tracking branch 'upstream/master'
commit 2fc310623b9f49ea012fc04fa09713fda140a7a3
Merge: e9a8850 c249f9b
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Thu Apr 26 16:27:31 2018 -0500
Merge remote-tracking branch 'upstream/master'
commit e9a885099b0b97bf3e0cddcde27e8c6b0bd51b10
Merge: 7adfd7b 75b7a21
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Thu Mar 8 14:26:46 2018 -0600
Merge remote-tracking branch 'upstream/master'
commit 7adfd7be2b38a52886640579845de378139ca0cc
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Mon Jan 15 00:35:55 2018 -0600
Updated fix for #398
commit de18319159b76a9da6765f35ea4d2e2c963d688a
Merge: 93ba4a0 3dae264
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Sun Jan 14 22:01:20 2018 -0600
Merge remote-tracking branch 'upstream/master'
commit 93ba4a00820ccb9a5362f0398cf3b5b4782bbefe
Author: Ganesh Viswanathan <dev@genotrance.com>
Date: Sat Jan 13 19:52:34 2018 -0600
Fix for #398
This commit is contained in:
parent
c8d79fc022
commit
6542c1ef16
10 changed files with 389 additions and 56 deletions
|
|
@ -36,9 +36,13 @@ proc execNimble(args: varargs[string]): tuple[output: string, exitCode: int] =
|
|||
quotedArgs.add("--nimbleDir:" & installDir)
|
||||
quotedArgs = quotedArgs.map((x: string) => ("\"" & x & "\""))
|
||||
|
||||
let path = getCurrentDir().parentDir() / "src"
|
||||
let path {.used.} = getCurrentDir().parentDir() / "src"
|
||||
|
||||
var cmd = "PATH=" & path & ":$PATH " & quotedArgs.join(" ")
|
||||
var cmd =
|
||||
when not defined(windows):
|
||||
"PATH=" & path & ":$PATH " & quotedArgs.join(" ")
|
||||
else:
|
||||
quotedArgs.join(" ")
|
||||
when defined(macosx):
|
||||
# TODO: Yeah, this is really specific to my machine but for my own sanity...
|
||||
cmd = "DYLD_LIBRARY_PATH=/usr/local/opt/openssl@1.1/lib " & cmd
|
||||
|
|
@ -67,6 +71,17 @@ proc inLines(lines: seq[string], line: string): bool =
|
|||
for i in lines:
|
||||
if line.normalize in i.normalize: return true
|
||||
|
||||
test "caching works":
|
||||
cd "caching":
|
||||
var (output, exitCode) = execNimble("dump")
|
||||
check output.contains("0.1.0")
|
||||
let
|
||||
nfile = "caching.nimble"
|
||||
writeFile(nfile, readFile(nfile).replace("0.1.0", "0.2.0"))
|
||||
(output, exitCode) = execNimble("dump")
|
||||
check output.contains("0.2.0")
|
||||
writeFile(nfile, readFile(nfile).replace("0.2.0", "0.1.0"))
|
||||
|
||||
test "picks #head when looking for packages":
|
||||
cd "versionClashes" / "aporiaScenario":
|
||||
let (output, exitCode) = execNimble("install", "-y", "--verbose")
|
||||
|
|
@ -213,7 +228,7 @@ test "can refresh with local package list":
|
|||
[PackageList]
|
||||
name = "local"
|
||||
path = "$1"
|
||||
""".unindent % (getCurrentDir() / "issue368" / "packages.json"))
|
||||
""".unindent % (getCurrentDir() / "issue368" / "packages.json").replace("\\", "\\\\"))
|
||||
let (output, exitCode) = execNimble(["refresh", "--verbose"])
|
||||
let lines = output.strip.processOutput()
|
||||
check inLines(lines, "config file at")
|
||||
|
|
@ -258,9 +273,9 @@ suite "nimscript":
|
|||
check exitCode == QuitSuccess
|
||||
let lines = output.strip.processOutput()
|
||||
check lines[0].startsWith("Before PkgDir:")
|
||||
check lines[0].endsWith("tests/nimscript")
|
||||
check lines[0].endsWith("tests" / "nimscript")
|
||||
check lines[^1].startsWith("After PkgDir:")
|
||||
check lines[^1].endsWith("tests/nimbleDir/pkgs/nimscript-0.1.0")
|
||||
check lines[^1].endsWith("tests" / "nimbleDir" / "pkgs" / "nimscript-0.1.0")
|
||||
|
||||
test "can execute nimscript tasks":
|
||||
cd "nimscript":
|
||||
|
|
@ -412,6 +427,9 @@ test "issue #349":
|
|||
]
|
||||
|
||||
proc checkName(name: string) =
|
||||
when defined(windows):
|
||||
if name.toLowerAscii() in @["con", "nul"]:
|
||||
return
|
||||
let (outp, code) = execNimble("init", "-y", name)
|
||||
let msg = outp.strip.processOutput()
|
||||
check code == QuitFailure
|
||||
|
|
@ -526,9 +544,15 @@ suite "can handle two binary versions":
|
|||
cd "binaryPackage/v2":
|
||||
check execNimble("install", "-y").exitCode == QuitSuccess
|
||||
|
||||
var
|
||||
cmd = installDir / "bin" / "binaryPackage"
|
||||
|
||||
when defined(windows):
|
||||
cmd = "cmd /c " & cmd & ".cmd"
|
||||
|
||||
test "can execute v2":
|
||||
let (output, exitCode) =
|
||||
execCmdEx(installDir / "bin" / "binaryPackage".addFileExt(ExeExt))
|
||||
execCmdEx(cmd)
|
||||
check exitCode == QuitSuccess
|
||||
check output.strip() == "v2"
|
||||
|
||||
|
|
@ -536,7 +560,7 @@ suite "can handle two binary versions":
|
|||
check execNimble("remove", "binaryPackage@2.0", "-y").exitCode==QuitSuccess
|
||||
|
||||
let (output, exitCode) =
|
||||
execCmdEx(installDir / "bin" / "binaryPackage".addFileExt(ExeExt))
|
||||
execCmdEx(cmd)
|
||||
check exitCode == QuitSuccess
|
||||
check output.strip() == "v1"
|
||||
|
||||
|
|
@ -544,7 +568,7 @@ suite "can handle two binary versions":
|
|||
check execNimble("remove", "binaryPackage@1.0", "-y").exitCode==QuitSuccess
|
||||
|
||||
let (output, exitCode) =
|
||||
execCmdEx(installDir / "bin" / "binaryPackage".addFileExt(ExeExt))
|
||||
execCmdEx(cmd)
|
||||
check exitCode == QuitSuccess
|
||||
check output.strip() == "v2"
|
||||
|
||||
|
|
@ -678,9 +702,9 @@ suite "path command":
|
|||
test "can get correct path for srcDir (#531)":
|
||||
check execNimble("uninstall", "srcdirtest", "-y").exitCode == QuitSuccess
|
||||
cd "develop/srcdirtest":
|
||||
let (output, exitCode) = execNimble("install", "-y")
|
||||
let (_, exitCode) = execNimble("install", "-y")
|
||||
check exitCode == QuitSuccess
|
||||
let (output, exitCode) = execNimble("path", "srcdirtest")
|
||||
let (output, _) = execNimble("path", "srcdirtest")
|
||||
check output.strip() == installDir / "pkgs" / "srcdirtest-1.0"
|
||||
|
||||
suite "test command":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue