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 21 matching lines...) Expand all Loading... |
32 def __init__(self, suite, path, flags=[], dependency=None): | 32 def __init__(self, suite, path, flags=[], dependency=None): |
33 self.suite = suite # TestSuite object | 33 self.suite = suite # TestSuite object |
34 self.path = path # string, e.g. 'div-mod', 'test-api/foo' | 34 self.path = path # string, e.g. 'div-mod', 'test-api/foo' |
35 self.flags = flags # list of strings, flags specific to this test case | 35 self.flags = flags # list of strings, flags specific to this test case |
36 self.dependency = dependency # |path| for testcase that must be run first | 36 self.dependency = dependency # |path| for testcase that must be run first |
37 self.outcomes = None | 37 self.outcomes = None |
38 self.output = None | 38 self.output = None |
39 self.id = None # int, used to map result back to TestCase instance | 39 self.id = None # int, used to map result back to TestCase instance |
40 self.duration = None # assigned during execution | 40 self.duration = None # assigned during execution |
41 | 41 |
| 42 def Copy(self): |
| 43 copy = TestCase(self.suite, self.path, self.flags, self.dependency) |
| 44 copy.outcomes = self.outcomes |
| 45 copy.id = self.id |
| 46 return copy |
| 47 |
42 def CopyAddingFlags(self, flags): | 48 def CopyAddingFlags(self, flags): |
43 copy = TestCase(self.suite, self.path, self.flags + flags, self.dependency) | 49 copy = TestCase(self.suite, self.path, self.flags + flags, self.dependency) |
44 copy.outcomes = self.outcomes | 50 copy.outcomes = self.outcomes |
45 return copy | 51 return copy |
46 | 52 |
47 def PackTask(self): | 53 def PackTask(self): |
48 """ | 54 """ |
49 Extracts those parts of this object that are required to run the test | 55 Extracts those parts of this object that are required to run the test |
50 and returns them as a JSON serializable object. | 56 and returns them as a JSON serializable object. |
51 """ | 57 """ |
(...skipping 22 matching lines...) Expand all Loading... |
74 """Applies the contents of a Result to this object.""" | 80 """Applies the contents of a Result to this object.""" |
75 assert result[0] == self.id | 81 assert result[0] == self.id |
76 self.output = output.Output.Unpack(result[1]) | 82 self.output = output.Output.Unpack(result[1]) |
77 self.duration = result[2] | 83 self.duration = result[2] |
78 | 84 |
79 def suitename(self): | 85 def suitename(self): |
80 return self.suite.name | 86 return self.suite.name |
81 | 87 |
82 def GetLabel(self): | 88 def GetLabel(self): |
83 return self.suitename() + "/" + self.suite.CommonTestName(self) | 89 return self.suitename() + "/" + self.suite.CommonTestName(self) |
OLD | NEW |