Skip to content

Commit d98ca89

Browse files
authored
Merge pull request #150 from JuliaGPU/tb/cuarrays
Run CuArrays tests.
2 parents b0bbce8 + 6990e68 commit d98ca89

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

Project.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1010
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1111
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1212
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
13+
14+
[extras]
15+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
16+
17+
[targets]
18+
test = ["Pkg"]

test/runtests.jl

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
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, branch=nothing)
11+
mktempdir() do devdir
12+
withenv("JULIA_PKG_DEVDIR" => devdir) do
13+
# try to install from the same branch of GPUArrays
14+
try
15+
if branch === nothing
16+
branch = chomp(read(`git -C $(@__DIR__) rev-parse --abbrev-ref HEAD`, String))
17+
branch == "HEAD" && error("in detached HEAD state")
18+
end
19+
Pkg.add(PackageSpec(name=package, rev=String(branch)))
20+
@info "Installed $package from $branch branch"
21+
catch ex
22+
@warn "Could not install $package from same branch as GPUArrays, trying master branch" exception=ex
23+
Pkg.add(PackageSpec(name=package, rev="master"))
24+
end
25+
26+
Pkg.test(package)
27+
end
28+
end
29+
end
30+
31+
if haskey(ENV, "GITLAB_CI")
32+
branch = ENV["CI_COMMIT_REF_NAME"]
33+
@testset "CuArray" begin
34+
test_package("CuArrays", branch)
35+
end
36+
end

0 commit comments

Comments
 (0)