Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make JuMP tests callable from an external package #1711

Closed
blegat opened this issue Dec 29, 2018 · 1 comment · Fixed by #3168 or #3174
Closed

Make JuMP tests callable from an external package #1711

blegat opened this issue Dec 29, 2018 · 1 comment · Fixed by #3168 or #3174
Labels
Category: Extensions Related to JuMP extensions Type: Tests
Milestone

Comments

@blegat
Copy link
Member

blegat commented Dec 29, 2018

The tests that are run for JuMP.Model and JuMPExtension.MyModel should also work for StructJuMP.StructuredModel. Currently, if StructJuMP wanted to run these tests, it would have to include, e.g. constraint.jl and then call constraints_tests(StructuredModel, ...) but including constraint.jl also run the tests for JuMP.Model and JuMPExtension.MyModel. It would be nice to define the tests and run the tests in separate files so that StructJuMP can define them without running them on JuMP.Model and JuMPExtension.MyModel.

@odow
Copy link
Member

odow commented Jan 4, 2023

I'm actually going to re-open this until we have something documented. Were essentially there, though.

import JuMP
include(joinpath(dirname(dirname(pathof(JuMP))), "test", "Kokako.jl"))
const MODULES_TO_TEST = Kokako.include_modules_to_test(JuMP)
Kokako.run_tests(
    MODULES_TO_TEST,
    JuMPExtension.MyModel,
    JuMPExtension.MyVariableRef;
    test_prefix = "test_extension_",
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Extensions Related to JuMP extensions Type: Tests
2 participants