Skip to content

Commit

Permalink
Warn, not error, on precomilation failure (#85)
Browse files Browse the repository at this point in the history
Fixes #84
  • Loading branch information
timholy authored Mar 5, 2021
1 parent b18e920 commit a7b6eea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ReferenceTests"
uuid = "324d217c-45ce-50fc-942e-d289b448e8cf"
authors = ["Christof Stocker <stocker.christof@gmail.com>", "Lyndon White <oxinabox@ucc.asn.au>", "Johnny Chen <johnnychen94@hotmail.com>"]
version = "0.9.4"
version = "0.9.5"

[deps]
DeepDiffs = "ab62b9b5-e342-54a8-a765-a90f495de1a6"
Expand Down
13 changes: 9 additions & 4 deletions src/ReferenceTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ include("equality_metrics.jl")
include("render.jl")

if Base.VERSION >= v"1.4.2" && ccall(:jl_generating_output, Cint, ()) == 1
@assert precompile(Tuple{Core.kwftype(typeof(test_reference)),NamedTuple{(:by,), Tuple{typeof(isequal)}},typeof(test_reference),String,Matrix{RGB{Float64}}}) # time: 0.4697069
@assert precompile(Tuple{Core.kwftype(typeof(test_reference)),NamedTuple{(:by,), Tuple{typeof(isequal)}},typeof(test_reference),String,Matrix{RGBA{Float64}}}) # time: 0.24671553
@assert precompile(Tuple{typeof(test_reference),File{DataFormat{:PNG}},Matrix{RGB{Float64}},Function,Nothing}) # time: 0.029915236
@assert precompile(Tuple{typeof(test_reference),File{DataFormat{:PNG}},Matrix{RGBA{Float64}},Function,Nothing}) # time: 0.013356352
precompile(Tuple{Core.kwftype(typeof(test_reference)),NamedTuple{(:by,), Tuple{typeof(isequal)}},typeof(test_reference),String,Matrix{RGB{Float64}}}) || @warn "Failure to precompile ReferenceTests.test_reference(String,Matrix{RGB})"
precompile(Tuple{Core.kwftype(typeof(test_reference)),NamedTuple{(:by,), Tuple{typeof(isequal)}},typeof(test_reference),String,Matrix{RGBA{Float64}}}) || @warn "Failure to precompile ReferenceTests.test_reference(String,Matrix{RGBA})"
if isdefined(FileIO, :action)
precompile(Tuple{typeof(test_reference),File{DataFormat{:PNG},String},Matrix{RGB{Float64}},Function,Nothing}) || @warn "Failure to precompile ReferenceTests.test_reference(File{format\"PNG\",String},Matrix{RGB})"
precompile(Tuple{typeof(test_reference),File{DataFormat{:PNG},String},Matrix{RGBA{Float64}},Function,Nothing}) || @warn "Failure to precompile ReferenceTests.test_reference(File{format\"PNG\",String},Matrix{RGBA})"
else
precompile(Tuple{typeof(test_reference),File{DataFormat{:PNG}},Matrix{RGB{Float64}},Function,Nothing}) || @warn "Failure to precompile ReferenceTests.test_reference(File{format\"PNG\"},Matrix{RGB})"
precompile(Tuple{typeof(test_reference),File{DataFormat{:PNG}},Matrix{RGBA{Float64}},Function,Nothing}) || @warn "Failure to precompile ReferenceTests.test_reference(File{format\"PNG\"},Matrix{RGBA})"
end
end

end # module

2 comments on commit a7b6eea

@johnnychen94
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/31337

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.5 -m "<description of version>" a7b6eeabf70fd5ad01a671eb1d0facfbd6f935e7
git push origin v0.9.5

Please sign in to comment.