Skip to content

Commit b94b0bf

Browse files
authored
Update runtests.jl
1 parent 12cc35c commit b94b0bf

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/runtests.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
# If present, the tests run only those submodules defined above. `General` is
2323
# not a submodule, but it runs all of the top-level tests in MOI.
2424

25-
import Test
26-
2725
# This file gets called first. If it doesn't crash, all is well.
2826
include("issue980.jl")
2927

@@ -33,6 +31,19 @@ MODULES_TO_TEST = get(
3331
"General;Benchmarks;Bridges;Bridges/Constraint;Bridges/Objective;Bridges/Variable;FileFormats;Nonlinear;Test;Utilities",
3432
)
3533

34+
"""
35+
include_with_method_redefinition_check(jl_filename)
36+
37+
This function runs `include(jl_filename)` with an additional check that there
38+
are no `WARNING: Method definition foo in module Foo overwritten` warnings.
39+
40+
It does this by piping `stderr` to a file, and then parsing the file.
41+
42+
One consequence is that `stderr` is not printed until the _end_ of this
43+
function. Thus, some warnings may appear in the wrong place.
44+
45+
This function requires Julia to be started with `--warn-overwrite=true`.
46+
"""
3647
function include_with_method_redefinition_check(jl_filename)
3748
stderr_filename = tempname()
3849
open(stderr_filename, "w") do io

0 commit comments

Comments
 (0)