@@ -22,55 +22,58 @@ union!(JuliaInterpreter.compiled_modules, Any[Base, Base.Broadcast, Compat, Line
22
22
23
23
Random. seed! (1 ) # Set seed that all testsets should reset to.
24
24
25
- function include_test (path:: String )
26
- println (" Testing $path :" ) # print so TravisCI doesn't timeout due to no output
27
- @time Base. include (@__MODULE__ (), path) do ex
28
- Meta. isexpr (ex, :macrocall ) && ex. args[1 ] == Symbol (" @testset" ) || return ex
29
- return :(@interpret (() -> $ ex)()) # interpret testsets using JuliaInterpreter
25
+ function include_test (path)
26
+ if isempty (ARGS ) || any (occursin (a, path) for a in ARGS )
27
+ println (" Testing $path :" ) # print so TravisCI doesn't timeout due to no output
28
+ @time Base. include (@__MODULE__ (), path) do ex
29
+ Meta. isexpr (ex, :macrocall ) && ex. args[1 ] == Symbol (" @testset" ) || return ex
30
+ return :(@interpret (() -> $ ex)()) # interpret testsets using JuliaInterpreter
31
+ end
32
+ else
33
+ # If you provide ARGS like so, then it runs only matching testsets:
34
+ # Pkg.test("ChainRules", test_args = ["index", "LinearAlgebra"])
35
+ println (" (Not testing $path )" )
30
36
end
31
37
end
32
38
33
- println (" Testing ChainRules.jl" )
34
- @testset " ChainRules" begin
35
- include_test (" test_helpers.jl" )
39
+ if isempty (ARGS )
40
+ println (" Testing ChainRules.jl" )
41
+ else
42
+ println (" Testing ChainRules.jl with test_args = " , ARGS )
43
+ end
44
+
45
+ @testset " ChainRules" begin # One overall @testset ensures it keeps going after failures
46
+ include (" test_helpers.jl" )
36
47
println ()
37
- @testset " rulesets" begin
38
- @testset " Core" begin
39
- include_test (" rulesets/Core/core.jl" )
40
- end
41
48
42
- @testset " Base" begin
43
- include_test (" rulesets/Base/base.jl" )
44
- include_test (" rulesets/Base/fastmath_able.jl" )
45
- include_test (" rulesets/Base/evalpoly.jl" )
46
- include_test (" rulesets/Base/array.jl" )
47
- include_test (" rulesets/Base/arraymath.jl" )
48
- include_test (" rulesets/Base/indexing.jl" )
49
- include_test (" rulesets/Base/mapreduce.jl" )
50
- include_test (" rulesets/Base/sort.jl" )
51
- end
52
- println ()
49
+ # Each file puts all tests inside one or more @testset blocks
50
+ include_test (" rulesets/Base/base.jl" )
51
+ include_test (" rulesets/Base/fastmath_able.jl" )
52
+ include_test (" rulesets/Base/evalpoly.jl" )
53
+ include_test (" rulesets/Base/array.jl" )
54
+ include_test (" rulesets/Base/arraymath.jl" )
55
+ include_test (" rulesets/Base/indexing.jl" )
56
+ include_test (" rulesets/Base/mapreduce.jl" )
57
+ include_test (" rulesets/Base/sort.jl" )
53
58
54
- @testset " Statistics" begin
55
- include_test (" rulesets/Statistics/statistics.jl" )
56
- end
57
- println ()
59
+ println ()
58
60
59
- @testset " LinearAlgebra" begin
60
- include_test (" rulesets/LinearAlgebra/dense.jl" )
61
- include_test (" rulesets/LinearAlgebra/norm.jl" )
62
- include_test (" rulesets/LinearAlgebra/matfun.jl" )
63
- include_test (" rulesets/LinearAlgebra/structured.jl" )
64
- include_test (" rulesets/LinearAlgebra/symmetric.jl" )
65
- include_test (" rulesets/LinearAlgebra/factorization.jl" )
66
- include_test (" rulesets/LinearAlgebra/blas.jl" )
67
- include_test (" rulesets/LinearAlgebra/lapack.jl" )
68
- end
69
- println ()
61
+ include_test (" rulesets/Statistics/statistics.jl" )
70
62
71
- @testset " Random" begin
72
- include_test (" rulesets/Random/random.jl" )
73
- end
74
- println ()
75
- end
63
+ println ()
64
+
65
+ include_test (" rulesets/LinearAlgebra/dense.jl" )
66
+ include_test (" rulesets/LinearAlgebra/norm.jl" )
67
+ include_test (" rulesets/LinearAlgebra/matfun.jl" )
68
+ include_test (" rulesets/LinearAlgebra/structured.jl" )
69
+ include_test (" rulesets/LinearAlgebra/symmetric.jl" )
70
+ include_test (" rulesets/LinearAlgebra/factorization.jl" )
71
+ include_test (" rulesets/LinearAlgebra/blas.jl" )
72
+ include_test (" rulesets/LinearAlgebra/lapack.jl" )
73
+
74
+ println ()
75
+
76
+ include_test (" rulesets/Random/random.jl" )
77
+
78
+ println ()
76
79
end
0 commit comments