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

Unified Diff: pkg/front_end/test/fasta/compile_platform_test.dart

Issue 3009503002: Start trying to compile platform from unpatched sources. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/dart_server.json » ('j') | sdk/lib/libraries.yaml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/fasta/compile_platform_test.dart
diff --git a/pkg/front_end/test/fasta/compile_platform_test.dart b/pkg/front_end/test/fasta/compile_platform_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..842fe7cec1c268defc54fcc061eaf26f7d605b3f
--- /dev/null
+++ b/pkg/front_end/test/fasta/compile_platform_test.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+library fasta.test.compile_platform_test;
+
+import 'dart:io';
+
+import 'package:async_helper/async_helper.dart';
+
+import 'package:expect/expect.dart';
+
+import '../../tool/_fasta/compile_platform.dart' show compilePlatform;
+
+main(List<String> arguments) async {
+ await asyncTest(() async {
+ await withTemporyDirectory("compile_platform_test_", (Uri tmp) async {
+ String patchedSdk = Uri.base
+ .resolveUri(new Uri.file(Platform.resolvedExecutable))
+ .resolve("patched_sdk")
+ .toFilePath();
+ // This first invocation should succeed.
+ await compilePlatform(<String>[
Siggi Cherem (dart-lang) 2017/08/24 19:27:02 Alternatively, should we use the public APIs here
ahe 2017/08/25 08:45:51 I think it's a great idea to rewrite tool/_fasta/c
Siggi Cherem (dart-lang) 2017/08/25 14:41:48 OK - I misunderstood, I thought the goal was to ha
+ "-v",
+ patchedSdk,
+ tmp.resolve("platform.dill").toFilePath(),
+ tmp.resolve("platform-outline.dill").toFilePath(),
+ ]);
+ print("Successfully compiled $patchedSdk.\n\n");
+
+ try {
+ // This invocation is expected to throw an exception for now. Patching
+ // isn't fully implemented yet.
+ await compilePlatform(<String>[
+ "-v",
+ "sdk/",
Siggi Cherem (dart-lang) 2017/08/24 19:27:02 it might be worth checking first that this folder
ahe 2017/08/25 08:45:51 That will lead to a different error and this test
+ tmp.resolve("platform.dill").toFilePath(),
+ tmp.resolve("platform-outline.dill").toFilePath(),
+ ]);
+ } on String catch (e) {
+ Expect.isTrue(
+ e.startsWith("A member with disambiguated name '_withType' "));
+ print("Failed as expected: $e");
+ return;
+ }
+ Expect.fail("Test didn't throw expected exception.");
+ });
+ });
+}
+
+withTemporyDirectory(String prefix, Future f(Uri tmp)) async {
+ Directory tmp = await Directory.systemTemp.createTemp(prefix);
+ try {
+ await f(tmp.uri);
+ } finally {
+ await tmp.delete(recursive: true);
Siggi Cherem (dart-lang) 2017/08/24 19:27:02 if we switch to use the public API, we should also
ahe 2017/08/25 08:45:51 Yes, but that wouldn't test the tool. Perhaps we s
Siggi Cherem (dart-lang) 2017/08/25 14:41:48 yes :)
+ }
+}
« no previous file with comments | « no previous file | sdk/lib/dart_server.json » ('j') | sdk/lib/libraries.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698