Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Mar 29, 2024
1 parent 476ddcd commit 715a034
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/license.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ function _get_xpauthpath(xpauth_path = "", verbose::Bool = true)
# Windows.
push!(candidates, joinpath(dirname(libdir), "bin", XPAUTH))
# This location is used by Xpress_jll
# push!(
# candidates,
# joinpath(dirname(dirname(libxprs)), "license", "community-xpauth.xpr"),
# )
push!(
candidates,
joinpath(dirname(dirname(libxprs)), "license", "community-xpauth.xpr"),
)
for candidate in candidates
# We assume a relative root directory of the shared library. If
# `candidate` is an absolute path, thhen joinpath will ignore libdir and
Expand Down
8 changes: 5 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using Test
using Xpress

function test_licensing()
ret = ENV["XPAUTH_PATH"]
ret = get(ENV, "XPAUTH_PATH", nothing)
# Create a bogus license file
xpauth_path = mktempdir()
filename = joinpath(xpauth_path, "xpauth.xpr")
Expand All @@ -32,15 +32,17 @@ function test_licensing()
# Then, we can check that using the root fails to find a license
@test_throws Xpress.XpressError Xpress.initialize(; xpauth_path)
# Now we need to re-initialize the license so that we can run other tests.
ENV["XPAUTH_PATH"] = ret
if ret !== nothing
ENV["XPAUTH_PATH"] = ret
end
Xpress.initialize()
return
end

@testset "test_licensing" begin
# It is important that we test this first, so that there no XpressProblem
# objects with finalizers that may get run during the function call.
# test_licensing()
test_licensing()
end

println(Xpress.get_banner())
Expand Down

0 comments on commit 715a034

Please sign in to comment.