diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-08-23 22:46:39 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-23 23:45:46 -0700 |
commit | 06428d853cdf96dca5c0dddbedecb303173d2394 (patch) | |
tree | 72a0c0795936d33d8b6f5a3a6d9fea865a72624a /tools | |
parent | 4e1d6fca8e6801292213be9a06914fe088df6e64 (diff) | |
download | nodejs-06428d853cdf96dca5c0dddbedecb303173d2394.tar.gz nodejs-06428d853cdf96dca5c0dddbedecb303173d2394.tar.bz2 nodejs-06428d853cdf96dca5c0dddbedecb303173d2394.zip |
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".
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test.py | 30 |
1 files changed, 25 insertions, 5 deletions
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: |