| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 import imp | 29 import imp |
| 30 import os | 30 import os |
| 31 | 31 |
| 32 from . import statusfile | 32 from . import statusfile |
| 33 from . import utils |
| 33 | 34 |
| 34 class TestSuite(object): | 35 class TestSuite(object): |
| 35 | 36 |
| 36 @staticmethod | 37 @staticmethod |
| 37 def LoadTestSuite(root): | 38 def LoadTestSuite(root): |
| 38 name = root.split(os.path.sep)[-1] | 39 name = root.split(os.path.sep)[-1] |
| 39 f = None | 40 f = None |
| 40 try: | 41 try: |
| 41 (f, pathname, description) = imp.find_module("testcfg", [root]) | 42 (f, pathname, description) = imp.find_module("testcfg", [root]) |
| 42 module = imp.load_module("testcfg", f, pathname, description) | 43 module = imp.load_module("testcfg", f, pathname, description) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 statusfile.ReadStatusFile(self.status_file(), variables) | 82 statusfile.ReadStatusFile(self.status_file(), variables) |
| 82 | 83 |
| 83 def ReadTestCases(self, context): | 84 def ReadTestCases(self, context): |
| 84 self.tests = self.ListTests(context) | 85 self.tests = self.ListTests(context) |
| 85 | 86 |
| 86 def FilterTestCasesByStatus(self, warn_unused_rules): | 87 def FilterTestCasesByStatus(self, warn_unused_rules): |
| 87 filtered = [] | 88 filtered = [] |
| 88 used_rules = set() | 89 used_rules = set() |
| 89 for t in self.tests: | 90 for t in self.tests: |
| 90 testname = self.CommonTestName(t) | 91 testname = self.CommonTestName(t) |
| 92 if utils.IsWindows(): |
| 93 testname = testname.replace("\\", "/") |
| 91 if testname in self.rules: | 94 if testname in self.rules: |
| 92 used_rules.add(testname) | 95 used_rules.add(testname) |
| 93 outcomes = self.rules[testname] | 96 outcomes = self.rules[testname] |
| 94 t.outcomes = outcomes # Even for skipped tests, as the TestCase | 97 t.outcomes = outcomes # Even for skipped tests, as the TestCase |
| 95 # object stays around and PrintReport() uses it. | 98 # object stays around and PrintReport() uses it. |
| 96 if statusfile.DoSkip(outcomes): | 99 if statusfile.DoSkip(outcomes): |
| 97 continue # Don't add skipped tests to |filtered|. | 100 continue # Don't add skipped tests to |filtered|. |
| 98 if len(self.wildcards) != 0: | 101 if len(self.wildcards) != 0: |
| 99 skip = False | 102 skip = False |
| 100 for rule in self.wildcards: | 103 for rule in self.wildcards: |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 def StripOutputForTransmit(self, testcase): | 178 def StripOutputForTransmit(self, testcase): |
| 176 if not self.HasUnexpectedOutput(testcase): | 179 if not self.HasUnexpectedOutput(testcase): |
| 177 testcase.output.stdout = "" | 180 testcase.output.stdout = "" |
| 178 testcase.output.stderr = "" | 181 testcase.output.stderr = "" |
| 179 | 182 |
| 180 def CalculateTotalDuration(self): | 183 def CalculateTotalDuration(self): |
| 181 self.total_duration = 0.0 | 184 self.total_duration = 0.0 |
| 182 for t in self.tests: | 185 for t in self.tests: |
| 183 self.total_duration += t.duration | 186 self.total_duration += t.duration |
| 184 return self.total_duration | 187 return self.total_duration |
| OLD | NEW |