Skip to content

Commit

Permalink
Merge pull request #109 from giordano/mg/bump-compat
Browse files Browse the repository at this point in the history
Allow SpecialFunctions v0.9 and v0.10
  • Loading branch information
giordano authored May 19, 2020
2 parents 4958eb7 + cd83e68 commit 8b815fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GSL_jll = "1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"

[compat]
SpecialFunctions = "0.8.0"
SpecialFunctions = "0.8, 0.9, 0.10"
GSL_jll = "2.6"
julia = "1.3.0"

Expand Down
5 changes: 1 addition & 4 deletions src/GSL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ using Markdown
using Libdl
using GSL_jll

const libgslcblas = joinpath(dirname(GSL_jll.libgsl_path),
"libgslcblas" * (Sys.iswindows() ? "-0." : "." ) * dlext)

# Generated code
include("gen/gsl_export.jl")
include("gen/gsl_types.jl")
Expand All @@ -24,7 +21,7 @@ include("error_handling.jl")
function __init__()
# Seems we need to load BLAS with this RTLD_GLOBAL
flags = Libdl.RTLD_LAZY | Libdl.RTLD_DEEPBIND | Libdl.RTLD_GLOBAL
if Libdl.dlopen_e(libgslcblas, flags) in (C_NULL, nothing)
if Libdl.dlopen_e(GSL_jll.libgslcblas_path, flags) in (C_NULL, nothing)
error("$(libgslcblas) cannot be opened, Please re-run Pkg.build(\"GSL\"), and restart Julia.")
end
# # Turn off default error handler
Expand Down
19 changes: 6 additions & 13 deletions test/error.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
using Test
import GSL

@testset "Error Handling" begin
@info "Testing error handler..."
try
GSL.vector_alloc(typemax(Csize_t))
catch e
@test typeof(e) == OutOfMemoryError
end
# This is only needed to make `@test_logs` work with the custom error handling
# of GSL.jl
Base.occursin(r::Regex, err::GSL.C.GSLError) = occursin(r, repr(err))

@info "Testing error handler..."
try
sf_hyperg_2F1(1,2,3,4)
catch e
@test typeof(e) == DomainError
end
@testset "Error Handling" begin
@test_logs (:warn, r"GSL Error 8") @test_throws OutOfMemoryError GSL.vector_alloc(typemax(Csize_t))
@test_logs (:warn, r"GSL Error 1") @test_throws DomainError sf_hyperg_2F1(1,2,3,4)
end

4 comments on commit 8b815fb

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

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

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

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

@giordano
Copy link
Member Author

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/14971

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 v1.0.0 -m "<description of version>" 8b815fbd43602bdb5b2281af4e7e353bb16b8eb9
git push origin v1.0.0

Please sign in to comment.