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 24 matching lines...) Expand all Loading... |
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 if utils.IsWindows(): | 41 if utils.IsWindows(): |
42 build_dir = "build" | 42 build_dir = "build" |
43 else: | 43 else: |
44 build_dir = "out" | 44 build_dir = "out" |
45 self.serdes_dir = os.path.normpath( | |
46 os.path.join(root, "..", "..", build_dir, ".serdes")) | |
47 | |
48 def SetupWorkingDirectory(self): | |
49 # This is only called once per machine, while init above is called once per | |
50 # process. | |
51 if os.path.exists(self.serdes_dir): | |
52 shutil.rmtree(self.serdes_dir, True) | |
53 os.makedirs(self.serdes_dir) | |
54 | 45 |
55 def ListTests(self, context): | 46 def ListTests(self, context): |
56 shell = os.path.abspath(os.path.join(context.shell_dir, self.shell())) | 47 shell = os.path.abspath(os.path.join(context.shell_dir, self.shell())) |
57 if utils.IsWindows(): | 48 if utils.IsWindows(): |
58 shell += ".exe" | 49 shell += ".exe" |
59 output = commands.Execute(context.command_prefix + | 50 output = commands.Execute(context.command_prefix + |
60 [shell, "--list"] + | 51 [shell, "--list"] + |
61 context.extra_flags) | 52 context.extra_flags) |
62 if output.exit_code != 0: | 53 if output.exit_code != 0: |
63 print output.stdout | 54 print output.stdout |
64 print output.stderr | 55 print output.stderr |
65 return [] | 56 return [] |
66 tests = [] | 57 tests = [] |
67 for test_desc in output.stdout.strip().split(): | 58 for test_desc in output.stdout.strip().split(): |
68 test = testcase.TestCase(self, test_desc) | 59 test = testcase.TestCase(self, test_desc) |
69 tests.append(test) | 60 tests.append(test) |
70 tests.sort() | 61 tests.sort() |
71 return tests | 62 return tests |
72 | 63 |
73 def GetFlagsForTestCase(self, testcase, context): | 64 def GetFlagsForTestCase(self, testcase, context): |
74 testname = testcase.path.split(os.path.sep)[-1] | 65 testname = testcase.path.split(os.path.sep)[-1] |
75 serialization_file = os.path.join(self.serdes_dir, "serdes_" + testname) | 66 return (testcase.flags + [testcase.path] + context.mode_flags) |
76 serialization_file += ''.join(testcase.flags).replace('-', '_') | |
77 return (testcase.flags + [testcase.path] + context.mode_flags + | |
78 ["--testing_serialization_file=" + serialization_file]) | |
79 | 67 |
80 def shell(self): | 68 def shell(self): |
81 return "cctest" | 69 return "cctest" |
82 | 70 |
83 | 71 |
84 def GetSuite(name, root): | 72 def GetSuite(name, root): |
85 return CcTestSuite(name, root) | 73 return CcTestSuite(name, root) |
OLD | NEW |