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

Side by Side Diff: pkg/analyzer_cli/test/embedder_test.dart

Issue 2963323002: Add analytics to analyzer-cli and analysis server. (Closed)
Patch Set: Created 3 years, 5 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 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:analyzer/src/dart/sdk/sdk.dart'; 7 import 'package:analyzer/src/dart/sdk/sdk.dart';
8 import 'package:analyzer/src/generated/sdk.dart'; 8 import 'package:analyzer/src/generated/sdk.dart';
9 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink; 9 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 15 matching lines...) Expand all
26 }); 26 });
27 27
28 tearDown(() { 28 tearDown(() {
29 outSink = savedOutSink; 29 outSink = savedOutSink;
30 errorSink = savedErrorSink; 30 errorSink = savedErrorSink;
31 exitCode = savedExitCode; 31 exitCode = savedExitCode;
32 }); 32 });
33 33
34 test('resolution', wrap(() async { 34 test('resolution', wrap(() async {
35 var testDir = path.join(testDirectory, 'data', 'embedder_client'); 35 var testDir = path.join(testDirectory, 'data', 'embedder_client');
36 await new Driver().start([ 36 await new Driver(isTesting: true).start([
37 '--packages', 37 '--packages',
38 path.join(testDir, '_packages'), 38 path.join(testDir, '_packages'),
39 path.join(testDir, 'embedder_yaml_user.dart') 39 path.join(testDir, 'embedder_yaml_user.dart')
40 ]); 40 ]);
41 41
42 expect(exitCode, 0); 42 expect(exitCode, 0);
43 expect(outSink.toString(), contains('No issues found')); 43 expect(outSink.toString(), contains('No issues found'));
44 })); 44 }));
45 45
46 test('sdk setup', wrap(() async { 46 test('sdk setup', wrap(() async {
47 var testDir = path.join(testDirectory, 'data', 'embedder_client'); 47 var testDir = path.join(testDirectory, 'data', 'embedder_client');
48 Driver driver = new Driver(); 48 Driver driver = new Driver(isTesting: true);
49 await driver.start([ 49 await driver.start([
50 '--packages', 50 '--packages',
51 path.join(testDir, '_packages'), 51 path.join(testDir, '_packages'),
52 path.join(testDir, 'embedder_yaml_user.dart') 52 path.join(testDir, 'embedder_yaml_user.dart')
53 ]); 53 ]);
54 54
55 DartSdk sdk = driver.sdk; 55 DartSdk sdk = driver.sdk;
56 expect(sdk, new isInstanceOf<FolderBasedDartSdk>()); 56 expect(sdk, new isInstanceOf<FolderBasedDartSdk>());
57 expect((sdk as FolderBasedDartSdk).useSummary, isFalse); 57 expect((sdk as FolderBasedDartSdk).useSummary, isFalse);
58 })); 58 }));
(...skipping 11 matching lines...) Expand all
70 print(outSink); 70 print(outSink);
71 } 71 }
72 if (errorSink.toString().isNotEmpty) { 72 if (errorSink.toString().isNotEmpty) {
73 print('stderr:'); 73 print('stderr:');
74 print(errorSink); 74 print(errorSink);
75 } 75 }
76 rethrow; 76 rethrow;
77 } 77 }
78 }; 78 };
79 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698