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

Side by Side Diff: tests/compiler/dart2js/serialization/compilation_test.dart

Issue 1975153002: Support (de)serialization from command-line (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 library dart2js.serialization_compilation_test; 5 library dart2js.serialization_compilation_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
11 import 'package:compiler/src/common/backend_api.dart'; 11 import 'package:compiler/src/common/backend_api.dart';
12 import 'package:compiler/src/common/names.dart'; 12 import 'package:compiler/src/common/names.dart';
13 import 'package:compiler/src/compiler.dart'; 13 import 'package:compiler/src/compiler.dart';
14 import 'package:compiler/src/filenames.dart'; 14 import 'package:compiler/src/filenames.dart';
15 import 'package:compiler/src/serialization/system.dart';
15 import '../memory_compiler.dart'; 16 import '../memory_compiler.dart';
16 import 'helper.dart'; 17 import 'helper.dart';
17 import 'test_data.dart'; 18 import 'test_data.dart';
18 import '../output_collector.dart'; 19 import '../output_collector.dart';
19 20
20 main(List<String> args) { 21 main(List<String> args) {
21 asyncTest(() async { 22 asyncTest(() async {
22 Arguments arguments = new Arguments.from(args); 23 Arguments arguments = new Arguments.from(args);
23 String serializedData = await serializeDartCore(arguments: arguments); 24 String serializedData = await serializeDartCore(arguments: arguments);
24 if (arguments.filename != null) { 25 if (arguments.filename != null) {
(...skipping 20 matching lines...) Expand all
45 print('------------------------------------------------------------------'); 46 print('------------------------------------------------------------------');
46 print('compile ${index != null ? '$index:' :''}${testDescription}'); 47 print('compile ${index != null ? '$index:' :''}${testDescription}');
47 print('------------------------------------------------------------------'); 48 print('------------------------------------------------------------------');
48 OutputCollector outputCollector = new OutputCollector(); 49 OutputCollector outputCollector = new OutputCollector();
49 await runCompiler( 50 await runCompiler(
50 entryPoint: entryPoint, 51 entryPoint: entryPoint,
51 memorySourceFiles: test != null ? test.sourceFiles : const {}, 52 memorySourceFiles: test != null ? test.sourceFiles : const {},
52 options: [], 53 options: [],
53 outputProvider: outputCollector, 54 outputProvider: outputCollector,
54 beforeRun: (Compiler compiler) { 55 beforeRun: (Compiler compiler) {
55 deserialize(compiler, serializedData); 56 compiler.serialization.deserializeFromText(serializedData);
56 }); 57 });
57 if (verbose) { 58 if (verbose) {
58 print(outputCollector.getOutput('', 'js')); 59 print(outputCollector.getOutput('', 'js'));
59 } 60 }
60 } 61 }
61 62
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698