Skip to content

Commit

Permalink
Update alpha tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Oct 22, 2024
1 parent 88d2287 commit 2405846
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 4 additions & 3 deletions test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,14 @@ end
coverage = occursin("--code-coverage", cmd) &&
!occursin("--code-coverage=none", cmd)
if coverage
# Run with coverage takes 6 time steps.
@test startswith(lines[end], "6, 0.005")
@test occursin(r"1.0, 0.968", lines[end])
# Run with coverage takes 1 time step.
@test occursin(r"1, 0.00404[0-9]*, 1.0, 0.96795", lines[end])
else
# Run without coverage takes 85 time steps.
@test startswith(lines[end], "85, 0.3, 1.0, 0.57771")
end
@test length(split(lines[end], ",")) == 4
@test any(occursin.(r"NaN", lines)) == false
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
9 changes: 7 additions & 2 deletions test/test_structured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,13 @@ end
!occursin("--code-coverage=none", cmd)
if coverage
# Run with coverage takes 1 time steps.
@test startswith(lines[end], "1, 0.0002")
@test occursin(r"1.0, 0.9809", lines[end])
@test occursin(r"1, 0.0002[0-9]*, 1.0, 0.9809", lines[end])
else
# Run without coverage takes 193 time steps.
@test startswith(lines[end], "193, 0.05, 1.0, 0.3160")
end
@test length(split(lines[end], ",")) == 4
@test any(occursin.(r"NaN", lines)) == false
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down Expand Up @@ -796,6 +797,8 @@ end
# Run without coverage takes 191 time steps.
@test startswith(lines[end], "191, 0.05, 3.70")
end
@test length(split(lines[end], ",")) == 10
@test any(occursin.(r"NaN", lines)) == false

# Test alphas_min.txt
lines = readlines(joinpath("out", "alphas_min.txt"))
Expand All @@ -811,6 +814,8 @@ end
# Run without coverage takes 191 time steps.
@test startswith(lines[end], "191, 0.05, -0.0, 0.7216")
end
@test length(split(lines[end], ",")) == 10
@test any(occursin.(r"NaN", lines)) == false
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
9 changes: 7 additions & 2 deletions test/test_tree_2d_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,13 @@ end
!occursin("--code-coverage=none", cmd)
if coverage
# Run with coverage takes 6 time steps.
@test startswith(lines[end], "6, 0.014")
@test occursin(r"1.0, 0.953", lines[end])
@test occursin(r"6, 0.014[0-9]*, 1.0, 0.953", lines[end])
else
# Run without coverage takes 381 time steps.
@test startswith(lines[end], "381, 1.0, 1.0, 0.544")
end
@test length(split(lines[end], ",")) == 4
@test any(occursin.(r"NaN", lines)) == false
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down Expand Up @@ -644,6 +645,8 @@ end
# Run without coverage takes 349 time steps.
@test startswith(lines[end], "349, 1.0, 0.0002")
end
@test length(split(lines[end], ",")) == 14
@test any(occursin.(r"NaN", lines)) == false

# Test alphas_min.txt
lines = readlines(joinpath("out", "alphas_min.txt"))
Expand All @@ -659,6 +662,8 @@ end
# Run without coverage takes 349 time steps.
@test startswith(lines[end], "349, 1.0, -0.0, 0.773")
end
@test length(split(lines[end], ",")) == 14
@test any(occursin.(r"NaN", lines)) == false
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down

0 comments on commit 2405846

Please sign in to comment.