diff test/runtests.jl @ 729:1ea81e106482 feature/selectable_tests

Add timing for each file
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 17 Mar 2021 20:44:58 +0100
parents 95b207729b7a
children 840557a58ac0
line wrap: on
line diff
--- a/test/runtests.jl	Wed Mar 17 20:34:40 2021 +0100
+++ b/test/runtests.jl	Wed Mar 17 20:44:58 2021 +0100
@@ -31,10 +31,17 @@
 
         if endswith(name, "_test.jl") && any(occursin.(globs, filepath))
             printstyled("Running "; bold=true, color=:green)
-            println(filepath)
+            print(filepath)
+
+            t_start = time()
             @testset "$name" begin
                 include(filepath)
             end
+            t_end = time()
+
+            Δt = t_end - t_start
+            printstyled(" ($(round(Δt, digits=2)) s)"; color=:light_black)
+            println()
         end
     end
 end
@@ -47,4 +54,3 @@
 
 # Make it more clear that a glob was used in the test set name.
 # Make standalone files fail the same way when run together and alone
-# Add a timer for each file run