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

Unified Diff: test/backend/declarer_test.dart

Issue 1090513002: Support configuring timeouts per-test and -group. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes 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 | « lib/test.dart ('k') | test/backend/invoker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/backend/declarer_test.dart
diff --git a/test/backend/declarer_test.dart b/test/backend/declarer_test.dart
index f8640aaa36cea02cd4018ac499e82b78c1e93940..f8ed99cbe619d4066b95ae48bf7faca6889806f7 100644
--- a/test/backend/declarer_test.dart
+++ b/test/backend/declarer_test.dart
@@ -6,6 +6,7 @@ import 'dart:async';
import 'package:test/src/backend/declarer.dart';
import 'package:test/src/backend/suite.dart';
+import 'package:test/src/frontend/timeout.dart';
import 'package:test/test.dart';
Declarer _declarer;
@@ -130,6 +131,38 @@ void main() {
expect(_declarer.tests.single.name, "group description");
});
+ test("a test's timeout factor is applied to the group's", () {
+ _declarer.group("group", () {
+ _declarer.test("test", () {},
+ timeout: new Timeout.factor(3));
+ }, timeout: new Timeout.factor(2));
+
+ expect(_declarer.tests, hasLength(1));
+ expect(_declarer.tests.single.metadata.timeout.scaleFactor, equals(6));
+ });
+
+ test("a test's timeout factor is applied to the group's duration", () {
+ _declarer.group("group", () {
+ _declarer.test("test", () {},
+ timeout: new Timeout.factor(2));
+ }, timeout: new Timeout(new Duration(seconds: 10)));
+
+ expect(_declarer.tests, hasLength(1));
+ expect(_declarer.tests.single.metadata.timeout.duration,
+ equals(new Duration(seconds: 20)));
+ });
+
+ test("a test's timeout duration is applied over the group's", () {
+ _declarer.group("group", () {
+ _declarer.test("test", () {},
+ timeout: new Timeout(new Duration(seconds: 15)));
+ }, timeout: new Timeout(new Duration(seconds: 10)));
+
+ expect(_declarer.tests, hasLength(1));
+ expect(_declarer.tests.single.metadata.timeout.duration,
+ equals(new Duration(seconds: 15)));
+ });
+
group(".setUp()", () {
test("is scoped to the group", () {
var setUpRun = false;
« no previous file with comments | « lib/test.dart ('k') | test/backend/invoker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698