Skip to content

Commit

Permalink
Fail test instead of producing an error when not interactive or updating
Browse files Browse the repository at this point in the history
  • Loading branch information
moble authored Jul 22, 2024
1 parent b4de2fa commit 68c2778
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/test_reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,13 @@ function test_reference(
""" reference = reference_path actual = actual_path

if !isinteractive() && !force_update()
error("""
@info """
To update the reference images either run the tests interactively with 'include(\"test/runtests.jl\")',
or to force-update all failing reference images set the environment variable `JULIA_REFERENCETESTS_UPDATE`
to "true" and re-run the tests via Pkg.
""")
end

if force_update() || input_bool("Replace reference with actual result?")
"""
@test false
elseif force_update() || input_bool("Replace reference with actual result?")
mv(actual_path, reference_path; force=true) # overwrite old file it
@info "Please run the tests again for any changes to take effect"
else
Expand Down

0 comments on commit 68c2778

Please sign in to comment.