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

Unified Diff: test/runner/runner_test.dart

Issue 1086213002: Support a @Timeout annotation. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: CHANGELOG + README Created 5 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 | « test/runner/parse_metadata_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/runner_test.dart
diff --git a/test/runner/runner_test.dart b/test/runner/runner_test.dart
index 6b38a4d3be3e65d395d3d7fa4ad139d77e7e155d..2eab950e83eea554fa7c2051535710d7501c5220 100644
--- a/test/runner/runner_test.dart
+++ b/test/runner/runner_test.dart
@@ -328,6 +328,24 @@ $_usage"""));
expect(result.exitCode, equals(1));
});
+ test("respects top-level @Timeout declarations", () {
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync('''
+@Timeout(const Duration(seconds: 0))
+
+import 'dart:async';
+
+import 'package:test/test.dart';
+
+void main() {
+ test("timeout", () {});
+}
+''');
+
+ var result = _runUnittest(["test.dart"]);
+ expect(result.stdout, contains("Test timed out after 0 seconds."));
+ expect(result.stdout, contains("-1: Some tests failed."));
+ });
+
group("flags:", () {
test("with the --color flag, uses colors", () {
new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure);
« no previous file with comments | « test/runner/parse_metadata_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698