Skip to content

Commit

Permalink
Merge pull request #63 from awesome-spectral-indices/fm/tests
Browse files Browse the repository at this point in the history
light tests restructure
  • Loading branch information
MartinuzziFrancesco authored Apr 12, 2024
2 parents fd6a5e1 + d14a8be commit b9d71d9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions test/DataFrames/compute_index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using DataFrames
using Random
using Combinatorics
using StatsBase
include("../test_utils.jl")
Random.seed!(17)

floats = [Float64, Float32, Float16]
Expand Down
2 changes: 2 additions & 0 deletions test/DataFrames/compute_kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using Test
using SpectralIndices
using DataFrames

floats = [Float64, Float32, Float16]

function convert_to_kwargs(df::DataFrame)
kwargs = [(Symbol(band) => DataFrame(band => df[:, band])) for band in names(df)]
return kwargs
Expand Down
1 change: 1 addition & 0 deletions test/YAXArrays/compute_index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using DimensionalData
using Random
using Combinatorics
using StatsBase
include("../test_utils.jl")
Random.seed!(17)

floats = [Float64, Float32, Float16]
Expand Down
1 change: 1 addition & 0 deletions test/compute_index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using YAXArrays
using Random
using Combinatorics
using StatsBase
include("test_utils.jl")
Random.seed!(17)

floats = [Float64, Float32, Float16]
Expand Down
35 changes: 17 additions & 18 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@ using Test
include("qa.jl")
end

@safetestset "Utils" begin
include("utils.jl")
include("DataFrames/datasets.jl")
include("YAXArrays/datasets.jl")
@testset "Utils" begin
@safetestset "General utils" include("utils.jl")
@safetestset "DataFrames datasets" include("DataFrames/datasets.jl")
@safetestset "YAXArrays datasets" include("YAXArrays/datasets.jl")
end

@safetestset "Axioms" begin
include("indices.jl")
include("platforms.jl")
include("bands.jl")
include("constants.jl")
@testset "Axioms" begin
@safetestset "Indices" include("indices.jl")
@safetestset "Platforms" include("platforms.jl")
@safetestset "Bands" include("bands.jl")
@safetestset "Constants" include("constants.jl")
end

@safetestset "Compute Indices" begin
include("test_utils.jl")
include("compute_index.jl")
include("DataFrames/compute_index.jl")
include("YAXArrays/compute_index.jl")
@testset "Compute Indices" begin
@safetestset "Built-in types" include("compute_index.jl")
@safetestset "DataFrames" include("DataFrames/compute_index.jl")
@safetestset "YAXArrays" include("YAXArrays/compute_index.jl")
end

@safetestset "Compute Kernels" begin
include("compute_kernel.jl")
include("DataFrames/compute_kernel.jl")
include("YAXArrays/compute_kernel.jl")
@testset "Compute Kernels" begin
@safetestset "Built-in types" include("compute_kernel.jl")
@safetestset "DataFrames" include("DataFrames/compute_kernel.jl")
@safetestset "YAXArrays" include("YAXArrays/compute_kernel.jl")
end

0 comments on commit b9d71d9

Please sign in to comment.