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

Unified Diff: infra/scripts/legacy/scripts/slave/gtest/test_result.py

Issue 1213433006: Fork runtest.py and everything it needs src-side for easier hacking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: runisolatedtest.py Created 5 years, 6 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
Index: infra/scripts/legacy/scripts/slave/gtest/test_result.py
diff --git a/infra/scripts/legacy/scripts/slave/gtest/test_result.py b/infra/scripts/legacy/scripts/slave/gtest/test_result.py
new file mode 100644
index 0000000000000000000000000000000000000000..3efd37dbe78b68331f88f2e9f698c7f60075739c
--- /dev/null
+++ b/infra/scripts/legacy/scripts/slave/gtest/test_result.py
@@ -0,0 +1,42 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+def canonical_name(name):
+ new_name = name.replace('FLAKY_', '', 1)
+ new_name = new_name.replace('FAILS_', '', 1)
+ new_name = new_name.replace('DISABLED_', '', 1)
+ return new_name
+
+
+class TestResult(object):
+ """A simple class that represents a single test result."""
+
+ # Test modifier constants.
+ (NONE, FAILS, FLAKY, DISABLED) = range(4)
+
+ def __init__(self, test, failed, not_run=False, elapsed_time=0):
+ self.test_name = canonical_name(test)
+ self.failed = failed
+ self.test_run_time = elapsed_time
+
+ test_name = test
+ try:
+ test_name = test.split('.')[1]
+ except IndexError:
+ pass
+
+ if not_run:
+ self.modifier = self.DISABLED
+ elif test_name.startswith('FAILS_'):
+ self.modifier = self.FAILS
+ elif test_name.startswith('FLAKY_'):
+ self.modifier = self.FLAKY
+ elif test_name.startswith('DISABLED_'):
+ self.modifier = self.DISABLED
+ else:
+ self.modifier = self.NONE
+
+ def fixable(self):
+ return self.failed or self.modifier == self.DISABLED

Powered by Google App Engine
This is Rietveld 408576698