summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-10-19 07:08:09 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-10-19 07:08:09 -0700
commit640c9de47b0c2f97d04506a032f6f935d5435f24 (patch)
tree81467ffb2c6f8162b9fb1301b54a86cedd404aff
parenteef0f07b8a6ce3682d96393146121f947634107c (diff)
parent0b9094b99e56fc6f29d856848e8e639e1316d15d (diff)
downloadnumpy-640c9de47b0c2f97d04506a032f6f935d5435f24.tar.gz
Merge pull request #3948 from pv/runtests-path
BUG: runtests: make -t option work again
-rwxr-xr-xruntests.py17
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: