Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tools/testrunner/objects/testcase.py

Issue 1842673002: [test] Fix deterministic test shards. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Key function for more speed. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testrunner/local/testsuite.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/objects/testcase.py
diff --git a/tools/testrunner/objects/testcase.py b/tools/testrunner/objects/testcase.py
index 7d8c21d2debc8a2e768310cac9e773a374391a52..113c624a35d66d43cdc88e49058c7af7b30bb5bd 100644
--- a/tools/testrunner/objects/testcase.py
+++ b/tools/testrunner/objects/testcase.py
@@ -100,3 +100,11 @@ class TestCase(object):
send the name only and retrieve a process-local suite later.
"""
return dict(self.__dict__, suite=self.suite.name)
+
+ def __cmp__(self, other):
+ # Make sure that test cases are sorted correctly if sorted without
+ # key function. But using a key function is preferred for speed.
+ return cmp(
+ (self.suite.name, self.path, self.flags),
+ (other.suite.name, other.path, other.flags),
+ )
« no previous file with comments | « tools/testrunner/local/testsuite.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698