Emitter takes test name and score
diff --git a/lib/src/benchmark_base.dart b/lib/src/benchmark_base.dart
index 9eb881d..c3be399 100644
--- a/lib/src/benchmark_base.dart
+++ b/lib/src/benchmark_base.dart
@@ -63,7 +63,7 @@
double score = measure();
print("$name(RunTime): $score us.");
if( emitter != null ) {
- emitter.emit(score);
+ emitter.emit(name, score);
}
}
diff --git a/lib/src/score_emitter.dart b/lib/src/score_emitter.dart
index 7a2fb2d..919b97a 100644
--- a/lib/src/score_emitter.dart
+++ b/lib/src/score_emitter.dart
@@ -2,6 +2,6 @@
abstract class ScoreEmitter {
- void emit(value);
+ void emit(String testName, double value);
}
\ No newline at end of file
diff --git a/test/result_emitter_test.dart b/test/result_emitter_test.dart
index c395b24..e50f1c7 100644
--- a/test/result_emitter_test.dart
+++ b/test/result_emitter_test.dart
@@ -18,7 +18,7 @@
when(callsTo('emit')).alwaysCall(fakeEmit);
}
- void fakeEmit(double value) {
+ void fakeEmit(String name, double value) {
hasEmitted = true;
}
}
@@ -48,7 +48,6 @@
benchmarkHarnessTest() {
MockResultEmitter createMockEmitter() {
MockResultEmitter emitter = new MockResultEmitter();
- emitter.when(callsTo('emit'));
return emitter;
}