@@ -189,20 +189,29 @@ public void run() {
189
189
}
190
190
191
191
private void executeStateTest (final Map <String , GeneralStateTestCaseSpec > generalStateTests ) {
192
- for (final Map .Entry <String , GeneralStateTestCaseSpec > generalStateTestEntry :
193
- generalStateTests .entrySet ()) {
194
- if (testName == null || testName .equals (generalStateTestEntry .getKey ())) {
195
- generalStateTestEntry
196
- .getValue ()
197
- .finalStateSpecs ()
198
- .forEach ((__ , specs ) -> traceTestSpecs (generalStateTestEntry .getKey (), specs ));
192
+ int repeatCount = Math .max (1 , parentCommand .getRepeatCount ());
193
+ for (int i = 0 ; i < repeatCount ; i ++) {
194
+ boolean isLastIteration = (i == repeatCount - 1 );
195
+ for (final Map .Entry <String , GeneralStateTestCaseSpec > generalStateTestEntry :
196
+ generalStateTests .entrySet ()) {
197
+ if (testName == null || testName .equals (generalStateTestEntry .getKey ())) {
198
+ generalStateTestEntry
199
+ .getValue ()
200
+ .finalStateSpecs ()
201
+ .forEach (
202
+ (__ , specs ) ->
203
+ traceTestSpecs (generalStateTestEntry .getKey (), specs , isLastIteration ));
204
+ }
199
205
}
200
206
}
201
207
}
202
208
203
- private void traceTestSpecs (final String test , final List <GeneralStateTestCaseEipSpec > specs ) {
209
+ private void traceTestSpecs (
210
+ final String test ,
211
+ final List <GeneralStateTestCaseEipSpec > specs ,
212
+ final boolean isLastIteration ) {
204
213
final OperationTracer tracer = // You should have picked Mercy.
205
- parentCommand .showJsonResults
214
+ parentCommand .showJsonResults && isLastIteration
206
215
? new StandardJsonTracer (
207
216
parentCommand .out ,
208
217
parentCommand .showMemory ,
@@ -231,7 +240,7 @@ private void traceTestSpecs(final String test, final List<GeneralStateTestCaseEi
231
240
final Transaction transaction = spec .getTransaction (0 );
232
241
final ObjectNode summaryLine = objectMapper .createObjectNode ();
233
242
if (transaction == null ) {
234
- if (parentCommand .showJsonAlloc || parentCommand .showJsonResults ) {
243
+ if (( parentCommand .showJsonAlloc || parentCommand .showJsonResults ) && isLastIteration ) {
235
244
parentCommand .out .println (
236
245
"{\" error\" :\" Transaction was invalid, trace and alloc unavailable.\" }" );
237
246
}
@@ -332,12 +341,14 @@ private void traceTestSpecs(final String test, final List<GeneralStateTestCaseEi
332
341
if (!result .getValidationResult ().isValid ()) {
333
342
summaryLine .put ("error" , result .getValidationResult ().getErrorMessage ());
334
343
}
335
- if (parentCommand .showJsonAlloc ) {
344
+ if (parentCommand .showJsonAlloc && isLastIteration ) {
336
345
EvmToolCommand .dumpWorldState (worldState , parentCommand .out );
337
346
}
338
347
}
339
348
340
- parentCommand .out .println (summaryLine );
349
+ if (isLastIteration ) {
350
+ parentCommand .out .println (summaryLine );
351
+ }
341
352
}
342
353
}
343
354
}
0 commit comments