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

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

Issue 2987093002: Use status files for DDC's presubmit script/travis bot (Closed)
Patch Set: merged Created 3 years, 4 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
11 // TODO(rnystrom): This doesn't actually run any tests any more. It just 11 // TODO(rnystrom): This doesn't actually run any tests any more. It just
12 // compiles stuff. This should be changed to not use unittest and just be a 12 // compiles stuff. This should be changed to not use unittest and just be a
13 // regular program that outputs files. 13 // regular program that outputs files.
14 14
15 import 'dart:convert';
15 import 'dart:io' show Directory, File, Platform; 16 import 'dart:io' show Directory, File, Platform;
16 import 'package:analyzer/analyzer.dart' 17 import 'package:analyzer/analyzer.dart'
17 show 18 show
18 ExportDirective, 19 ExportDirective,
19 ImportDirective, 20 ImportDirective,
20 StringLiteral, 21 StringLiteral,
21 UriBasedDirective, 22 UriBasedDirective,
22 parseDirectives; 23 parseDirectives;
23 import 'package:analyzer/src/command_line/arguments.dart' 24 import 'package:analyzer/src/command_line/arguments.dart'
24 show defineAnalysisArguments; 25 show defineAnalysisArguments;
25 import 'package:analyzer/src/dart/ast/ast.dart'; 26 import 'package:analyzer/src/dart/ast/ast.dart';
26 import 'package:analyzer/src/generated/source.dart' show Source; 27 import 'package:analyzer/src/generated/source.dart' show Source;
27 import 'package:args/args.dart' show ArgParser, ArgResults; 28 import 'package:args/args.dart' show ArgParser, ArgResults;
28 import 'package:dev_compiler/src/analyzer/context.dart'; 29 import 'package:dev_compiler/src/analyzer/context.dart';
29 import 'package:dev_compiler/src/compiler/compiler.dart' 30 import 'package:dev_compiler/src/compiler/compiler.dart'
30 show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler; 31 show BuildUnit, CompilerOptions, JSModuleFile, ModuleCompiler;
31 import 'package:dev_compiler/src/compiler/module_builder.dart' 32 import 'package:dev_compiler/src/compiler/module_builder.dart'
32 show ModuleFormat, addModuleFormatOptions, parseModuleFormatOption; 33 show ModuleFormat, addModuleFormatOptions, parseModuleFormatOption;
33 import 'package:path/path.dart' as path; 34 import 'package:path/path.dart' as path;
34 import 'package:test/test.dart' show expect, isFalse, isTrue, test; 35 import 'package:test/test.dart' show expect, isFalse, isTrue, test;
36 import 'package:status_file/expectation.dart';
37 import 'package:test_dart/path.dart' as test_dart;
38 import 'package:test_dart/test_suite.dart' show StandardTestSuite;
39 import 'package:test_dart/utils.dart';
40 import 'package:test_dart/options.dart';
Bob Nystrom 2017/07/31 22:42:32 I'm a little worried about importing code directly
Jennifer Messerly 2017/08/01 18:23:20 Some mitigations: * I hope to be able to delete th
35 41
36 import '../tool/build_sdk.dart' as build_sdk; 42 import '../tool/build_sdk.dart' as build_sdk;
37 import 'compile_error_tests.dart';
38 import 'multitest.dart' show extractTestsFromMultitest, isMultiTest; 43 import 'multitest.dart' show extractTestsFromMultitest, isMultiTest;
39 import 'testing.dart' show repoDirectory, testDirectory; 44 import 'testing.dart' show repoDirectory, testDirectory;
40 45
41 final ArgParser argParser = new ArgParser() 46 final ArgParser argParser = new ArgParser()
42 ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null); 47 ..addOption('dart-sdk', help: 'Dart SDK Path', defaultsTo: null);
43 48
44 /// The `test/codegen` directory. 49 /// The `test/codegen` directory.
45 final codegenDir = path.join(testDirectory, 'codegen'); 50 final codegenDir = path.join(testDirectory, 'codegen');
46 51
47 /// The `test/codegen/expect` directory. 52 /// The `test/codegen/expect` directory.
(...skipping 27 matching lines...) Expand all
75 80
76 var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg')) 81 var summaryPaths = new Directory(path.join(codegenOutputDir, 'pkg'))
77 .listSync() 82 .listSync()
78 .map((e) => e.path) 83 .map((e) => e.path)
79 .where((p) => p.endsWith('.sum')) 84 .where((p) => p.endsWith('.sum'))
80 .toList(); 85 .toList();
81 86
82 var sharedCompiler = new ModuleCompiler(new AnalyzerOptions.basic( 87 var sharedCompiler = new ModuleCompiler(new AnalyzerOptions.basic(
83 dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths)); 88 dartSdkSummaryPath: sdkSummaryFile, summaryPaths: summaryPaths));
84 89
85 var testDirs = [ 90 var testDirs = ['language', 'corelib', 'lib'];
86 'language',
87 'corelib',
88 path.join('lib', 'async'),
89 path.join('lib', 'collection'),
90 path.join('lib', 'convert'),
91 path.join('lib', 'html'),
92 path.join('lib', 'math'),
93 path.join('lib', 'mirrors'),
94 path.join('lib', 'typed_data'),
95 ];
96 91
97 // Copy all of the test files and expanded multitest files to 92 // Copy all of the test files and expanded multitest files to
98 // gen/codegen_tests. We'll compile from there. 93 // gen/codegen_tests. We'll compile from there.
94 TestUtils.setDartDirUri(Platform.script.resolve('../../..'));
99 var testFiles = _setUpTests(testDirs); 95 var testFiles = _setUpTests(testDirs);
96 _writeRuntimeStatus(testFiles);
100 97
101 // Our default compiler options. Individual tests can override these. 98 // Our default compiler options. Individual tests can override these.
102 var defaultOptions = ['--no-source-map', '--no-summarize']; 99 var defaultOptions = ['--no-source-map', '--no-summarize'];
103 var compileArgParser = new ArgParser(); 100 var compileArgParser = new ArgParser();
104 defineAnalysisArguments(compileArgParser, ddc: true); 101 defineAnalysisArguments(compileArgParser, ddc: true);
105 AnalyzerOptions.addArguments(compileArgParser); 102 AnalyzerOptions.addArguments(compileArgParser);
106 CompilerOptions.addArguments(compileArgParser); 103 CompilerOptions.addArguments(compileArgParser);
107 addModuleFormatOptions(compileArgParser); 104 addModuleFormatOptions(compileArgParser);
108 105
109 var testFileOptionsMatcher = 106 var testFileOptionsMatcher =
110 new RegExp(r'// (compile options: |SharedOptions=)(.*)', multiLine: true); 107 new RegExp(r'// (compile options: |SharedOptions=)(.*)', multiLine: true);
111 108
112 // Ignore dart2js options that we don't support in DDC. 109 // Ignore dart2js options that we don't support in DDC.
113 var ignoreOptions = [ 110 var ignoreOptions = [
114 '--enable-enum', 111 '--enable-enum',
115 '--experimental-trust-js-interop-type-annotations', 112 '--experimental-trust-js-interop-type-annotations',
116 '--trust-type-annotations', 113 '--trust-type-annotations',
117 '--supermixin' 114 '--supermixin'
118 ]; 115 ];
119 116
120 // Compile each test file to JS and put the result in gen/codegen_output. 117 // Compile each test file to JS and put the result in gen/codegen_output.
121 for (var testFile in testFiles) { 118 testFiles.forEach((testFile, expectations) {
122 var relativePath = path.relative(testFile, from: codegenTestDir); 119 var relativePath = path.relative(testFile, from: codegenTestDir);
123 120
124 // Only compile the top-level files for generating coverage. 121 // Only compile the top-level files for generating coverage.
125 bool isTopLevelTest = path.dirname(relativePath) == "."; 122 bool isTopLevelTest = path.dirname(relativePath) == ".";
126 if (codeCoverage && !isTopLevelTest) continue; 123 if (codeCoverage && !isTopLevelTest) return;
127 124
128 var name = path.withoutExtension(relativePath); 125 var name = path.withoutExtension(relativePath);
129 test('dartdevc $name', () { 126 test('dartdevc $name', () {
130 // Check if we need to use special compile options. 127 // Check if we need to use special compile options.
131 var contents = new File(testFile).readAsStringSync(); 128 var contents = new File(testFile).readAsStringSync();
132 var match = testFileOptionsMatcher.firstMatch(contents); 129 var match = testFileOptionsMatcher.firstMatch(contents);
133 130
134 var args = defaultOptions.toList(); 131 var args = defaultOptions.toList();
135 if (match != null) { 132 if (match != null) {
136 var matchedArgs = match.group(2).split(' '); 133 var matchedArgs = match.group(2).split(' ');
(...skipping 25 matching lines...) Expand all
162 } catch (e, st) { 159 } catch (e, st) {
163 exception = e; 160 exception = e;
164 stackTrace = st; 161 stackTrace = st;
165 } 162 }
166 163
167 // This covers tests where the intent of the test is to validate that 164 // This covers tests where the intent of the test is to validate that
168 // some static error is produced. 165 // some static error is produced.
169 var intentionalCompileError = contents.contains(': compile-time error') || 166 var intentionalCompileError = contents.contains(': compile-time error') ||
170 contents.contains('/*@compile-error='); 167 contents.contains('/*@compile-error=');
171 168
172 // This covers tests that should not produce a static error but that 169 var crashing = expectations.contains(Expectation.crash);
173 // currently do due to issues in our implementation.
174 var knownCompileError = compileErrorTests.contains(name);
175
176 var crashing = _crashingTests.contains(name);
177 var inconsistent = _inconsistentTests.contains(name);
178
179 if (module == null) { 170 if (module == null) {
180 expect(crashing, isTrue, 171 expect(crashing, isTrue,
181 reason: "test $name crashes during compilation.\n" 172 reason: "test $name crashes during compilation.\n"
182 "$exception\n$stackTrace"); 173 "$exception\n$stackTrace");
183 return; 174 return;
184 } 175 }
185 176
186 // Write out JavaScript and/or compilation errors/warnings. 177 // Write out JavaScript and/or compilation errors/warnings.
187 _writeModule( 178 _writeModule(
188 path.join(codegenOutputDir, name), 179 path.join(codegenOutputDir, name),
189 isTopLevelTest ? path.join(codegenExpectDir, name) : null, 180 isTopLevelTest ? path.join(codegenExpectDir, name) : null,
190 moduleFormat, 181 moduleFormat,
191 module); 182 module);
192 183
193 expect(crashing, isFalse, reason: "test $name no longer crashes."); 184 expect(crashing, isFalse, reason: "test $name no longer crashes.");
194 185
195 if (inconsistent) { 186 var knownCompileError =
196 // An inconsistent test will only compile on some platforms (see 187 expectations.contains(Expectation.compileTimeError);
197 // comment below). It should not crash however. 188 if (module.isValid) {
198 } else if (module.isValid) {
199 // TODO(vsm): We don't seem to trip on non-strong errors?
200 // expect(expectedCompileTimeError, isFalse,
201 // reason: "test $name expected compilation errors, but compiled.");
202 expect(knownCompileError, isFalse, 189 expect(knownCompileError, isFalse,
203 reason: "test $name expected static errors, but compiled."); 190 reason: "test $name expected static errors, but compiled.");
204 } else { 191 } else {
205 var reason = intentionalCompileError ? "intended" : "unexpected"; 192 var reason = intentionalCompileError ? "intended" : "unexpected";
206 expect(intentionalCompileError || knownCompileError, isTrue, 193 expect(intentionalCompileError || knownCompileError, isTrue,
207 reason: "test $name failed to compile due to $reason errors:" 194 reason: "test $name failed to compile due to $reason errors:"
208 "\n\n${module.errors.join('\n')}."); 195 "\n\n${module.errors.join('\n')}.");
209 } 196 }
210 }); 197 });
211 } 198 });
212 199
213 if (filePattern.hasMatch('sunflower')) { 200 if (filePattern.hasMatch('sunflower')) {
214 test('sunflower', () { 201 test('sunflower', () {
215 _buildSunflower(sharedCompiler, codegenOutputDir, codegenExpectDir); 202 _buildSunflower(sharedCompiler, codegenOutputDir, codegenExpectDir);
216 }); 203 });
217 } 204 }
218 205
219 if (codeCoverage) { 206 if (codeCoverage) {
220 test('build_sdk code coverage', () { 207 test('build_sdk code coverage', () {
221 return build_sdk.main(['--dart-sdk', sdkDir, '-o', codegenOutputDir]); 208 return build_sdk.main(['--dart-sdk', sdkDir, '-o', codegenOutputDir]);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 256 }
270 257
271 String _moduleForLibrary(Source source) { 258 String _moduleForLibrary(Source source) {
272 var scheme = source.uri.scheme; 259 var scheme = source.uri.scheme;
273 if (scheme == 'package') { 260 if (scheme == 'package') {
274 return source.uri.pathSegments.first; 261 return source.uri.pathSegments.first;
275 } 262 }
276 throw new Exception('Module not found for library "${source.fullName}"'); 263 throw new Exception('Module not found for library "${source.fullName}"');
277 } 264 }
278 265
279 List<String> _setUpTests(List<String> testDirs) { 266 void _writeRuntimeStatus(Map<String, Set<Expectation>> testFiles) {
280 var testFiles = <String>[]; 267 var runtimeStatus = <String, String>{};
268 testFiles.forEach((name, status) {
269 name = path.withoutExtension(path.relative(name, from: codegenTestDir));
270 // Skip tests that we don't expect to compile.
271 if (status.contains(Expectation.compileTimeError) ||
272 status.contains(Expectation.crash)) {
273 return;
274 }
275 // Normalize the expectations for the Karma language_test.js runner.
276 if (status.remove(Expectation.ok)) assert(status.isNotEmpty);
277 if (status.remove(Expectation.missingCompileTimeError) ||
278 status.remove(Expectation.missingRuntimeError)) {
279 status.add(Expectation.pass);
280 }
281 281
282 // Skip passing tests.
Bob Nystrom 2017/07/31 22:42:32 "Skip" is confusing in this context. How about "Pa
Jennifer Messerly 2017/08/01 18:23:20 Done.
283 // TODO(jmesserly): we could record these for extra sanity checks.
284 if (status.length == 1 && status.contains(Expectation.pass)) {
285 return;
286 }
287
288 runtimeStatus[name] = status.map((s) => '$s').join(',');
289 });
290 new File(path.join(codegenOutputDir, 'test_status.js')).writeAsStringSync('''
291 define([], function() {
292 'use strict';
293 return ${new JsonEncoder.withIndent(' ').convert(runtimeStatus)};
294 });
295 ''');
296 }
297
298 Map<String, Set<Expectation>> _setUpTests(List<String> testDirs) {
299 var testFiles = <String, Set<Expectation>>{};
282 for (var testDir in testDirs) { 300 for (var testDir in testDirs) {
283 // TODO(rnystrom): Simplify this when the Dart 2.0 test migration is 301 // TODO(rnystrom): Simplify this when the Dart 2.0 test migration is
284 // complete (#30183). 302 // complete (#30183).
285 // Look for the tests in the "_strong" and "_2" directories in the SDK's 303 // Look for the tests in the "_strong" and "_2" directories in the SDK's
286 // main "tests" directory. 304 // main "tests" directory.
287 var dirParts = path.split(testDir); 305 var dirParts = path.split(testDir);
288 306
289 for (var suffix in const ["_2", "_strong"]) { 307 for (var suffix in const ["_2", "_strong"]) {
290 var sdkTestDir = 308 var sdkTestDir = path.join(
291 path.join(dirParts[0] + suffix, path.joinAll(dirParts.skip(1))); 309 'tests', dirParts[0] + suffix, path.joinAll(dirParts.skip(1)));
292 var inputPath = 310 var inputPath = path.join(testDirectory, '..', '..', '..', sdkTestDir);
293 path.join(testDirectory, '..', '..', '..', 'tests', sdkTestDir);
294 311
295 if (!new Directory(inputPath).existsSync()) continue; 312 if (!new Directory(inputPath).existsSync()) continue;
296 313
314 var browsers = Platform.environment['DDC_BROWSERS'];
315 var runtime = browsers == 'Firefox' ? 'firefox' : 'chrome';
316 var config = new OptionsParser()
317 .parse('-m release -c dartdevc --use-sdk --strong'.split(' ')
318 ..addAll(['-r', runtime, '--suite_dir', sdkTestDir]))
319 .single;
320
321 var testSuite = new StandardTestSuite.forDirectory(
322 config, new test_dart.Path(sdkTestDir));
323 var expectations = testSuite.readExpectations();
324
297 for (var file in _listFiles(inputPath, recursive: true)) { 325 for (var file in _listFiles(inputPath, recursive: true)) {
298 var relativePath = path.relative(file, from: inputPath); 326 var relativePath = path.relative(file, from: inputPath);
299 var outputPath = path.join(codegenTestDir, testDir, relativePath); 327 var outputPath = path.join(codegenTestDir, testDir, relativePath);
300 328
301 _ensureDirectory(path.dirname(outputPath)); 329 _ensureDirectory(path.dirname(outputPath));
302 330
303 if (file.endsWith("_test.dart")) { 331 if (file.endsWith("_test.dart")) {
332 var statusPath = path.withoutExtension(relativePath);
304 333
305 void _writeTest(String outputPath, String contents) { 334 void _writeTest(String outputPath, String contents) {
306 if (contents.contains('package:unittest/')) { 335 if (contents.contains('package:unittest/')) {
307 // TODO(jmesserly): we could use directive parsing, but that 336 // TODO(jmesserly): we could use directive parsing, but that
308 // feels like overkill. 337 // feels like overkill.
309 // Alternatively, we could detect "unittest" use at runtime. 338 // Alternatively, we could detect "unittest" use at runtime.
310 // We really need a better solution for Karma+mocha+unittest 339 // We really need a better solution for Karma+mocha+unittest
311 // integration. 340 // integration.
312 contents += '\nfinal _usesUnittestPackage = true;\n'; 341 contents += '\nfinal _usesUnittestPackage = true;\n';
313 } 342 }
314 new File(outputPath).writeAsStringSync(contents); 343 new File(outputPath).writeAsStringSync(contents);
315 } 344 }
316 345
317 var contents = new File(file).readAsStringSync(); 346 var contents = new File(file).readAsStringSync();
318 if (isMultiTest(contents)) { 347 if (isMultiTest(contents)) {
319 // It's a multitest, so expand it and add all of the variants. 348 // It's a multitest, so expand it and add all of the variants.
320 var tests = <String, String>{}; 349 var tests = <String, String>{};
321 var outcomes = <String, Set<String>>{}; 350 extractTestsFromMultitest(file, contents, tests, {});
Bob Nystrom 2017/07/31 22:42:32 Remove the outcomes parameter since it's no longer
Jennifer Messerly 2017/08/01 18:23:20 Done.
322 extractTestsFromMultitest(file, contents, tests, outcomes);
323 351
324 var fileName = path.basenameWithoutExtension(file); 352 var fileName = path.basenameWithoutExtension(file);
325 var outputDir = path.dirname(outputPath); 353 var outputDir = path.dirname(outputPath);
326 tests.forEach((name, contents) { 354 tests.forEach((name, contents) {
327 var multiFile = 355 var multiFile =
328 path.join(outputDir, '${fileName}_${name}_multi.dart'); 356 path.join(outputDir, '${fileName}_${name}_multi.dart');
329 testFiles.add(multiFile); 357 testFiles[multiFile] =
358 expectations.expectations("$statusPath/$name");
330 359
331 _writeTest(multiFile, contents); 360 _writeTest(multiFile, contents);
332 }); 361 });
333 } else { 362 } else {
334 // It's a single test suite. 363 // It's a single test suite.
335 testFiles.add(outputPath); 364 testFiles[outputPath] = expectations.expectations(statusPath);
336 } 365 }
337 366
338 // Write the test file. 367 // Write the test file.
339 // 368 //
340 // We do this even for multitests because import_self_test 369 // We do this even for multitests because import_self_test
341 // is a multitest, yet imports its own unexpanded form (!). 370 // is a multitest, yet imports its own unexpanded form (!).
342 _writeTest(outputPath, contents); 371 _writeTest(outputPath, contents);
343 372
344 } else { 373 } else {
345 // Copy the non-test file over, in case it is used as an import. 374 // Copy the non-test file over, in case it is used as an import.
346 new File(file).copySync(outputPath); 375 new File(file).copySync(outputPath);
347 } 376 }
348 } 377 }
349 } 378 }
350 } 379 }
351 380
352 // Also include the other special files that live at the top level directory. 381 // Also include the other special files that live at the top level directory.
353 for (var file in _listFiles(codegenDir)) { 382 for (var file in _listFiles(codegenDir)) {
354 var relativePath = path.relative(file, from: codegenDir); 383 var relativePath = path.relative(file, from: codegenDir);
355 var outputPath = path.join(codegenTestDir, relativePath); 384 var outputPath = path.join(codegenTestDir, relativePath);
356 385
357 new File(file).copySync(outputPath); 386 new File(file).copySync(outputPath);
358 if (file.endsWith(".dart")) { 387 if (file.endsWith(".dart")) {
359 testFiles.add(outputPath); 388 testFiles[outputPath] = new Set()..add(Expectation.pass);
360 } 389 }
361 } 390 }
362 391
363 return testFiles; 392 return testFiles;
364 } 393 }
365 394
366 /// Recursively creates [dir] if it doesn't exist. 395 /// Recursively creates [dir] if it doesn't exist.
367 void _ensureDirectory(String dir) { 396 void _ensureDirectory(String dir) {
368 new Directory(dir).createSync(recursive: true); 397 new Directory(dir).createSync(recursive: true);
369 } 398 }
370 399
371 /// Lists all of the files within [dir] that match [filePattern]. 400 /// Lists all of the files within [dir] that match [filePattern].
372 Iterable<String> _listFiles(String dir, {bool recursive: false}) { 401 Iterable<String> _listFiles(String dir, {bool recursive: false}) {
373 return new Directory(dir) 402 return new Directory(dir)
374 .listSync(recursive: recursive, followLinks: false) 403 .listSync(recursive: recursive, followLinks: false)
375 .where((entry) { 404 .where((e) => e is File && filePattern.hasMatch(e.path))
376 if (entry is! File) return false; 405 .map((f) => f.path);
377
378 var filePath = entry.path;
379 if (!filePattern.hasMatch(filePath)) return false;
380
381 return true;
382 }).map((file) => file.path);
383 } 406 }
384 407
385 /// Parse directives from [contents] and find the complete set of transitive 408 /// Parse directives from [contents] and find the complete set of transitive
386 /// imports, reading files as needed. 409 /// imports, reading files as needed.
387 /// 410 ///
388 /// This will not include dart:* libraries, as those are implicitly available. 411 /// This will not include dart:* libraries, as those are implicitly available.
389 void _collectTransitiveImports(String contents, Set<String> libraries, 412 void _collectTransitiveImports(String contents, Set<String> libraries,
390 {String packageRoot, String from}) { 413 {String packageRoot, String from}) {
391 var uri = from; 414 var uri = from;
392 if (packageRoot != null && path.isWithin(packageRoot, from)) { 415 if (packageRoot != null && path.isWithin(packageRoot, from)) {
(...skipping 25 matching lines...) Expand all
418 StringLiteral uriLiteral = directive.uri; 441 StringLiteral uriLiteral = directive.uri;
419 String uriContent = uriLiteral.stringValue; 442 String uriContent = uriLiteral.stringValue;
420 if (uriContent != null) { 443 if (uriContent != null) {
421 uriContent = uriContent.trim(); 444 uriContent = uriContent.trim();
422 directive.uriContent = uriContent; 445 directive.uriContent = uriContent;
423 } 446 }
424 return (directive as UriBasedDirectiveImpl).validate() == null 447 return (directive as UriBasedDirectiveImpl).validate() == null
425 ? uriContent 448 ? uriContent
426 : null; 449 : null;
427 } 450 }
428
429 /// Tests that, due to bugs, are strong-mode clean only on some platforms.
430 final _inconsistentTests = new Set<String>.from([
431 // This test is clean on windows, but not linux/mac due to newline encoding.
432 // See: https://github.com/dart-lang/sdk/issues/27224
433 'language/multiline_newline_test_02_multi',
434 ].map((p) => p.replaceAll('/', path.separator)));
435
436 final _crashingTests = new Set<String>.from([
437 // TODO(vsm): Fix these - they import files from a different directory
438 // - this triggers an invalid library root build error.
439 'lib/html/custom/attribute_changed_callback_test',
440 'lib/html/custom/constructor_calls_created_synchronously_test',
441 'lib/html/custom/entered_left_view_test',
442 'lib/html/custom/js_custom_test',
443 'lib/html/custom/mirrors_test',
444 'lib/html/custom/regress_194523002_test',
445 ].map((p) => p.replaceAll('/', path.separator)));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698