@@ -1531,23 +1531,6 @@ def ExpandCommand(args):
15311531 return prefix + args + suffix
15321532 return ExpandCommand
15331533
1534-
1535- BUILT_IN_TESTS = [
1536- 'sequential' ,
1537- 'parallel' ,
1538- 'pummel' ,
1539- 'message' ,
1540- 'internet' ,
1541- 'addons' ,
1542- 'addons-napi' ,
1543- 'gc' ,
1544- 'debugger' ,
1545- 'doctool' ,
1546- 'inspector' ,
1547- 'async-hooks' ,
1548- ]
1549-
1550-
15511534def GetSuites(test_root):
15521535 def IsSuite(path):
15531536 return isdir(path) and exists(join(path, 'testcfg.py'))
@@ -1566,6 +1549,32 @@ def PrintCrashed(code):
15661549 return "CRASHED (Signal: %d)" % -code
15671550
15681551
1552+ # these suites represent special cases that should not be run as part of the
1553+ # default JavaScript test-run, e.g., internet/ requires a network connection,
1554+ # addons/ requires compilation.
1555+ IGNORED_SUITES = [
1556+ 'addons',
1557+ 'addons-napi',
1558+ 'gc',
1559+ 'internet',
1560+ 'pummel',
1561+ 'test-known-issues',
1562+ 'tick-processor',
1563+ 'timers'
1564+ ]
1565+
1566+
1567+ def ArgsToTestPaths(test_root, args, suites):
1568+ if len(args) == 0 or 'default' in args:
1569+ def_suites = filter(lambda s: s not in IGNORED_SUITES, suites)
1570+ args = filter(lambda a: a != 'default', args) + def_suites
1571+ subsystem_regex = re.compile(r'^[a-zA-Z-]*$')
1572+ check = lambda arg: subsystem_regex.match(arg) and (arg not in suites)
1573+ mapped_args = ["*/test*-%s-*" % arg if check(arg) else arg for arg in args]
1574+ paths = [SplitPath(NormalizePath(a)) for a in mapped_args]
1575+ return paths
1576+
1577+
15691578def Main():
15701579 parser = BuildOptions()
15711580 (options, args) = parser.parse_args()
@@ -1581,18 +1590,13 @@ def Main():
15811590 logger.addHandler(fh)
15821591
15831592 workspace = abspath(join(dirname(sys.argv[0]), '..'))
1584- suites = GetSuites (join (workspace , 'test' ))
1593+ test_root = join(workspace, 'test')
1594+ suites = GetSuites(test_root)
15851595 repositories = [TestRepository(join(workspace, 'test', name)) for name in suites]
15861596 repositories += [TestRepository(a) for a in options.suite]
15871597
15881598 root = LiteralTestSuite(repositories)
1589- if len (args ) == 0 :
1590- paths = [SplitPath (t ) for t in BUILT_IN_TESTS ]
1591- else :
1592- paths = [ ]
1593- for arg in args :
1594- path = SplitPath (NormalizePath (arg ))
1595- paths .append (path )
1599+ paths = ArgsToTestPaths(test_root, args, suites)
15961600
15971601 # Check for --valgrind option. If enabled, we overwrite the special
15981602 # command flag with a command that uses the run-valgrind.py script.
0 commit comments