diff options
author | Francis Gulotta <wizard@roborooter.com> | 2016-11-19 00:02:41 -0500 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2016-11-26 16:19:56 +0800 |
commit | 951ba0d0a91e87813ea18181c1cbdb5e6ad5ac3b (patch) | |
tree | b8a184f75cca5c55709daf354e2a428a1c80cc6b /tools | |
parent | ca37fa527f174b547893817fe8c67a3befa02317 (diff) | |
download | android-node-v8-951ba0d0a91e87813ea18181c1cbdb5e6ad5ac3b.tar.gz android-node-v8-951ba0d0a91e87813ea18181c1cbdb5e6ad5ac3b.tar.bz2 android-node-v8-951ba0d0a91e87813ea18181c1cbdb5e6ad5ac3b.zip |
tools: allow test.py to use full paths of tests
Allow test.py to run tests with a 'tests/' prefix or a '.js' postfix
PR-URL: https://github.com/nodejs/node/pull/9694
Fixes: https://github.com/nodejs/node/issues/9684
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/test.py b/tools/test.py index 6e1840b767..4a272475cc 100755 --- a/tools/test.py +++ b/tools/test.py @@ -298,7 +298,7 @@ class TapProgressIndicator(SimpleProgressIndicator): if output.HasCrashed(): self.severity = 'crashed' - exit_code = output.output.exit_code + exit_code = output.output.exit_code self.traceback = "oh no!\nexit code: " + PrintCrashed(exit_code) if output.HasTimedOut(): @@ -1461,6 +1461,13 @@ def SplitPath(s): stripped = [ c.strip() for c in s.split('/') ] return [ Pattern(s) for s in stripped if len(s) > 0 ] +def NormalizePath(path): + # strip the extra path information of the specified test + if path.startswith('test/'): + path = path[5:] + if path.endswith('.js'): + path = path[:-3] + return path def GetSpecialCommandProcessor(value): if (not value) or (value.find('@') == -1): @@ -1534,7 +1541,7 @@ def Main(): else: paths = [ ] for arg in args: - path = SplitPath(arg) + path = SplitPath(NormalizePath(arg)) paths.append(path) # Check for --valgrind option. If enabled, we overwrite the special |