summaryrefslogtreecommitdiff
path: root/runtests.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2017-06-20 20:38:44 +1200
committerRalf Gommers <ralf.gommers@gmail.com>2017-06-21 18:09:51 +1200
commit0a2614309f261c4a6043d410d8d14612da3f7025 (patch)
treefdd8abc3a50d50b40546e6051494083139725510 /runtests.py
parent710523769fd570c05cab46ab45764a36a7907c05 (diff)
downloadnumpy-0a2614309f261c4a6043d410d8d14612da3f7025.tar.gz
TST: add a --timer argument to runtests.
Diffstat (limited to 'runtests.py')
-rwxr-xr-xruntests.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/runtests.py b/runtests.py
index 7a72ca517..bb2c2393b 100755
--- a/runtests.py
+++ b/runtests.py
@@ -13,6 +13,7 @@ Examples::
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
$ python runtests.py --bench
+ $ python runtests.py --timer 20
Run a debugger:
@@ -77,6 +78,8 @@ def main(argv):
parser.add_argument("--coverage", action="store_true", default=False,
help=("report coverage of project code. HTML output goes "
"under build/coverage"))
+ parser.add_argument("--timer", action="store", default=0, type=int,
+ help=("Time N slowest test"))
parser.add_argument("--gcov", action="store_true", default=False,
help=("enable C code coverage via gcov (requires GCC). "
"gcov output goes to build/**/*.gc*"))
@@ -117,6 +120,16 @@ def main(argv):
help="Arguments to pass to Nose, Python or shell")
args = parser.parse_args(argv)
+ if args.timer == 0:
+ timer = False
+ elif args.timer == -1:
+ timer = True
+ elif args.timer > 0:
+ timer = int(args.timer)
+ else:
+ raise ValueError("--timer value should be an integer, -1 or >0")
+ args.timer = timer
+
if args.bench_compare:
args.bench = True
args.no_build = True # ASV does the building
@@ -293,7 +306,8 @@ def main(argv):
extra_argv=extra_argv,
doctests=args.doctests,
raise_warnings=args.raise_warnings,
- coverage=args.coverage)
+ coverage=args.coverage,
+ timer=args.timer)
finally:
os.chdir(cwd)