Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Dec 26, 2024
1 parent e26f66a commit 6ee3750
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/setup.jl
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 6ee3750

Please sign in to comment.