Skip to content

Commit

Permalink
version number in dedicated function, conditional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matbesancon committed Jan 7, 2021
1 parent 216f038 commit a60d4da
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
13 changes: 13 additions & 0 deletions src/util.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@

function camel_case_to_snake_case(x::AbstractString)
# from https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
s1 = replace(x, r"(.)([A-Z][a-z]+)" => s"\1_\2")
return lowercase(replace(s1, r"([a-z0-9])([A-Z])" => s"\1_\2"))
end

"""
SCIP_versionnumber() -> VersionNumber
Current version of the SCIP binary
"""
function SCIP_versionnumber()
major = SCIPmajorVersion()
minor = SCIPminorVersion()
patch = SCIPtechVersion()
return VersionNumber(major, minor, patch)
end
22 changes: 11 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ include("conshdlr_support.jl")
include("conshdlr.jl")
end

include("sepa_support.jl")

@testset "separators" begin
include("sepa.jl")
end

@testset "cut callbacks" begin
include("cutcallback.jl")
if SCIP.SCIP_versionnumber() >= v"7"
include("sepa_support.jl")
@testset "separators" begin
include("sepa.jl")
end
@testset "cut callbacks" begin
include("cutcallback.jl")
end
else
@info "Separation and callbacks not tested for SCIP versions below 7"
end

@testset "MathOptInterface tests (bridged)" begin
Expand All @@ -46,6 +48,4 @@ end
include("MOI_nonlinear_exprs.jl")
end

@testset "constraint handlers (with MOI)" begin
include("MOI_conshdlr.jl")
end
include("MOI_conshdlr.jl")

0 comments on commit a60d4da

Please sign in to comment.