Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
# If present, the tests run only those submodules defined above. `General` is
# not a submodule, but it runs all of the top-level tests in MOI.

import Test

# This file gets called first. If it doesn't crash, all is well.
include("issue980.jl")

Expand All @@ -31,8 +33,25 @@ MODULES_TO_TEST = get(
"General;Benchmarks;Bridges;Bridges/Constraint;Bridges/Objective;Bridges/Variable;FileFormats;Nonlinear;Test;Utilities",
)

function include_with_method_redefinition_check(jl_filename)
stderr_filename = tempname()
open(stderr_filename, "w") do io
return redirect_stderr(() -> include(jl_filename), io)
end
contents = read(stderr_filename, String)
print(stderr, contents)
warnings = findall(
r"WARNING: Method definition (.+?) in module (.+?) at (.+?) overwritten at (.+?)\n",
contents,
)
if isempty(warnings)
error("Found overwritten method")
end
return
end

for submodule in split(MODULES_TO_TEST, ";")
include("$(submodule)/runtests.jl")
include_with_method_redefinition_check("$submodule/runtests")
Comment thread
odow marked this conversation as resolved.
Outdated
GC.gc() # Force GC run here to reduce memory pressure
end

Expand Down
Loading