@@ -67,31 +67,31 @@ Metal.functional() || error("Metal.jl is not functional on this system. This is
6767@info " System information:\n " * sprint (io-> Metal. versioninfo (io))
6868
6969# register custom tests that do not correspond to files in the test directory
70- custom_tests = Dict {String, Expr} ( )
70+ testsuite = find_tests ( @__DIR__ )
7171# # GPUArrays test suite
7272import GPUArrays
7373gpuarrays = pathof (GPUArrays)
7474gpuarrays_root = dirname (dirname (gpuarrays))
7575gpuarrays_testsuite = joinpath (gpuarrays_root, " test" , " testsuite.jl" )
7676include (gpuarrays_testsuite)
7777for name in keys (TestSuite. tests)
78- custom_tests [" gpuarrays/$name " ] = :(TestSuite. tests[$ name](MtlArray))
78+ testsuite [" gpuarrays/$name " ] = :(TestSuite. tests[$ name](MtlArray))
7979end
8080
81+ args = parse_args (ARGS )
82+
8183# filter out certain tests depending on the exact testing conditions
82- function test_filter (name )
83- if Metal. DefaultStorageMode != Metal. PrivateStorage && name == " gpuarrays/indexing scalar "
84+ if filter_tests! (testsuite, args )
85+ if Metal. DefaultStorageMode != Metal. PrivateStorage
8486 # GPUArrays' scalar indexing tests assume that indexing is not supported
85- return false
87+ delete! (testsuite, " gpuarrays/indexing scalar " )
8688 end
8789
8890 # for some reason, the environment shenanigans done by the scripts only work when
8991 # invoked from the Metal.jl CI, and not from GPUArrays.jl' reverse CI
90- if get (ENV , " BUILDKITE_PIPELINE_NAME" , " " ) != " Metal.jl" && name == " scripts "
91- return false
92+ if get (ENV , " BUILDKITE_PIPELINE_NAME" , " " ) != " Metal.jl"
93+ delete! (testsuite, " scripts " )
9294 end
93-
94- return true
9595end
9696
9797# workers to run tests on
@@ -157,4 +157,4 @@ init_code = quote
157157 end
158158end
159159
160- runtests (Metal, ARGS ; custom_tests, test_filter , init_code, test_worker)
160+ runtests (Metal, args; testsuite , init_code, test_worker)
0 commit comments