##// END OF EJS Templates
tests: convert test-check-code-hg.py to .t
Mads Kiilerich -
r15557:7bb5ed61 default
parent child Browse files
Show More
@@ -1,24 +1,6 b''
1 # Pass all working directory files through check-code.py
1 $ check_code="$TESTDIR"/../contrib/check-code.py
2
2 $ cd "$TESTDIR"/..
3 import sys, os, imp
4 rootdir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..'))
5 if not os.path.isdir(os.path.join(rootdir, '.hg')):
6 sys.stderr.write('skipped: cannot check code on non-repository sources\n')
7 sys.exit(80)
8
9 checkpath = os.path.join(rootdir, 'contrib/check-code.py')
10 checkcode = imp.load_source('checkcode', checkpath)
11
3
12 from mercurial import hg, ui
4 $ "$check_code" `hg manifest` | grep . && echo 'FAILURE IS NOT AN OPTION!!!'
13 u = ui.ui()
5 [1]
14 repo = hg.repository(u, rootdir)
6
15 checked = 0
16 wctx = repo[None]
17 for f in wctx:
18 # ignore removed and unknown files
19 if f not in wctx:
20 continue
21 checked += 1
22 checkcode.checkfile(os.path.join(rootdir, f))
23 if not checked:
24 sys.stderr.write('no file checked!\n')
General Comments 0
You need to be logged in to leave comments. Login now