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

Unified Diff: pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart

Issue 2857203002: Make the exit code for dartanalyzer more deterministic. (Closed)
Patch Set: Created 3 years, 8 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 | « pkg/analyzer_cli/test/driver_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart
diff --git a/pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart b/pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2a035a37939867a9446f469f4f61740e3162484b
--- /dev/null
+++ b/pkg/analyzer_cli/test/errors_upgrade_fails_cli_test.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+import 'package:analyzer_cli/src/driver.dart';
+import 'package:analyzer_cli/src/options.dart';
+import 'package:path/path.dart' as path;
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'utils.dart';
+
+main() {
+ defineReflectiveTests(ErrorUpgradeFailsCli);
+}
+
+@reflectiveTest
+class ErrorUpgradeFailsCli {
+ StringSink savedOutSink, savedErrorSink;
+ int savedExitCode;
+ ExitHandler savedExitHandler;
+
+ void setUp() {
+ savedOutSink = outSink;
+ savedErrorSink = errorSink;
+ savedExitHandler = exitHandler;
+ savedExitCode = exitCode;
+ exitHandler = (code) => exitCode = code;
+ outSink = new StringBuffer();
+ errorSink = new StringBuffer();
+ }
+
+ void tearDown() {
+ outSink = savedOutSink;
+ errorSink = savedErrorSink;
+ exitCode = savedExitCode;
+ exitHandler = savedExitHandler;
+ }
+
+ test_once() async {
+ String testDir =
+ path.join(testDirectory, 'data', 'error_upgrade_fails_cli');
+ Driver driver = new Driver();
+ await driver.start([path.join(testDir, 'foo.dart')]);
+
+ expect(exitCode, 3);
+ }
+}
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698