From 6ee375094ca022c78157bda7ef1afeb44fdeac12 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:31:20 -0500 Subject: [PATCH] Test --- test/setup.jl | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/setup.jl b/test/setup.jl index af968338..611d048c 100644 --- a/test/setup.jl +++ b/test/setup.jl @@ -1,8 +1,23 @@ using Distributed, Test, Metal, Adapt, ObjectiveC, ObjectiveC.Foundation +# TODO: REMOVE BEFORE MERGING +Sys.isapple() && @info "Architecture: $(read(`xcrun metal-arch`, String))" + # Quit without erroring if Metal loaded without issues on unsupported platforms -if Sys.isapple() && !startswith(read(`xcrun metal-arch`, String), "applegpu") || !Sys.isapple() - @info "Metal.jl succesfully loaded on unsupported system." +if !Sys.isapple() + @info """Metal.jl succesfully loaded on non-macOS system. + Skipping tests.""" + Sys.exit() +else # if Sys.isapple() + archchecker = occursin(read(`xcrun metal-arch`, String)) + @info "testing the continue works to exit if statements like with for loops" + if archchecker("Paravirtual") # Virtualized graphics (probably Github Actions runners) + @info """Metal.jl succesfully loaded on macOS system with unsupported Paravirtual graphics. + Skipping tests.""" + elseif !archchecker("applegpu") # Every other unsupported system (Intel or AMD graphics) + @info """Metal.jl succesfully loaded on macOS system with unsupported graphics. + Skipping tests.""" + end Sys.exit() end