Skip to content

Commit

Permalink
Fix tests for TimerOutputs (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
efaulhaber authored Oct 10, 2024
1 parent a359043 commit 9d5899d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TrixiBaseMPIExt = "MPI"

[compat]
MPI = "0.20"
TimerOutputs = "0.5"
TimerOutputs = "0.5.25"
julia = "1.8"

[extras]
Expand Down
52 changes: 26 additions & 26 deletions test/test_timers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
TrixiBase.TimerOutputs.reset_timer!(timer())

timer_output = """
────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 91.5s / 0.0% 5.43MiB / 0.0%
Section ncalls time %tot avg alloc %tot avg
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 91.5s / 0.0% 5.43MiB / 0.0%
Section ncalls time %tot avg alloc %tot avg
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────
"""
# Remove "Tot / % measured" line and trailing white spaces
expected = replace(timer_output, r"Tot / % measured: .*" => "",
Expand All @@ -34,15 +34,15 @@
@trixi_timeit timer() "test timer" sin(0.0)

timer_output = """
───────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 61.4ms / 99.2% 5.60MiB / 99.6%
Section ncalls time %tot avg alloc %tot avg
───────────────────────────────────────────────────────────────────────
test timer 2 60.9ms 100.0% 60.9ms 5.57MiB 100.0% 5.57MiB
───────────────────────────────────────────────────────────────────────
───────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 61.4ms / 99.2% 5.60MiB / 99.6%
Section ncalls time %tot avg alloc %tot avg
───────────────────────────────────────────────────────────────────────
test timer 2 60.9ms 100.0% 60.9ms 5.57MiB 100.0% 5.57MiB
───────────────────────────────────────────────────────────────────────
"""
# Remove "Tot / % measured" line and trailing white spaces and replace
# the "test timer" line (but don't remove it, we want to check that it's there).
Expand Down Expand Up @@ -77,15 +77,15 @@
println(timer())

timer_output = """
─────────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 23.7ms / 0.0% 1.00MiB / 0.0%
Section ncalls time %tot avg alloc %tot avg
─────────────────────────────────────────────────────────────────────────
test timer 2 1 875ns 100.0% 875ns 48.0B 100.0% 48.0B
─────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 23.7ms / 0.0% 1.00MiB / 0.0%
Section ncalls time %tot avg alloc %tot avg
─────────────────────────────────────────────────────────────────────────
test timer 2 1 875ns 100.0% 875ns 48.0B 100.0% 48.0B
─────────────────────────────────────────────────────────────────────────
"""
# Remove "Tot / % measured" line and trailing white spaces and replace
# the "test timer" line (but don't remove it, we want to check that it's there).
Expand Down

0 comments on commit 9d5899d

Please sign in to comment.