Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
[compat]
LinearAlgebra = "1"
NLSolversBase = "8"
Pkg = "1"
Random = "1"
SafeTestsets = "0.0.1, 0.1"
SciMLTesting = "1"
StableRNGs = "1"
StackViews = "^0.1"
Statistics = "1"
Expand All @@ -23,9 +24,10 @@ UnPack = "^1.0.1"
julia = "1.10"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "StableRNGs", "Pkg"]
test = ["Test", "StableRNGs", "SafeTestsets", "SciMLTesting"]
5 changes: 5 additions & 0 deletions test/gp.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Genetic Programming" begin
rng = StableRNG(42)

Expand Down
4 changes: 4 additions & 0 deletions test/interface.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using Evolutionary
using Test
include("types.jl")

@testset "API" begin

#########
Expand Down
5 changes: 5 additions & 0 deletions test/knapsack.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Knapsack" begin
rng = StableRNG(42)

Expand Down
5 changes: 5 additions & 0 deletions test/moea.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Multi-objective EA" begin

rng = StableRNG(42)
Expand Down
5 changes: 5 additions & 0 deletions test/mutations.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Mutations" begin

rng = StableRNG(42)
Expand Down
5 changes: 5 additions & 0 deletions test/n-queens.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "n-Queens" begin
rng = StableRNG(42)

Expand Down
3 changes: 3 additions & 0 deletions test/objective.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Evolutionary
using Test

@testset "Evolutionary Objective" begin

v = Evolutionary.default_values(ones(3))
Expand Down
5 changes: 5 additions & 0 deletions test/onemax.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "OneMax" begin

rng = StableRNG(42)
Expand Down
5 changes: 4 additions & 1 deletion test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Evolutionary = "86b6b26d-c046-49b6-aa0b-5f0f74682bd6"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
Expand All @@ -11,5 +12,7 @@ Evolutionary = {path = "../.."}
[compat]
Aqua = "0.8"
JET = "0.9,0.10,0.11"
SafeTestsets = "0.0.1, 0.1"
SciMLTesting = "1"
Test = "1"
julia = "1.10"
5 changes: 0 additions & 5 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.develop(PackageSpec(path = joinpath(@__DIR__, "..", "..")))
Pkg.instantiate()

using Evolutionary
using Aqua
using JET
Expand Down
5 changes: 5 additions & 0 deletions test/rastrigin.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Rastrigin" begin

rng = StableRNG(42)
Expand Down
5 changes: 5 additions & 0 deletions test/recombinations.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Recombinations" begin

rng = StableRNG(42)
Expand Down
6 changes: 6 additions & 0 deletions test/regression.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
using Evolutionary
using Test
using Random
using LinearAlgebra
using StableRNGs

@testset "Regression" begin

rng = StableRNG(42)
Expand Down
5 changes: 5 additions & 0 deletions test/rosenbrock.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Rosenbrock" begin

rng = StableRNG(42)
Expand Down
69 changes: 34 additions & 35 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
using Evolutionary
using SafeTestsets
using Test
using Random
using LinearAlgebra
using Statistics
using StableRNGs
using SciMLTesting

const GROUP = get(ENV, "GROUP", "All")

# Any group other than "QA" runs the full functional suite (the matrix splits
# Core across version/OS cells only; the suite itself is the same).
if GROUP != "QA"
# Guard against accidental piracy from `import`
@test Evolutionary.contains !== Base.contains

for tests in [
"types.jl",
"objective.jl",
"interface.jl",
"selections.jl",
"recombinations.jl",
"mutations.jl",
"sphere.jl",
"rosenbrock.jl",
"schwefel.jl",
"rastrigin.jl",
"n-queens.jl",
"knapsack.jl",
"onemax.jl",
"moea.jl",
"regression.jl",
"gp.jl",
]
include(tests)
# The functional suite is identical across the Core and CoreLTSPre groups; those
# groups exist only to split the version/OS matrix (see test/test_groups.toml).
# Both run the same set of files, so they share one body thunk; `all = ["Core"]`
# keeps the local default (GROUP unset => "All") running the suite exactly once.
function functional_suite()
@safetestset "Piracy guard" begin
using Evolutionary
# Guard against accidental piracy from `import`
@test Evolutionary.contains !== Base.contains
end
@safetestset "Types" include("types.jl")
@safetestset "Evolutionary Objective" include("objective.jl")
@safetestset "API" include("interface.jl")
@safetestset "Selections" include("selections.jl")
@safetestset "Recombinations" include("recombinations.jl")
@safetestset "Mutations" include("mutations.jl")
@safetestset "Sphere" include("sphere.jl")
@safetestset "Rosenbrock" include("rosenbrock.jl")
@safetestset "Schwefel CMA-ES" include("schwefel.jl")
@safetestset "Rastrigin" include("rastrigin.jl")
@safetestset "n-Queens" include("n-queens.jl")
@safetestset "Knapsack" include("knapsack.jl")
@safetestset "OneMax" include("onemax.jl")
@safetestset "Multi-objective EA" include("moea.jl")
@safetestset "Regression" include("regression.jl")
@safetestset "Genetic Programming" include("gp.jl")
return nothing
end

if GROUP == "QA"
include(joinpath(@__DIR__, "qa", "qa.jl"))
end
run_tests(;
core = functional_suite,
groups = Dict("CoreLTSPre" => functional_suite),
qa = (; env = joinpath(@__DIR__, "qa"), body = joinpath(@__DIR__, "qa", "qa.jl")),
all = ["Core"],
)
5 changes: 5 additions & 0 deletions test/schwefel.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Schwefel CMA-ES" begin

rng = StableRNG(42)
Expand Down
6 changes: 6 additions & 0 deletions test/selections.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
using Evolutionary
using Test
using Random
using Statistics
using StableRNGs

@testset "Selections" begin

rng = StableRNG(42)
Expand Down
5 changes: 5 additions & 0 deletions test/sphere.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
using Evolutionary
using Test
using Random
using StableRNGs

@testset "Sphere" begin

rng = StableRNG(42)
Expand Down
2 changes: 2 additions & 0 deletions test/types.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Evolutionary
using Test
import Evolutionary: value, population_size, default_options, minimizer,
initial_state, update_state!

Expand Down
Loading