Fixed out-of-order problems in the automated unit tests

This commit is contained in:
Louis Berube 2015-01-02 16:04:46 -05:00
commit f4c052eaca
3 changed files with 46 additions and 11 deletions

View file

@ -596,9 +596,9 @@ proc downloadPkg(pkg: Package, verRange: VersionRangeRef): string =
proc install(packages: seq[PkgTuple],
options: Options,
doPrompt = true): tuple[paths: seq[string], pkg: PackageInfo] =
if packages == @[]:
if packages == @[]:
result = installFromDir(getCurrentDir(), false, options, "")
else:
else:
# If packages.json is not present ask the user if they want to download it.
if not existsFile(options.getNimbleDir / "packages.json"):
if doPrompt and

View file

@ -9,8 +9,13 @@ proc doCmd*(cmd: string) =
let bin = cmd.split(' ')[0]
if findExe(bin) == "":
raise newException(NimbleError, "'" & bin & "' not in PATH.")
# To keep output in sequence
stdout.flushFile()
stderr.flushFile()
let exitCode = execCmd(cmd)
if exitCode != QuitSuccess:
raise newException(NimbleError,
"Execution failed with exit code " & $exitCode)