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

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

Issue 1830463002: Change analyzer_cli's "package mode" into a "build mode". (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer_cli.test.driver; 5 library analyzer_cli.test.driver;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/plugin/options.dart'; 9 import 'package:analyzer/plugin/options.dart';
10 import 'package:analyzer/source/analysis_options_provider.dart'; 10 import 'package:analyzer/source/analysis_options_provider.dart';
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 expect( 277 expect(
278 processorFor(undefined_function).severity, ErrorSeverity.WARNING); 278 processorFor(undefined_function).severity, ErrorSeverity.WARNING);
279 // Should not be made fatal by `--fatal-warnings`. 279 // Should not be made fatal by `--fatal-warnings`.
280 expect(outSink.toString(), 280 expect(outSink.toString(),
281 contains("[warning] The function 'baz' is not defined")); 281 contains("[warning] The function 'baz' is not defined"));
282 expect(outSink.toString(), contains("1 error and 1 warning found.")); 282 expect(outSink.toString(), contains("1 error and 1 warning found."));
283 }); 283 });
284 }); 284 });
285 }); 285 });
286 286
287 group('package-mode', () { 287 group('build-mode', () {
288 // Shared driver command. 288 // Shared driver command.
289 var doDrive = () => drive('data/options_tests_project/test_file.dart', 289 var testFilePath = path.join(
290 path.dirname(Platform.script.toFilePath()), 'data', 'test_file.dart');
291 var doDrive = () => drive('file:///test_file.dart|$testFilePath',
290 args: [ 292 args: [
291 '--dart-sdk', 293 '--dart-sdk',
292 findSdkDirForSummaries(), 294 findSdkDirForSummaries(),
293 '--package-mode', 295 '--build-mode',
294 '--machine' 296 '--machine'
295 ], 297 ],
296 options: 'data/options_tests_project/.analysis_options'); 298 options: 'data/options_tests_project/.analysis_options');
297 299
298 test('no stats', () { 300 test('no stats', () {
299 doDrive(); 301 doDrive();
300 // Should not print stat summary. 302 // Should not print stat summary.
301 expect(outSink.toString(), isEmpty); 303 expect(outSink.toString(), isEmpty);
304 expect(errorSink.toString(), isEmpty);
305 expect(exitCode, 0);
302 }); 306 });
303 }); 307 });
304 308
305 //TODO(pq): fix to be bot-friendly (sdk#25258). 309 //TODO(pq): fix to be bot-friendly (sdk#25258).
306 // group('in temp directory', () { 310 // group('in temp directory', () {
307 // Directory savedCurrentDirectory; 311 // Directory savedCurrentDirectory;
308 // Directory tempDir; 312 // Directory tempDir;
309 // setUp(() { 313 // setUp(() {
310 // // Call base setUp. 314 // // Call base setUp.
311 // _setUp(); 315 // _setUp();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 this.options = options; 475 this.options = options;
472 } 476 }
473 } 477 }
474 478
475 class TestSource implements Source { 479 class TestSource implements Source {
476 TestSource(); 480 TestSource();
477 481
478 @override 482 @override
479 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 483 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
480 } 484 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698