From ccc2557b8c29d7ed170a8b8434de4790785d8808 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:31:00 +0200 Subject: [PATCH] Put each test file in a testset --- test/runtests.jl | 131 ++++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 358d730..5dc605c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,60 +2,85 @@ using Test const TESTDIR = dirname(@__FILE__) -test_println(kind, f, pad = " ") = println(pad, "testing $(kind): `$(f)`...") +test_println(kind, f, pad=" ") = println(pad, "testing $(kind): `$(f)`...") @testset "ReverseDiff" begin -println("running TapeTests...") -t = @elapsed include(joinpath(TESTDIR, "TapeTests.jl")) -println("done (took $t seconds).") - -println("running TrackedTests...") -t = @elapsed include(joinpath(TESTDIR, "TrackedTests.jl")) -println("done (took $t seconds).") - -println("running MacrosTests...") -t = @elapsed include(joinpath(TESTDIR, "MacrosTests.jl")) -println("done (took $t seconds).") - -println("running ChainRulesTests...") -t = @elapsed include(joinpath(TESTDIR, "ChainRulesTests.jl")) -println("done (took $t seconds).") - -println("running ScalarTests...") -t = @elapsed include(joinpath(TESTDIR, "derivatives/ScalarTests.jl")) -println("done (took $t seconds).") - -println("running LinAlgTests...") -t = @elapsed include(joinpath(TESTDIR, "derivatives/LinAlgTests.jl")) -println("done (took $t seconds).") - -println("running ElementwiseTests...") -t = @elapsed include(joinpath(TESTDIR, "derivatives/ElementwiseTests.jl")) -println("done (took $t seconds).") - -println("running ArrayFunctionTests...") -t = @elapsed include(joinpath(TESTDIR, "derivatives/ArrayFunctionTests.jl")) -println("done (took $t seconds).") - -println("running GradientTests...") -t = @elapsed include(joinpath(TESTDIR, "api/GradientTests.jl")) -println("done (took $t seconds).") - -println("running JacobianTests...") -t = @elapsed include(joinpath(TESTDIR, "api/JacobianTests.jl")) -println("done (took $t seconds).") - -println("running HessianTests...") -t = @elapsed include(joinpath(TESTDIR, "api/HessianTests.jl")) -println("done (took $t seconds).") - -println("running ConfigTests...") -t = @elapsed include(joinpath(TESTDIR, "api/ConfigTests.jl")) -println("done (took $t seconds).") - -println("running CompatTests...") -t = @elapsed include(joinpath(TESTDIR, "compat/CompatTests.jl")) -println("done (took $t seconds).") - + @testset "TapeTests" begin + println("running TapeTests...") + t = @elapsed include(joinpath(TESTDIR, "TapeTests.jl")) + println("done (took $t seconds).") + end + + @testset "TrackedTests" begin + println("running TrackedTests...") + t = @elapsed include(joinpath(TESTDIR, "TrackedTests.jl")) + println("done (took $t seconds).") + end + + @testset "MacrosTests" begin + println("running MacrosTests...") + t = @elapsed include(joinpath(TESTDIR, "MacrosTests.jl")) + println("done (took $t seconds).") + end + + @testset "ChainRulesTests" begin + println("running ChainRulesTests...") + t = @elapsed include(joinpath(TESTDIR, "ChainRulesTests.jl")) + println("done (took $t seconds).") + end + + @testset "ScalarTests" begin + println("running ScalarTests...") + t = @elapsed include(joinpath(TESTDIR, "derivatives/ScalarTests.jl")) + println("done (took $t seconds).") + end + + @testset "LinAlgTests" begin + println("running LinAlgTests...") + t = @elapsed include(joinpath(TESTDIR, "derivatives/LinAlgTests.jl")) + println("done (took $t seconds).") + end + + @testset "ElementWiseTests" begin + println("running ElementwiseTests...") + t = @elapsed include(joinpath(TESTDIR, "derivatives/ElementwiseTests.jl")) + println("done (took $t seconds).") + end + + @testset "ArrayFunctionTests" begin + println("running ArrayFunctionTests...") + t = @elapsed include(joinpath(TESTDIR, "derivatives/ArrayFunctionTests.jl")) + println("done (took $t seconds).") + end + + @testset "GradientTests" begin + println("running GradientTests...") + t = @elapsed include(joinpath(TESTDIR, "api/GradientTests.jl")) + println("done (took $t seconds).") + end + + @testset "JacobianTests" begin + println("running JacobianTests...") + t = @elapsed include(joinpath(TESTDIR, "api/JacobianTests.jl")) + println("done (took $t seconds).") + end + + @testset "HessianTests" begin + println("running HessianTests...") + t = @elapsed include(joinpath(TESTDIR, "api/HessianTests.jl")) + println("done (took $t seconds).") + end + + @testset "ConfigTests" begin + println("running ConfigTests...") + t = @elapsed include(joinpath(TESTDIR, "api/ConfigTests.jl")) + println("done (took $t seconds).") + end + + @testset "CompatTests" begin + println("running CompatTests...") + t = @elapsed include(joinpath(TESTDIR, "compat/CompatTests.jl")) + println("done (took $t seconds).") + end end