diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-02-18 09:56:01 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-18 09:56:01 +0100 |
commit | c8e33cbb75caf21a76d379ce94b42baffbefa73f (patch) | |
tree | 2382ee25980be7fa3e89a1a5483cb78857463115 /testament | |
parent | 9e754c3b0623433380de171d25bfb862eb2f9ab7 (diff) | |
parent | 8b39551fca81e95b51393a2a8e702eebe3ba7c51 (diff) | |
download | Nim-c8e33cbb75caf21a76d379ce94b42baffbefa73f.tar.gz |
fixed merge conflict
Diffstat (limited to 'testament')
-rw-r--r-- | testament/categories.nim | 60 | ||||
-rw-r--r-- | testament/important_packages.nim | 58 |
2 files changed, 75 insertions, 43 deletions
diff --git a/testament/categories.nim b/testament/categories.nim index 77769743d..c7365e8fd 100644 --- a/testament/categories.nim +++ b/testament/categories.nim @@ -471,7 +471,8 @@ proc getPackageDir(package: string): string = else: result = commandOutput[0].string -iterator listPackages(filter: PackageFilter): tuple[name, url, cmd: string] = +iterator listPackages(filter: PackageFilter): + tuple[name, url, cmd: string, hasDeps: bool] = const defaultCmd = "nimble test" let packageList = parseFile(packageIndex) for package in packageList.items: @@ -482,12 +483,12 @@ iterator listPackages(filter: PackageFilter): tuple[name, url, cmd: string] = case filter of pfCoreOnly: if "nim-lang" in normalize(url): - yield (name, url, defaultCmd) + yield (name, url, defaultCmd, false) of pfExtraOnly: - for n, cmd, commit in important_packages.packages.items: - if name == n: yield (name, url, cmd) + for n, cmd, commit, hasDeps in important_packages.packages.items: + if name == n: yield (name, url, cmd, hasDeps) of pfAll: - yield (name, url, defaultCmd) + yield (name, url, defaultCmd, false) proc makeSupTest(test, options: string, cat: Category): TTest = result.cat = cat @@ -506,32 +507,47 @@ proc testNimblePackages(r: var TResults, cat: Category, filter: PackageFilter) = let packageFileTest = makeSupTest("PackageFileParsed", "", cat) var keepDir = false + var packagesDir = "pkgstemp" try: - for name, url, cmd in listPackages(filter): + for name, url, cmd, hasDep in listPackages(filter): var test = makeSupTest(url, "", cat) - let buildPath = "pkgstemp" / name - let installProcess = startProcess("git", "", ["clone", url, buildPath]) - let installStatus = waitForExitEx(installProcess) - installProcess.close - if installStatus != QuitSuccess: - r.addResult(test, targetC, "", "", reInstallFailed) + let buildPath = packagesDir / name + if not existsDir(buildPath): + if hasDep: + let nimbleProcess = startProcess("nimble", "", ["install", "-y", name], + options = {poUsePath, poStdErrToStdOut}) + let nimbleStatus = waitForExitEx(nimbleProcess) + nimbleProcess.close + if nimbleStatus != QuitSuccess: + r.addResult(test, targetC, "", "", reInstallFailed) + keepDir = true + continue + + let installProcess = startProcess("git", "", ["clone", url, buildPath], + options = {poUsePath, poStdErrToStdOut}) + let installStatus = waitForExitEx(installProcess) + installProcess.close + if installStatus != QuitSuccess: + r.addResult(test, targetC, "", "", reInstallFailed) + keepDir = true + continue + + let cmdArgs = parseCmdLine(cmd) + let buildProcess = startProcess(cmdArgs[0], buildPath, cmdArgs[1..^1], + options = {poUsePath, poStdErrToStdOut}) + let buildStatus = waitForExitEx(buildProcess) + buildProcess.close + if buildStatus != QuitSuccess: + r.addResult(test, targetC, "", "", reBuildFailed) keepDir = true else: - let cmdArgs = parseCmdLine(cmd) - let buildProcess = startProcess(cmdArgs[0], buildPath, cmdArgs[1..^1]) - let buildStatus = waitForExitEx(buildProcess) - buildProcess.close - if buildStatus != QuitSuccess: - r.addResult(test, targetC, "", "", reBuildFailed) - keepDir = true - else: - r.addResult(test, targetC, "", "", reSuccess) + r.addResult(test, targetC, "", "", reSuccess) r.addResult(packageFileTest, targetC, "", "", reSuccess) except JsonParsingError: echo("[Warning] - Cannot run nimble tests: Invalid package file.") r.addResult(packageFileTest, targetC, "", "", reBuildFailed) finally: - if not keepDir: removeDir("pkgstemp") + if not keepDir: removeDir(packagesDir) # ---------------------------------------------------------------------------- diff --git a/testament/important_packages.nim b/testament/important_packages.nim index fbb3edaa8..e4cbec7f8 100644 --- a/testament/important_packages.nim +++ b/testament/important_packages.nim @@ -1,28 +1,44 @@ import strutils -template pkg(name: string; cmd = "nimble test"; version = ""): untyped = - packages.add((name, cmd, version)) +template pkg(name: string; cmd = "nimble test"; version = ""; hasDeps = false): untyped = + packages.add((name, cmd, version, hasDeps)) -var packages*: seq[tuple[name, cmd, version: string]] = @[] +var packages*: seq[tuple[name, cmd, version: string; hasDeps: bool]] = @[] -pkg "karax" -pkg "cligen" + +pkg "arraymancer", "nim c src/arraymancer.nim", "", true +pkg "ast_pattern_matching", "nim c tests/test1.nim" +pkg "c2nim" +pkg "cligen", "nim c -o:cligenn cligen.nim" +pkg "compactdict", "nim c tests/test1.nim" +pkg "criterion" +pkg "docopt" +pkg "gara", "nim c tests/test_gara.nim" pkg "glob" -#pkg "regex" -pkg "freeimage", "nim c freeimage.nim" -pkg "zero_functional" -pkg "nimpy", "nim c nimpy.nim" -#pkg "nimongo", "nimble test_ci" +pkg "gnuplot" +pkg "hts", "nim c tests/all.nim" pkg "inim" - -pkg "sdl1", "nim c src/sdl.nim" +pkg "itertools", "nim doc src/itertools.nim" pkg "iterutils" -pkg "gnuplot" -pkg "c2nim" - -#[ - arraymancer - nimpb - jester - nimx -]# +pkg "karax", "nim c tests/tester.nim" +pkg "loopfusion" +pkg "nake", "nim c nakefile.nim" +pkg "neo", "nim c -d:blas=openblas tests/all.nim", "", true +pkg "nigui", "nim c -o:niguii src/nigui.nim" +pkg "NimData", "nim c -o:nimdataa src/nimdata.nim", "", true +pkg "nimes", "nim c src/nimes.nim", "", true +pkg "nimgame2", "nim c nimgame2/nimgame.nim", "", true +pkg "nimongo", "nimble test_ci", "", true +pkg "nimpy", "nim c -o:nimpyy nimpy.nim" +pkg "nimsl", "nim c test.nim" +pkg "nimx", "nim c --threads:on test/main.nim", "", true +pkg "parsetoml" +pkg "patty" +pkg "plotly", "nim c examples/all.nim", "", true +pkg "protobuf", "nim c -o:protobuff src/protobuf.nim", "", true +pkg "regex", "nim c src/regex" +pkg "rosencrantz", "nim c -o:rsncntz rosencrantz.nim" +pkg "sdl1", "nim c src/sdl.nim" +pkg "sdl2_nim", "nim c sdl2/sdl.nim" +pkg "stint", "nim c -o:stintt stint.nim" +pkg "zero_functional", "nim c test.nim" |