File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed 
java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5 Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 33import  static  org .junit .platform .engine .TestExecutionResult .Status .SUCCESSFUL ;
44
55import  java .io .PrintWriter ;
6+ import  java .time .Duration ;
7+ import  java .time .Instant ;
68import  java .util .Collections ;
79import  java .util .LinkedHashMap ;
810import  java .util .Map ;
@@ -19,10 +21,18 @@ public class CommandLineSummary implements TestExecutionListener {
1921  private  final  Map <TestIdentifier , Failure > failures  =
2022      Collections .synchronizedMap (new  LinkedHashMap <>());
2123  private  TestPlan  testPlan ;
24+   private  Instant  testPlanStart ;
25+   private  Instant  testPlanEnd ;
2226
2327  @ Override 
2428  public  void  testPlanExecutionStarted (TestPlan  testPlan ) {
2529    this .testPlan  = Objects .requireNonNull (testPlan );
30+     this .testPlanStart  = Instant .now ();
31+   }
32+ 
33+   @ Override 
34+   public  void  testPlanExecutionFinished (TestPlan  testPlan ) {
35+     this .testPlanEnd  = Instant .now ();
2636  }
2737
2838  @ Override 
@@ -51,6 +61,8 @@ public void writeTo(PrintWriter writer) {
5161
5262      count ++;
5363    }
64+ 
65+     writer .printf ("Time: %.3f%n" , Duration .between (testPlanStart , testPlanEnd ).toMillis () / 1000.0 );
5466  }
5567
5668  private  static  void  writeFilteredStackTrace (
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments