diff options
author | Pauli Virtanen <pav@iki.fi> | 2013-10-19 13:39:00 +0300 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2013-10-19 13:45:04 +0300 |
commit | 0b9094b99e56fc6f29d856848e8e639e1316d15d (patch) | |
tree | 0f25bf0e238011fe5dd027e8f4c429ccad71318f /runtests.py | |
parent | 18acfa462a63bcdaf86360f0c94bc9347ecafad5 (diff) | |
download | python-numpy-0b9094b99e56fc6f29d856848e8e639e1316d15d.tar.gz python-numpy-0b9094b99e56fc6f29d856848e8e639e1316d15d.tar.bz2 python-numpy-0b9094b99e56fc6f29d856848e8e639e1316d15d.zip |
BUG: runtests: make -t option work again
Diffstat (limited to 'runtests.py')
-rwxr-xr-x | runtests.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/runtests.py b/runtests.py index 5f7239240..c50de3b37 100755 --- a/runtests.py +++ b/runtests.py @@ -136,6 +136,8 @@ def main(argv): extra_argv += ['--cover-html', '--cover-html-dir='+dst_dir] + test_dir = os.path.join(ROOT_DIR, 'build', 'test') + if args.build_only: sys.exit(0) elif args.submodule: @@ -147,19 +149,26 @@ def main(argv): print("Cannot run tests for %s" % modname) sys.exit(2) elif args.tests: + def fix_test_path(x): + # fix up test path + p = x.split(':') + p[0] = os.path.relpath(os.path.abspath(p[0]), + test_dir) + return ':'.join(p) + + tests = [fix_test_path(x) for x in args.tests] + def test(*a, **kw): extra_argv = kw.pop('extra_argv', ()) - extra_argv = extra_argv + args.tests[1:] + extra_argv = extra_argv + tests[1:] kw['extra_argv'] = extra_argv from numpy.testing import Tester - return Tester(args.tests[0]).test(*a, **kw) + return Tester(tests[0]).test(*a, **kw) else: __import__(PROJECT_MODULE) test = sys.modules[PROJECT_MODULE].test # Run the tests under build/test - test_dir = os.path.join(ROOT_DIR, 'build', 'test') - try: shutil.rmtree(test_dir) except OSError: |