OLD | NEW |
1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 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 11 matching lines...) Expand all Loading... |
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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 import test | 28 import test |
29 import os | 29 import os |
30 from os.path import join, dirname, exists | 30 from os.path import join, dirname, exists |
31 import platform | 31 import platform |
32 | 32 import utils |
33 | 33 |
34 DEBUG_FLAGS = ['--enable-slow-asserts', '--debug-code', '--verify-heap'] | 34 DEBUG_FLAGS = ['--enable-slow-asserts', '--debug-code', '--verify-heap'] |
35 | 35 |
36 | 36 |
37 class CcTestCase(test.TestCase): | 37 class CcTestCase(test.TestCase): |
38 | 38 |
39 def __init__(self, path, executable, mode, raw_name, context): | 39 def __init__(self, path, executable, mode, raw_name, context): |
40 super(CcTestCase, self).__init__(context, path) | 40 super(CcTestCase, self).__init__(context, path) |
41 self.executable = executable | 41 self.executable = executable |
42 self.mode = mode | 42 self.mode = mode |
(...skipping 15 matching lines...) Expand all Loading... |
58 class CcTestConfiguration(test.TestConfiguration): | 58 class CcTestConfiguration(test.TestConfiguration): |
59 | 59 |
60 def __init__(self, context, root): | 60 def __init__(self, context, root): |
61 super(CcTestConfiguration, self).__init__(context, root) | 61 super(CcTestConfiguration, self).__init__(context, root) |
62 | 62 |
63 def GetBuildRequirements(self): | 63 def GetBuildRequirements(self): |
64 return ['cctests'] | 64 return ['cctests'] |
65 | 65 |
66 def ListTests(self, current_path, path, mode): | 66 def ListTests(self, current_path, path, mode): |
67 executable = join('obj', 'test', mode, 'cctest') | 67 executable = join('obj', 'test', mode, 'cctest') |
68 if (platform.system() == 'Windows'): | 68 if utils.IsWindows(): |
69 executable += '.exe' | 69 executable += '.exe' |
70 output = test.Execute([executable, '--list'], self.context) | 70 output = test.Execute([executable, '--list'], self.context) |
71 if output.exit_code != 0: | 71 if output.exit_code != 0: |
72 print output.stdout | 72 print output.stdout |
73 print output.stderr | 73 print output.stderr |
74 return [] | 74 return [] |
75 result = [] | 75 result = [] |
76 for raw_test in output.stdout.strip().split(): | 76 for raw_test in output.stdout.strip().split(): |
77 full_path = current_path + raw_test.split('/') | 77 full_path = current_path + raw_test.split('/') |
78 if self.Contains(path, full_path): | 78 if self.Contains(path, full_path): |
79 result.append(CcTestCase(full_path, executable, mode, raw_test, self.con
text)) | 79 result.append(CcTestCase(full_path, executable, mode, raw_test, self.con
text)) |
80 return result | 80 return result |
81 | 81 |
82 def GetTestStatus(self, sections, defs): | 82 def GetTestStatus(self, sections, defs): |
83 status_file = join(self.root, 'cctest.status') | 83 status_file = join(self.root, 'cctest.status') |
84 if exists(status_file): | 84 if exists(status_file): |
85 test.ReadConfigurationInto(status_file, sections, defs) | 85 test.ReadConfigurationInto(status_file, sections, defs) |
86 | 86 |
87 | 87 |
88 def GetConfiguration(context, root): | 88 def GetConfiguration(context, root): |
89 return CcTestConfiguration(context, root) | 89 return CcTestConfiguration(context, root) |
OLD | NEW |