Permalink
Browse files

fixed longer_test_suite example to run with new Stopwatch

  • Loading branch information...
1 parent 0a3ed3e commit c0d3ae61aafe65b91d75151f9a42b723e3e2442a @krukow krukow committed Nov 24, 2011
View
8 src/base/TestRunner.dart
@@ -13,12 +13,12 @@ class TestRunner {
TestResult _runTestCase(TestCase test, TestResult result) {
TestResult testCaseResult = new TestResult();
- StopWatch watch = new StopWatch();
+ Stopwatch watch = new Stopwatch();
time(()=>test.setUp(), watch);
test.tests().forEach((name,t) {
- StopWatch testWatch = new StopWatch();
+ Stopwatch testWatch = new Stopwatch();
try {
time(t, [watch, testWatch]);
testCaseResult.pass(t, name, testWatch.elapsedInUs());
@@ -41,10 +41,10 @@ class TestRunner {
TestResult _runTestSuite(TestSuite suite, TestResult result) {
TestResult testSuiteResult = new TestResult();
- StopWatch watch = new StopWatch();
+ Stopwatch watch = new Stopwatch();
suite.testCases.forEach((tc) {
- StopWatch testWatch = new StopWatch();//TODO SUM instead of time
+ Stopwatch testWatch = new Stopwatch();//TODO SUM instead of time
time(()=>_runTestCase(tc,testSuiteResult),
[watch, testWatch]);
});
View
6 src/dunit_reporters.dart
@@ -1,8 +1,8 @@
#library("contrib.dunit.reporters");
#import("dunit_base.dart");
-#import("../utils/utils.dart");
-#import("../pprint/pprint.dart");
+#import("../dlib/utils.dart");
+#import("../dlib/pprint.dart");
-#source("src/reporters/ConsoleReporter.dart");
+#source("reporters/ConsoleReporter.dart");
View
2 src/examples/longer_test_suite.dart
@@ -1,7 +1,7 @@
#import("../dunit_base.dart");
#import("../dunit_dsl.dart");
#import("../dunit_reporters.dart");
-#import("../../pprint/pprint.dart");
+#import("../../dlib/pprint.dart");
#source("tests/FirstTestCase.dart");
#source("tests/SecondTestCase.dart");
#source("tests/ThirdTestCase.dart");
View
6 src/reporters/ConsoleReporter.dart
@@ -15,7 +15,7 @@ class ConsoleReporter extends TestReporter {
return color(str,'33');
}
- print_defects(defects [indent=""]) {
+ print_defects(defects, [indent=""]) {
defects.forEach((num, r) {
print("${indent}${r['name']}: ${r['outcome']} (${r['time']} us)");
print("${indent}${r['message']}");
@@ -24,14 +24,14 @@ class ConsoleReporter extends TestReporter {
});
}
- print_passed(passed [indent=""]) {
+ print_passed(passed, [indent=""]) {
passed.forEach((num, r) {
print("${indent}${r['name']}: ${r['outcome']} (${r['time']} us)");
});
}
- void report(TestResult res [indent=""]) {
+ void report(TestResult res, [indent=""]) {
res.results.forEach((k,tr) {
if (k is TestSuite) {
print("${indent}TestSuite: ${k.name} (${tr['outcome']})");

0 comments on commit c0d3ae6

Please sign in to comment.