@@ -4,42 +4,15 @@ using Pkg
44using SparseConnectivityTracer
55using Test
66
7- push! (Base . LOAD_PATH , Base . active_project () )
8- Pkg . activate (; temp = true )
9-
10- DI_PATH = joinpath ( @__DIR__ , " .. " , " .. " , " DifferentiationInterface " )
7+ # DI_PATH = joinpath(@__DIR__, "..", "..", "DifferentiationInterface" )
8+ # if isdir(DI_PATH )
9+ # Pkg.develop(; path=DI_PATH)
10+ # end
1111DIT_PATH = joinpath (@__DIR__ , " .." , " .." , " DifferentiationInterfaceTest" )
12- if isdir (DI_PATH)
13- Pkg. develop (; path= DI_PATH)
14- end
1512if isdir (DIT_PATH)
1613 Pkg. develop (; path= DIT_PATH)
1714end
1815
19- BACKENDS_1_6 = [
20- " FiniteDifferences" , #
21- " ForwardDiff" ,
22- " ReverseDiff" ,
23- " Tracker" ,
24- " Zygote" ,
25- ]
26-
27- BACKENDS_1_10 = [
28- " Diffractor" , #
29- " Enzyme" ,
30- " FiniteDiff" ,
31- " FastDifferentiation" ,
32- " PolyesterForwardDiff" ,
33- " Symbolics" ,
34- " Tapir" ,
35- ]
36-
37- @static if VERSION >= v " 1.10"
38- Pkg. add (vcat (BACKENDS_1_6, BACKENDS_1_10))
39- else
40- Pkg. add (vcat (BACKENDS_1_6))
41- end
42-
4316function MyAutoSparse (backend:: AbstractADType )
4417 coloring_algorithm = GreedyColoringAlgorithm ()
4518 sparsity_detector = TracerSparsityDetector ()
4821
4922LOGGING = get (ENV , " CI" , " false" ) == " false"
5023
24+ GROUP = get (ENV , " JULIA_DI_TEST_GROUP" , " All" )
25+
5126# # Main tests
5227
5328@testset verbose = true " DifferentiationInterface.jl" begin
54- @static if VERSION >= v " 1.10"
55- @info " Testing formalities"
56- @testset verbose = true " Formal tests" begin
57- include (" formal.jl" )
29+ if GROUP == " Formalities" || GROUP == " All"
30+ @testset " Formalities/$file " for file in readdir (joinpath (@__DIR__ , " Formalities" ))
31+ @info " Testing Formalities/$file )"
32+ include (joinpath (@__DIR__ , " Formalities" , file))
33+ end
34+ end
35+
36+ if GROUP == " Internals" || GROUP == " All"
37+ @testset " Internals/$file " for file in readdir (joinpath (@__DIR__ , " Internals" ))
38+ @info " Testing Internals/$file "
39+ include (joinpath (@__DIR__ , " Internals" , file))
5840 end
5941 end
6042
61- @testset verbose = true " $folder " for folder in [" Single" , " Double" , " Internals" ]
62- folder_path = joinpath (@__DIR__ , folder)
63- @testset verbose = true " $(file[1 : end - 3 ]) " for file in readdir (folder_path)
64- endswith (file, " .jl" ) || continue
65- if (
66- VERSION < v " 1.10" && any (
67- part == backend for part in split (file[1 : (end - 3 )], ' -' ) for
68- backend in BACKENDS_1_10
69- )
70- )
71- @info " Skipping $folder - $(file[1 : end - 3 ]) "
72- else
73- @info " Testing $folder - $(file[1 : end - 3 ]) "
74- include (joinpath (folder_path, file))
43+ if GROUP == " All"
44+ Pkg. add ([
45+ " Diffractor" ,
46+ " Enzyme" ,
47+ " FiniteDiff" ,
48+ " FiniteDifferences" ,
49+ " FastDifferentiation" ,
50+ " ForwardDiff" ,
51+ " PolyesterForwardDiff" ,
52+ " ReverseDiff" ,
53+ " Symbolics" ,
54+ " Tapir" ,
55+ " Tracker" ,
56+ " Zygote" ,
57+ ])
58+ @testset verbose = true " $folder " for folder in (" Single" , " Double" )
59+ files = filter (f -> endswith (f, " .jl" ), readdir (joinpath (@__DIR__ , folder)))
60+ @testset " $file " for file in files
61+ @info " Testing $folder /$file "
62+ include (joinpath (@__DIR__ , folder, file))
7563 end
7664 end
65+ elseif startswith (GROUP, " Single" )
66+ b1 = split (GROUP, ' /' )[2 ]
67+ @testset " Single/$b1 " begin
68+ @info " Testing Single/$b1 "
69+ Pkg. add (b1)
70+ include (joinpath (@__DIR__ , " Single" , " $b1 .jl" ))
71+ end
72+ elseif startswith (GROUP, " Double" )
73+ b1, b2 = split (split (GROUP, ' /' )[2 ], ' -' )
74+ @testset " Single/$b1 -$b2 " begin
75+ @info " Testing Double/$b1 -$b2 "
76+ Pkg. add ([b1, b2])
77+ include (joinpath (@__DIR__ , " Double" , " $b1 -$b2 .jl" ))
78+ end
7779 end
7880end ;
0 commit comments