comparison 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
comparison
equal deleted inserted replaced
728:45966c77cb20 729:1ea81e106482
29 end 29 end
30 end 30 end
31 31
32 if endswith(name, "_test.jl") && any(occursin.(globs, filepath)) 32 if endswith(name, "_test.jl") && any(occursin.(globs, filepath))
33 printstyled("Running "; bold=true, color=:green) 33 printstyled("Running "; bold=true, color=:green)
34 println(filepath) 34 print(filepath)
35
36 t_start = time()
35 @testset "$name" begin 37 @testset "$name" begin
36 include(filepath) 38 include(filepath)
37 end 39 end
40 t_end = time()
41
42 Δt = t_end - t_start
43 printstyled(" ($(round(Δt, digits=2)) s)"; color=:light_black)
44 println()
38 end 45 end
39 end 46 end
40 end 47 end
41 48
42 testsetname = isempty(ARGS) ? "Sbplib.jl" : join(ARGS, ", ") 49 testsetname = isempty(ARGS) ? "Sbplib.jl" : join(ARGS, ", ")
45 run_testfiles(ARGS) 52 run_testfiles(ARGS)
46 end 53 end
47 54
48 # Make it more clear that a glob was used in the test set name. 55 # Make it more clear that a glob was used in the test set name.
49 # Make standalone files fail the same way when run together and alone 56 # Make standalone files fail the same way when run together and alone
50 # Add a timer for each file run