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

Unified Diff: pkg/dev_compiler/test/codegen_test.dart

Issue 2833633002: Various DDC fixes for windows (Closed)
Patch Set: Fix formatting Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/test/codegen_test.dart
diff --git a/pkg/dev_compiler/test/codegen_test.dart b/pkg/dev_compiler/test/codegen_test.dart
index f4f1ac6439e50fb06f17d88059dd205c358e8cb4..65dd37189cac9e26bcb8218d17ab086da41ed169 100644
--- a/pkg/dev_compiler/test/codegen_test.dart
+++ b/pkg/dev_compiler/test/codegen_test.dart
@@ -165,15 +165,19 @@ main(List<String> arguments) {
stackTrace = st;
}
- bool expectedCompileTimeError =
- contents.contains(': compile-time error\n');
+ bool expectedCompileTimeError = contents.contains(': compile-time error');
bool notStrong = notYetStrongTests.contains(name);
bool crashing = _crashingTests.contains(name);
+ bool inconsistent = _inconsistentTests.contains(name);
if (module == null) {
expect(crashing, isTrue,
reason: "test $name crashes during compilation.\n"
"$exception\n$stackTrace");
+ } else if (inconsistent) {
+ // An inconsistent test will only compile on some platforms (see
+ // comment below). It should not crash however.
+ expect(crashing, isFalse, reason: "test $name no longer crashes.");
} else if (module.isValid) {
_writeModule(
path.join(codegenOutputDir, name),
@@ -189,9 +193,10 @@ main(List<String> arguments) {
reason: "test $name expected strong mode errors, but compiled.");
} else {
expect(crashing, isFalse, reason: "test $name no longer crashes.");
- var reason =
- expectedCompileTimeError ? "expected" : "untriaged strong mode";
- expect(expectedCompileTimeError || notStrong, isTrue,
+ var reason = expectedCompileTimeError
+ ? "expected"
+ : inconsistent ? "platform consistency" : "untriaged strong mode";
+ expect(expectedCompileTimeError || inconsistent || notStrong, isTrue,
reason: "test $name failed to compile due to $reason errors:"
"\n\n${module.errors.join('\n')}.");
}
@@ -271,7 +276,8 @@ List<String> _setUpTests(List<String> testDirs) {
var dirParts = path.split(testDir);
var sdkTestDir =
path.join(dirParts[0] + "_strong", path.joinAll(dirParts.skip(1)));
- var inputPath = path.join(testDirectory, '../../../tests/', sdkTestDir);
+ var inputPath =
+ path.join(testDirectory, '..', '..', '..', 'tests', sdkTestDir);
for (var file in _listFiles(inputPath, recursive: true)) {
var relativePath = path.relative(file, from: inputPath);
@@ -386,6 +392,13 @@ String _resolveDirective(UriBasedDirective directive) {
: null;
}
+/// Tests that, due to bugs, are strong-mode clean only on some platforms.
+final _inconsistentTests = new Set<String>.from([
+ // This test is clean on windows, but not linux/mac due to newline encoding.
+ // See: https://github.com/dart-lang/sdk/issues/27224
+ 'language/multiline_newline_test_02_multi',
+].map((p) => p.replaceAll('/', path.separator)));
+
final _crashingTests = new Set<String>.from([
'language/generic_methods_generic_class_tearoff_test',
'language/generic_methods_named_parameters_test',
@@ -401,4 +414,4 @@ final _crashingTests = new Set<String>.from([
'lib/html/custom/js_custom_test',
'lib/html/custom/mirrors_test',
'lib/html/custom/regress_194523002_test',
-]);
+].map((p) => p.replaceAll('/', path.separator)));
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/source_map_printer.dart ('k') | pkg/dev_compiler/test/not_yet_strong_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698