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

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

Issue 1984733003: Don't use SDK summaries with embedders (#26448). (Closed) Base URL: git@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
« no previous file with comments | « pkg/analyzer_cli/test/all.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/generated/sdk_io.dart';
7 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink; 8 import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
8 import 'package:path/path.dart' as path; 9 import 'package:path/path.dart' as path;
9 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
10 11
11 import 'utils.dart'; 12 import 'utils.dart';
12 13
13 main() { 14 main() {
14 initializeTestEnvironment(); 15 initializeTestEnvironment();
15 16
16 group('_embedder.yaml', () { 17 group('_embedder.yaml', () {
(...skipping 17 matching lines...) Expand all
34 var testDir = path.join(testDirectory, 'data', 'embedder_client'); 35 var testDir = path.join(testDirectory, 'data', 'embedder_client');
35 new Driver().start([ 36 new Driver().start([
36 '--packages', 37 '--packages',
37 path.join(testDir, '_packages'), 38 path.join(testDir, '_packages'),
38 path.join(testDir, 'embedder_yaml_user.dart') 39 path.join(testDir, 'embedder_yaml_user.dart')
39 ]); 40 ]);
40 41
41 expect(exitCode, 0); 42 expect(exitCode, 0);
42 expect(outSink.toString(), contains('No issues found')); 43 expect(outSink.toString(), contains('No issues found'));
43 })); 44 }));
45
46 test('sdk setup', wrap(() {
47 var testDir = path.join(testDirectory, 'data', 'embedder_client');
48 Driver driver = new Driver();
49 driver.start([
50 '--packages',
51 path.join(testDir, '_packages'),
52 path.join(testDir, 'embedder_yaml_user.dart')
53 ]);
54
55 DirectoryBasedDartSdk sdk = driver.sdk;
56 expect(sdk.useSummary, false);
57 }));
44 }); 58 });
45 } 59 }
46 60
47 /// Wrap a function call to dump stdout and stderr in case of an exception. 61 /// Wrap a function call to dump stdout and stderr in case of an exception.
48 Function wrap(Function f) { 62 Function wrap(Function f) {
49 return () { 63 return () {
50 try { 64 try {
51 f(); 65 f();
52 } catch (e) { 66 } catch (e) {
53 if (outSink.toString().isNotEmpty) { 67 if (outSink.toString().isNotEmpty) {
54 print('stdout:'); 68 print('stdout:');
55 print(outSink); 69 print(outSink);
56 } 70 }
57 if (errorSink.toString().isNotEmpty) { 71 if (errorSink.toString().isNotEmpty) {
58 print('stderr:'); 72 print('stderr:');
59 print(errorSink); 73 print(errorSink);
60 } 74 }
61 throw e; 75 throw e;
62 } 76 }
63 }; 77 };
64 } 78 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/test/all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698