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 20 matching lines...) Expand all Loading... |
31 from testrunner.local import commands | 31 from testrunner.local import commands |
32 from testrunner.local import testsuite | 32 from testrunner.local import testsuite |
33 from testrunner.local import utils | 33 from testrunner.local import utils |
34 from testrunner.objects import testcase | 34 from testrunner.objects import testcase |
35 | 35 |
36 | 36 |
37 class CcTestSuite(testsuite.TestSuite): | 37 class CcTestSuite(testsuite.TestSuite): |
38 | 38 |
39 def __init__(self, name, root): | 39 def __init__(self, name, root): |
40 super(CcTestSuite, self).__init__(name, root) | 40 super(CcTestSuite, self).__init__(name, root) |
41 self.serdes_dir = normpath(join(root, "..", "..", "out", ".serdes")) | 41 self.serdes_dir = os.path.normpath( |
42 if exists(self.serdes_dir): | 42 os.path.join(root, "..", "..", "out", ".serdes")) |
| 43 if os.path.exists(self.serdes_dir): |
43 shutil.rmtree(self.serdes_dir, True) | 44 shutil.rmtree(self.serdes_dir, True) |
44 os.makedirs(self.serdes_dir) | 45 os.makedirs(self.serdes_dir) |
45 | 46 |
46 def ListTests(self, context): | 47 def ListTests(self, context): |
47 shell = join(context.shell_dir, self.shell()) | |
48 if utils.IsWindows(): | 48 if utils.IsWindows(): |
49 shell += '.exe' | 49 shell += '.exe' |
50 output = commands.Execute([shell, '--list']) | 50 shell = os.path.abspath(os.path.join(context.shell_dir, self.shell())) |
| 51 output = commands.Execute([context.command_prefix, |
| 52 shell, |
| 53 '--list', |
| 54 context.extra_flags]) |
51 if output.exit_code != 0: | 55 if output.exit_code != 0: |
52 print output.stdout | 56 print output.stdout |
53 print output.stderr | 57 print output.stderr |
54 return [] | 58 return [] |
55 tests = [] | 59 tests = [] |
56 for test_desc in output.stdout.strip().split(): | 60 for test_desc in output.stdout.strip().split(): |
57 raw_test, dependency = test_desc.split('<') | 61 raw_test, dependency = test_desc.split('<') |
58 if dependency != '': | 62 if dependency != '': |
59 dependency = raw_test.split('/')[0] + '/' + dependency | 63 dependency = raw_test.split('/')[0] + '/' + dependency |
60 else: | 64 else: |
61 dependency = None | 65 dependency = None |
62 test = testcase.TestCase(self, raw_test, dependency=dependency) | 66 test = testcase.TestCase(self, raw_test, dependency=dependency) |
63 tests.append(test) | 67 tests.append(test) |
64 tests.sort() | 68 tests.sort() |
65 return tests | 69 return tests |
66 | 70 |
67 def GetFlagsForTestCase(self, testcase, context): | 71 def GetFlagsForTestCase(self, testcase, context): |
68 testname = testcase.path.split(os.path.sep)[-1] | 72 testname = testcase.path.split(os.path.sep)[-1] |
69 serialization_file = join(self.serdes_dir, "serdes_" + testname) | 73 serialization_file = os.path.join(self.serdes_dir, "serdes_" + testname) |
70 serialization_file += ''.join(testcase.flags).replace('-', '_') | 74 serialization_file += ''.join(testcase.flags).replace('-', '_') |
71 return (testcase.flags + [testcase.path] + context.mode_flags + | 75 return (testcase.flags + [testcase.path] + context.mode_flags + |
72 ["--testing_serialization_file=" + serialization_file]) | 76 ["--testing_serialization_file=" + serialization_file]) |
73 | 77 |
74 def shell(self): | 78 def shell(self): |
75 return "cctest" | 79 return "cctest" |
76 | 80 |
77 | 81 |
78 def GetSuite(name, root): | 82 def GetSuite(name, root): |
79 return CcTestSuite(name, root) | 83 return CcTestSuite(name, root) |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 return result | 171 return result |
168 | 172 |
169 def GetTestStatus(self, sections, defs): | 173 def GetTestStatus(self, sections, defs): |
170 status_file = join(self.root, 'cctest.status') | 174 status_file = join(self.root, 'cctest.status') |
171 if exists(status_file): | 175 if exists(status_file): |
172 test.ReadConfigurationInto(status_file, sections, defs) | 176 test.ReadConfigurationInto(status_file, sections, defs) |
173 | 177 |
174 | 178 |
175 def GetConfiguration(context, root): | 179 def GetConfiguration(context, root): |
176 return CcTestConfiguration(context, root) | 180 return CcTestConfiguration(context, root) |
OLD | NEW |