From 06428d853cdf96dca5c0dddbedecb303173d2394 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 23 Aug 2011 22:46:39 -0700 Subject: tools/test.py to support marking files a libuv-broken Use export NODE_USE_UV=1 python tools/test.py --libuv simple pummel To run the equivalent of "make test-uv". --- tools/test.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/test.py b/tools/test.py index b0cd9abcd..97b612c65 100755 --- a/tools/test.py +++ b/tools/test.py @@ -46,6 +46,7 @@ sys.path.append(dirname(__file__) + "/../deps/v8/tools"); import utils VERBOSE = False +LIBUV_BROKEN_PATTERN = re.compile(r"//\s+libuv-broken") # --------------------------------------------- @@ -574,10 +575,11 @@ VARIANT_FLAGS = [[]] class TestRepository(TestSuite): - def __init__(self, path): + def __init__(self, path, options): normalized_path = abspath(path) super(TestRepository, self).__init__(basename(normalized_path)) self.path = normalized_path + self.options = options self.is_loaded = False self.config = None @@ -601,8 +603,20 @@ class TestRepository(TestSuite): def AddTestsToList(self, result, current_path, path, context, mode): for v in VARIANT_FLAGS: tests = self.GetConfiguration(context).ListTests(current_path, path, mode) - for t in tests: t.variant_flags = v - result += tests + + for t in tests: + t.variant_flags = v + + if self.options.libuv: + source = open(t.file).read() + broken = LIBUV_BROKEN_PATTERN.search(source) + else: + broken = False + + if not broken: + result += [ t ] + else: + print "Skipping libuv-broken: " + t.file def GetTestStatus(self, context, sections, defs): @@ -1163,6 +1177,8 @@ def BuildOptions(): default=False, action="store_true") result.add_option("--valgrind", help="Run tests through valgrind", default=False, action="store_true") + result.add_option("--libuv", help="Run only tests that aren't marks 'libuv-broken'", + default=False, action="store_true") result.add_option("--cat", help="Print the source of the tests", default=False, action="store_true") result.add_option("--warn-unused", help="Report unused rules", @@ -1298,8 +1314,12 @@ def Main(): workspace = abspath(join(dirname(sys.argv[0]), '..')) suites = GetSuites(join(workspace, 'test')) - repositories = [TestRepository(join(workspace, 'test', name)) for name in suites] - repositories += [TestRepository(a) for a in options.suite] + repositories = [ + TestRepository(join(workspace, 'test', name), options) + for name in suites + ] + + repositories += [TestRepository(a, options) for a in options.suite] root = LiteralTestSuite(repositories) if len(args) == 0: -- cgit v1.2.3