Mercurial > hgsubversion
comparison tests/run.py @ 394:d70c8e45cb9e
tests: add -A option to run.py for running comprehensive tests
| author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
|---|---|
| date | Thu, 11 Jun 2009 11:34:37 +0200 |
| parents | e857e5cfc10f |
| children | 636e9bf5d49c |
comparison
equal
deleted
inserted
replaced
| 393:e857e5cfc10f | 394:d70c8e45cb9e |
|---|---|
| 23 import test_svnwrap | 23 import test_svnwrap |
| 24 import test_tags | 24 import test_tags |
| 25 import test_utility_commands | 25 import test_utility_commands |
| 26 import test_urls | 26 import test_urls |
| 27 | 27 |
| 28 from comprehensive import test_stupid_pull | |
| 29 | |
| 30 def comprehensive(mod): | |
| 31 dir = os.path.basename(os.path.dirname(mod.__file__)) | |
| 32 return dir == 'comprehensive' | |
| 33 | |
| 28 if __name__ == '__main__': | 34 if __name__ == '__main__': |
| 29 | 35 |
| 30 kwargs = {'descriptions': 2} | 36 kwargs = {'descriptions': 2} |
| 31 if '-v' in sys.argv: | 37 if '-v' in sys.argv: |
| 32 kwargs['descriptions'] = 3 | 38 kwargs['descriptions'] = 3 |
| 41 | 47 |
| 42 args = [i for i in sys.argv[1:] if i.startswith('test')] | 48 args = [i for i in sys.argv[1:] if i.startswith('test')] |
| 43 args = [i.split('.py')[0].replace('-', '_') for i in args] | 49 args = [i.split('.py')[0].replace('-', '_') for i in args] |
| 44 | 50 |
| 45 if not args: | 51 if not args: |
| 46 suite = [i[1].suite() for i in sorted(all.iteritems())] | 52 check = lambda x: '-A' in sys.argv or not comprehensive(x) |
| 53 mods = [m for (n, m) in sorted(all.iteritems()) if check(m)] | |
| 54 suite = [m.suite() for m in mods] | |
| 47 else: | 55 else: |
| 48 suite = [] | 56 suite = [] |
| 49 for arg in args: | 57 for arg in args: |
| 50 if arg not in all: | 58 if arg not in all: |
| 51 print >> sys.stderr, 'test module %s not available' % arg | 59 print >> sys.stderr, 'test module %s not available' % arg |
