Skip to content

Commit

Permalink
Merge pull request #182 from scipopt/partial-test-60
Browse files Browse the repository at this point in the history
Some tests avoided on < 7.0
  • Loading branch information
rschwarz authored Jan 7, 2021
2 parents 5f48527 + a60d4da commit df8d76c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ function __init__()
minor = SCIPminorVersion()
patch = SCIPtechVersion()
current = VersionNumber("$major.$minor.$patch")
required = VersionNumber("6.0.0")
upperbound = VersionNumber("7.0.1")
if current < required || current > upperbound
required = VersionNumber("6")
upperbound = VersionNumber("8")
if current < required || current >= upperbound
error("SCIP is installed at version $current, " *
"supported are $required up to (including) $upperbound.")
"supported are $required up to (excluding) $upperbound.")
end
end
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 df8d76c

Please sign in to comment.