Skip to content

Commit adf2dad

Browse files
maleadtvchuravy
authored andcommitted
Run CuArrays tests.
1 parent b0bbce8 commit adf2dad

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

test/runtests.jl

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
using GPUArrays, Test
22
using GPUArrays.TestSuite
33

4+
using Pkg
45

5-
@testset "Julia reference implementation:" begin
6+
@testset "JLArray" begin
67
GPUArrays.test(JLArray)
78
end
9+
10+
function test_package(package)
11+
mktempdir() do devdir
12+
withenv("JULIA_PKG_DEVDIR" => devdir) do
13+
# try to install from the same branch of GPUArrays
14+
try
15+
branch = chomp(read(`git -C $(@__DIR__) rev-parse --abbrev-ref HEAD`, String))
16+
Pkg.add(PackageSpec(name=package, rev=String(branch)))
17+
@info "Installed $package from $branch branch"
18+
catch ex
19+
@warn "Could not install $package from same branch as GPUArrays, trying master branch" exception=ex
20+
Pkg.add(PackageSpec(name=package, rev="master"))
21+
end
22+
23+
Pkg.test(package)
24+
end
25+
end
26+
end
27+
28+
if haskey(ENV, "GITLAB_CI")
29+
@testset "CuArray" begin
30+
test_package("CuArrays")
31+
end
32+
end

0 commit comments

Comments
 (0)