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

Unified Diff: test/driver_test.dart

Issue 1382023002: Support for --fatal-hints. (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Created 5 years, 3 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 | « test/data/file_with_warning.dart ('k') | test/options_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/driver_test.dart
diff --git a/test/driver_test.dart b/test/driver_test.dart
index 0e9795e9f89c2b59b9d19092f941cca11fb57f86..08a2462ef4d6f793d7efd140d147739a1ab9a424 100644
--- a/test/driver_test.dart
+++ b/test/driver_test.dart
@@ -34,6 +34,46 @@ main() {
});
});
+ group('exit codes', () {
+ int savedExitCode;
+ setUp(() {
+ savedExitCode = exitCode;
+ });
+ tearDown(() {
+ exitCode = savedExitCode;
+ });
+
+ test('fatal hints', () {
+ Driver driver = new Driver();
+ driver.start(['--fatal-hints', 'test/data/file_with_hint.dart']);
+ expect(exitCode, 3);
+ });
+
+ test('not fatal hints', () {
+ Driver driver = new Driver();
+ driver.start(['test/data/file_with_hint.dart']);
+ expect(exitCode, 0);
+ });
+
+ test('fatal errors', () {
+ Driver driver = new Driver();
+ driver.start(['test/data/file_with_error.dart']);
+ expect(exitCode, 3);
+ });
+
+ test('not fatal warnings', () {
+ Driver driver = new Driver();
+ driver.start(['test/data/file_with_warning.dart']);
+ expect(exitCode, 0);
+ });
+
+ test('fatal warnings', () {
+ Driver driver = new Driver();
+ driver.start(['--fatal-warnings', 'test/data/file_with_warning.dart']);
+ expect(exitCode, 3);
+ });
+ });
+
group('linter', () {
StringSink savedOutSink;
Driver driver;
« no previous file with comments | « test/data/file_with_warning.dart ('k') | test/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698