From d46a4c642d830b1bd7747c3f4f874dbefed36a25 Mon Sep 17 00:00:00 2001 From: Frankie Robertson Date: Sat, 3 Aug 2024 00:21:45 +0300 Subject: [PATCH] Add JuliaFormatter and JET to tests --- Project.toml | 6 +++++- test/format.jl | 8 ++++++++ test/jet.jl | 15 +++++++++++++++ test/runtests.jl | 6 +----- test/tests_top.jl | 13 +++++++++++++ 5 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 test/format.jl create mode 100644 test/jet.jl create mode 100644 test/tests_top.jl diff --git a/Project.toml b/Project.toml index 9ca95b1..7763bef 100644 --- a/Project.toml +++ b/Project.toml @@ -23,6 +23,8 @@ Distributions = "0.25.76" DocStringExtensions = "^0.9" FillArrays = "1" FittedItemBanks = "^0.3.0, ^0.4.0, ^0.5.0, ^0.6.0" +JET = "0.9.7" +JuliaFormatter = "1.0.59" Makie = "^0.18.0, ^0.19.0, ^0.20.0, ^0.21.0" PsychometricsBazaarBase = "^0.6, ^0.7" XUnit = "^1.1.6" @@ -30,7 +32,9 @@ julia = "^1.8" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" XUnit = "3e3c03f2-1a94-11e9-2981-050a4ca824ab" [targets] -test = ["Aqua", "XUnit"] +test = ["Aqua", "JET", "JuliaFormatter", "XUnit"] diff --git a/test/format.jl b/test/format.jl new file mode 100644 index 0000000..4c31e53 --- /dev/null +++ b/test/format.jl @@ -0,0 +1,8 @@ +using JuliaFormatter +using AdaptiveTestPlots + +@testcase "format" begin + dir = pkgdir(AdaptiveTestPlots) + @test format(dir * "/src"; overwrite = false) + @test format(dir * "/test"; overwrite = false) +end diff --git a/test/jet.jl b/test/jet.jl new file mode 100644 index 0000000..03f7c7f --- /dev/null +++ b/test/jet.jl @@ -0,0 +1,15 @@ +using JET +using AdaptiveTestPlots + +@testset "JET checks" begin + rep = report_package( + AdaptiveTestPlots; + target_modules = ( + AdaptiveTestPlots, + ), + mode = :typo + ) + @show rep + @test length(JET.get_reports(rep)) <= 0 + #@test_broken length(JET.get_reports(rep)) == 0 +end diff --git a/test/runtests.jl b/test/runtests.jl index 2cd2704..0c8ca81 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,3 @@ using XUnit -@testset runner=ParallelTestRunner() xml_report=true "top" begin - @testset "aqua" begin - include("./aqua.jl") - end -end +runtests("tests_top.jl", ARGS...) diff --git a/test/tests_top.jl b/test/tests_top.jl new file mode 100644 index 0000000..8c94f29 --- /dev/null +++ b/test/tests_top.jl @@ -0,0 +1,13 @@ +using XUnit + +@testset "aqua" begin + include("./aqua.jl") +end + +@testset "jet" begin + include("./jet.jl") +end + +@testset "format" begin + include("./format.jl") +end