about summary refs log tree commit diff stats
path: root/doc/pydoc/all_tests.html
blob: 50c143eeb928eef9810a6a0329c3ecfa9c41e86e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module all_tests</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>all_tests</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/ranger/all_tests.py">/home/hut/ranger/all_tests.py</a></font></td></tr></table>
    <p><tt>Run&nbsp;all&nbsp;the&nbsp;tests&nbsp;inside&nbsp;the&nbsp;test/&nbsp;directory&nbsp;as&nbsp;a&nbsp;test&nbsp;suite.</tt></p>

</body></html>
n class="w"> = s.len-2 while result > 1 and s[result] in {'0'..'9', '.'}: dec result if s[result] != '-': result = s.len const latest = "head" proc `<.`(a, b: string): bool = # wether a has a smaller version than b: if a == latest: return false var i = 0 var j = 0 var verA = 0 var verB = 0 while true: let ii = parseInt(a, verA, i) let jj = parseInt(b, verB, j) # if A has no number left, but B has, B is prefered: 0.8 vs 0.8.3 if ii <= 0 or jj <= 0: return jj > 0 if verA < verB: return true elif verA > verB: return false # else: same version number; continue: inc i, ii inc j, jj if a[i] == '.': inc i if b[j] == '.': inc j proc addPackage(packages: PStringTable, p: string) = let x = versionSplitPos(p) let name = p.substr(0, x-1) if x < p.len: let version = p.substr(x+1) if packages[name] <. version: packages[name] = version else: packages[name] = latest iterator chosen(packages: PStringTable): string = for key, val in pairs(packages): let res = if val == latest: key else: key & '-' & val yield res proc addBabelPath(p: string, info: TLineInfo) = if not contains(options.searchPaths, p): if gVerbosity >= 1: message(info, hintPath, p) lists.prependStr(options.lazyPaths, p) proc addPathWithNimFiles(p: string, info: TLineInfo) = proc hasNimFile(dir: string): bool = for kind, path in walkDir(dir): if kind == pcFile and path.endsWith(".nim"): result = true break if hasNimFile(p): addBabelPath(p, info) else: for kind, p2 in walkDir(p): if hasNimFile(p2): addBabelPath(p2, info) proc addPathRec(dir: string, info: TLineInfo) = var packages = newStringTable(modeStyleInsensitive) var pos = dir.len-1 if dir[pos] in {DirSep, AltSep}: inc(pos) for k,p in os.walkDir(dir): if k == pcDir and p[pos] != '.': addPackage(packages, p) for p in packages.chosen: addBabelPath(p, info) proc babelPath*(path: string, info: TLineInfo) = addPathRec(path, info) addBabelPath(path, info)