Skip to content

Commit

Permalink
Modular tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill committed Jun 24, 2024
1 parent c1a2410 commit 6b25c05
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
using XAIBase
using Test
using ReferenceTests
using Aqua

using JuliaFormatter
using Aqua

@testset "XAIBase.jl" begin
@testset "Aqua.jl" begin
@info "Running Aqua.jl's auto quality assurance tests. These might print warnings from dependencies."
Aqua.test_all(XAIBase; ambiguities=false)
end
@testset "JuliaFormatter.jl" begin
@info "Running JuliaFormatter's code formatting tests."
@test format(XAIBase; verbose=false, overwrite=false)
if VERSION >= v"1.10"
@info "Testing formalities..."
@testset "Code formatting" begin
@info "- Testing code formatting with JuliaFormatter..."
@test JuliaFormatter.format(XAIBase; verbose=false, overwrite=false)
end
@testset "Aqua.jl" begin
@info "- Running Aqua.jl tests. These might print warnings from dependencies..."
Aqua.test_all(XAIBase; ambiguities=false)
end
end

@testset "API" begin
@info "Testing API..."
include("test_api.jl")
Expand Down
3 changes: 3 additions & 0 deletions test/test_api.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using XAIBase
using Test

# Create dummy analyzer to test API
struct DummyAnalyzer <: AbstractXAIMethod end
function (method::DummyAnalyzer)(input, output_selector::AbstractOutputSelector)
Expand Down
3 changes: 3 additions & 0 deletions test/test_feature_selection.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using XAIBase
using Test

@testset "Feature selectors" begin
@testset "API" begin
features = TopNFeatures(15)
Expand Down
3 changes: 3 additions & 0 deletions test/test_output_selection.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using XAIBase
using Test

using XAIBase: MaxActivationSelector, IndexSelector
using Random

Expand Down

0 comments on commit 6b25c05

Please sign in to comment.