Skip to content

Commit b5233e2

Browse files
authored
Re-enable profiling tests on M1/14.4 when using Xcode 15.3. (#322)
1 parent 68311b2 commit b5233e2

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

test/profiling.jl

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
@testset "profiling" begin
22

3-
if MTL.is_m1(current_device()) && macos_version() >= v"14.4"
4-
@warn "Skipping profiling tests because of an M1-related bug on macOS 14.4"
3+
# determine if we can even run these tests
4+
run_tests = false
5+
if parse(Bool, get(ENV, "CI", "false"))
6+
@warn "Skipping profiling tests on CI due to sandboxing issues"
7+
elseif !success(`xctrace version`)
8+
@warn "Skipping profiling tests because xctrace is not available; please install Xcode first"
59
else
10+
version_output = chomp(read(`xctrace version`, String))
11+
m = match(r"xctrace version (\d+).(\d+)", version_output)
12+
if m === nothing
13+
error("Could not parse xctrace version output:\n$version_output")
14+
else
15+
xcode_version = VersionNumber(parse(Int, m.captures[1]), parse(Int, m.captures[2]))
16+
if MTL.is_m1(current_device()) && macos_version() >= v"14.4" && xcode_version < v"15.3"
17+
@warn "Skipping profiling tests because of an M1-related bug on macOS 14.4 and Xcode < 15.3; please upgrade Xcode first"
18+
else
19+
run_tests = true
20+
end
21+
end
22+
end
623

24+
if run_tests
725
mktempdir() do tmpdir
826
cd(tmpdir) do
927

10-
if parse(Bool, get(ENV, "CI", "false"))
11-
@warn "Skipping profiling tests on CI due to sandboxing issues"
12-
else
13-
1428
@testset "macro" begin
1529
Metal.@profile identity(nothing)
1630
@test isdir("julia_1.trace")
1731
end
1832

1933
end
20-
21-
end
22-
2334
end
2435
end
36+
2537
end

0 commit comments

Comments
 (0)