OLD | NEW |
1 # Copyright 2011 the V8 project authors. All rights reserved. | 1 # Copyright 2011 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 testsource = source | 115 testsource = source |
116 for key in replacement.keys(): | 116 for key in replacement.keys(): |
117 testname = testname.replace("$"+key, replacement[key]); | 117 testname = testname.replace("$"+key, replacement[key]); |
118 testsource = testsource.replace("$"+key, replacement[key]); | 118 testsource = testsource.replace("$"+key, replacement[key]); |
119 Test(testname, testsource, expectation) | 119 Test(testname, testsource, expectation) |
120 return MkTest | 120 return MkTest |
121 eval(compile(source, pathname, "exec"), | 121 eval(compile(source, pathname, "exec"), |
122 {"Test": Test, "Template": Template}, {}) | 122 {"Test": Test, "Template": Template}, {}) |
123 | 123 |
124 def ListTests(self, current_path, path, mode, variant_flags): | 124 def ListTests(self, current_path, path, mode, variant_flags): |
125 executable = join('obj', 'preparser', mode, 'preparser') | 125 executable = 'preparser' |
126 if utils.IsWindows(): | 126 if utils.IsWindows(): |
127 executable += '.exe' | 127 executable += '.exe' |
128 executable = join(self.context.buildspace, executable) | 128 executable = join(self.context.buildspace, executable) |
| 129 if not exists(executable): |
| 130 executable = join('obj', 'preparser', mode, 'preparser') |
| 131 if utils.IsWindows(): |
| 132 executable += '.exe' |
| 133 executable = join(self.context.buildspace, executable) |
129 expectations = self.GetExpectations() | 134 expectations = self.GetExpectations() |
130 result = [] | 135 result = [] |
131 # Find all .js files in tests/preparser directory. | 136 # Find all .js files in tests/preparser directory. |
132 filenames = [f[:-3] for f in os.listdir(self.root) if f.endswith(".js")] | 137 filenames = [f[:-3] for f in os.listdir(self.root) if f.endswith(".js")] |
133 filenames.sort() | 138 filenames.sort() |
134 for file in filenames: | 139 for file in filenames: |
135 throws = None; | 140 throws = None; |
136 if (file in expectations): | 141 if (file in expectations): |
137 throws = expectations[file] | 142 throws = expectations[file] |
138 result.append(PreparserTestCase(self.root, | 143 result.append(PreparserTestCase(self.root, |
(...skipping 13 matching lines...) Expand all Loading... |
152 status_file = join(self.root, 'preparser.status') | 157 status_file = join(self.root, 'preparser.status') |
153 if exists(status_file): | 158 if exists(status_file): |
154 test.ReadConfigurationInto(status_file, sections, defs) | 159 test.ReadConfigurationInto(status_file, sections, defs) |
155 | 160 |
156 def VariantFlags(self): | 161 def VariantFlags(self): |
157 return [[]]; | 162 return [[]]; |
158 | 163 |
159 | 164 |
160 def GetConfiguration(context, root): | 165 def GetConfiguration(context, root): |
161 return PreparserTestConfiguration(context, root) | 166 return PreparserTestConfiguration(context, root) |
OLD | NEW |