Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: pkg/dev_compiler/test/codegen_test.dart

Issue 2456803004: fixes #27586, prefer context type in generic inference (Closed)
Patch Set: fix Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Tests code generation. 5 /// Tests code generation.
6 /// 6 ///
7 /// Runs Dart Dev Compiler on all input in the `codegen` directory and checks 7 /// Runs Dart Dev Compiler on all input in the `codegen` directory and checks
8 /// that the output is what we expected. 8 /// that the output is what we expected.
9 library dev_compiler.test.codegen_test; 9 library dev_compiler.test.codegen_test;
10 10
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 var files = new Set<String>(); 149 var files = new Set<String>();
150 _collectTransitiveImports(contents, files, from: testFile); 150 _collectTransitiveImports(contents, files, from: testFile);
151 var unit = new BuildUnit( 151 var unit = new BuildUnit(
152 name, path.dirname(testFile), files.toList(), _moduleForLibrary); 152 name, path.dirname(testFile), files.toList(), _moduleForLibrary);
153 153
154 var compiler = sharedCompiler; 154 var compiler = sharedCompiler;
155 if (analyzerOptions.declaredVariables.isNotEmpty) { 155 if (analyzerOptions.declaredVariables.isNotEmpty) {
156 compiler = new ModuleCompiler(analyzerOptions); 156 compiler = new ModuleCompiler(analyzerOptions);
157 } 157 }
158 JSModuleFile module = null; 158 JSModuleFile module = null;
159 var error, trace;
160 try { 159 try {
161 module = compiler.compile(unit, options); 160 module = compiler.compile(unit, options);
162 } catch (e, t) { 161 } catch (e) {}
163 error = e;
164 trace = t;
165 }
166 162
167 bool expectedCompileTimeError = 163 bool expectedCompileTimeError =
168 contents.contains(': compile-time error\n'); 164 contents.contains(': compile-time error\n');
169 bool notStrong = notYetStrongTests.contains(name); 165 bool notStrong = notYetStrongTests.contains(name);
170 bool crashing = _crashingTests.contains(name); 166 bool crashing = _crashingTests.contains(name);
171 167
172 if (module == null) { 168 if (module == null) {
173 expect(crashing, isTrue, 169 expect(crashing, isTrue,
174 reason: "test $name crashes during compilation.\n\n" 170 reason: "test $name crashes during compilation.");
175 "Exception: $error\n\nStack trace:\n\n$trace");
176 } else if (module.isValid) { 171 } else if (module.isValid) {
177 _writeModule( 172 _writeModule(
178 path.join(codegenOutputDir, name), 173 path.join(codegenOutputDir, name),
179 isTopLevelTest ? path.join(codegenExpectDir, name) : null, 174 isTopLevelTest ? path.join(codegenExpectDir, name) : null,
180 moduleFormat, 175 moduleFormat,
181 module); 176 module);
182 177
183 expect(crashing, isFalse, reason: "test $name no longer crashes."); 178 expect(crashing, isFalse, reason: "test $name no longer crashes.");
184 // TODO(vsm): We don't seem to trip on non-strong errors? 179 // TODO(vsm): We don't seem to trip on non-strong errors?
185 // expect(expectedCompileTimeError, isFalse, 180 // expect(expectedCompileTimeError, isFalse,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 404
410 // TODO(vsm): Fix these - they import files from a different directory 405 // TODO(vsm): Fix these - they import files from a different directory
411 // - this triggers an invalid library root build error. 406 // - this triggers an invalid library root build error.
412 'lib/html/custom/attribute_changed_callback_test', 407 'lib/html/custom/attribute_changed_callback_test',
413 'lib/html/custom/constructor_calls_created_synchronously_test', 408 'lib/html/custom/constructor_calls_created_synchronously_test',
414 'lib/html/custom/entered_left_view_test', 409 'lib/html/custom/entered_left_view_test',
415 'lib/html/custom/js_custom_test', 410 'lib/html/custom/js_custom_test',
416 'lib/html/custom/mirrors_test', 411 'lib/html/custom/mirrors_test',
417 'lib/html/custom/regress_194523002_test', 412 'lib/html/custom/regress_194523002_test',
418 ]); 413 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698