diff --git a/Project.toml b/Project.toml index 6cf9f86..1b9bd86 100644 --- a/Project.toml +++ b/Project.toml @@ -7,16 +7,5 @@ version = "0.1.0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" [compat] -Aqua = "0.8" Dates = "1.10" -SafeTestsets = "0.1" -Test = "1.10" julia = "1.10" - -[extras] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Aqua", "Test", "SafeTestsets"] diff --git a/docs/src/stopping_criterion.md b/docs/src/stopping_criterion.md index 6f5917c..4a05b99 100644 --- a/docs/src/stopping_criterion.md +++ b/docs/src/stopping_criterion.md @@ -5,4 +5,4 @@ Modules = [AlgorithmsInterface] Pages = ["stopping_criterion.jl"] Order = [:type, :function] Private = true -``` \ No newline at end of file +``` diff --git a/test/AlgorithmsInterfaceTestSuite.jl/Project.toml b/test/AlgorithmsInterfaceTestSuite.jl/Project.toml new file mode 100644 index 0000000..56f6897 --- /dev/null +++ b/test/AlgorithmsInterfaceTestSuite.jl/Project.toml @@ -0,0 +1,14 @@ +name = "AlgorithmsInterfaceTestSuite" +uuid = "876e16e5-0a55-4659-a4bc-e03625482f1c" +version = "0.1.0" +authors = ["Ronny Bergmann "] + +[deps] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +AlgorithmsInterface = "d1e3940c-cd12-4505-8585-b0a4b322527d" + +[compat] +Test = "1.10.0" + +[sources] +AlgorithmsInterface = {path = "../../"} \ No newline at end of file diff --git a/test/AlgorithmsInterfaceTestSuite.jl/src/AlgorithmsInterfaceTestSuite.jl b/test/AlgorithmsInterfaceTestSuite.jl/src/AlgorithmsInterfaceTestSuite.jl new file mode 100644 index 0000000..ce2bf95 --- /dev/null +++ b/test/AlgorithmsInterfaceTestSuite.jl/src/AlgorithmsInterfaceTestSuite.jl @@ -0,0 +1,21 @@ +""" + AlgorithmsInterfaceTestSuite + +A package to provide dummy algorithms and other test tools for `AlgorithmsInterface.jl`. +""" +module AlgorithmsInterfaceTestSuite + +using AlgorithmsInterface + +struct DummyAlgorithm <: Algorithm + stopping_criterion::StoppingCriterion +end +struct DummyProblem <: Problem end +mutable struct DummyState{S <: StoppingCriterionState} <: State + stopping_criterion_state::S + iteration::Int +end + +export DummyAlgorithm, DummyProblem, DummyState + +end # module AlgorithmsInterfaceTestSuite diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..76e40b7 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,18 @@ +[deps] +AlgorithmsInterface = "d1e3940c-cd12-4505-8585-b0a4b322527d" +AlgorithmsInterfaceTestSuite = "876e16e5-0a55-4659-a4bc-e03625482f1c" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +AlgorithmsInterface = {path = "../"} +AlgorithmsInterfaceTestSuite = {path = "AlgorithmsInterfaceTestSuite.jl"} + +[compat] +Aqua = "0.8" +SafeTestsets = "0.1" +Test = "1.10" +julia = "1.10" diff --git a/test/runtests.jl b/test/runtests.jl index a6d423f..89874ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,7 +9,7 @@ using Dates end @safetestset "Stopping Criteria" begin - include("stopping_criterion.jl") + include("test_stopping_criterion.jl") end @safetestset "Aqua" begin diff --git a/test/stopping_criterion.jl b/test/test_stopping_criterion.jl similarity index 86% rename from test/stopping_criterion.jl rename to test/test_stopping_criterion.jl index 36d5a37..38687f3 100644 --- a/test/stopping_criterion.jl +++ b/test/test_stopping_criterion.jl @@ -1,15 +1,16 @@ +using Pkg +Pkg.activate(@__DIR__) +if VERSION < v"1.11" + # Once the main package is registered: just load test suite + # Pkg.add(path = (@__DIR__) * "/../", subdir = "test/AlgorithmsInterfaceTestSuite.jl") + Pkg.develop(path = (@__DIR__) * "/../") + Pkg.develop(path = (@__DIR__) * "/AlgorithmsInterfaceTestSuite.jl") +end +Pkg.resolve() using Test using AlgorithmsInterface using Dates - -struct DummyAlgorithm <: Algorithm - stopping_criterion::StoppingCriterion -end -struct DummyProblem <: Problem end -mutable struct DummyState{S <: StoppingCriterionState} <: State - stopping_criterion_state::S - iteration::Int -end +using AlgorithmsInterfaceTestSuite problem = DummyProblem()