-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to TestItems for test setup (#15)
* switch to TestItems for test setup * verbose test output * remove hack * rename setup.jl to verify_tiling.jl
- Loading branch information
1 parent
6ab2329
commit 353990e
Showing
7 changed files
with
52 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
[deps] | ||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | ||
AztecDiamonds = "8762d9c5-fcab-4007-8fd1-c6de73397726" | ||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | ||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,11 @@ | ||
using AztecDiamonds | ||
using AztecDiamonds: inds, NONE, UP, RIGHT | ||
using Test | ||
using TestItemRunner, CUDA | ||
|
||
function verify_tiling(t::Tiling) | ||
(; N, x) = t | ||
for (i, j) in Iterators.product(inds(N)...) | ||
if checkbounds(Bool, t, i, j) | ||
if t[i, j] == NONE && get(t, (i-1, j), NONE) != UP && get(t, (i, j-1), NONE) != RIGHT | ||
error("Square ($i, $j) is not covered by any tile!") | ||
end | ||
else | ||
if x[i, j] != NONE | ||
error("Square ($i, $j) should be empty, is $(x[i, j])") | ||
end | ||
if get(x, CartesianIndex(i-1, j), NONE) == UP | ||
error("Square ($i, $j) should be empty, is covered from below by ($(i-1), $j)") | ||
end | ||
if get(x, CartesianIndex(i, j-1), NONE) == RIGHT | ||
error("Square ($i, $j) should be empty, is covered from the left by ($i, $(j-1))") | ||
end | ||
end | ||
end | ||
return true | ||
end | ||
|
||
using CUDA | ||
iscuda((; tags)) = :cuda in tags | ||
|
||
if !(haskey(ENV, "BUILDKITE") && CUDA.functional()) # skip non-gpu tests on Buildkite CI | ||
include("core.jl") | ||
include("show.jl") | ||
include("makie.jl") | ||
@run_package_tests filter=!iscuda verbose=true | ||
end | ||
|
||
if CUDA.functional() | ||
include("cuda.jl") | ||
@run_package_tests filter=iscuda verbose=true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using AztecDiamonds: inds, NONE, UP, RIGHT | ||
|
||
function verify_tiling(t::Tiling) | ||
(; N, x) = t | ||
for (i, j) in Iterators.product(inds(N)...) | ||
if checkbounds(Bool, t, i, j) | ||
if t[i, j] == NONE && get(t, (i-1, j), NONE) != UP && get(t, (i, j-1), NONE) != RIGHT | ||
error("Square ($i, $j) is not covered by any tile!") | ||
end | ||
else | ||
if x[i, j] != NONE | ||
error("Square ($i, $j) should be empty, is $(x[i, j])") | ||
end | ||
if get(x, CartesianIndex(i-1, j), NONE) == UP | ||
error("Square ($i, $j) should be empty, is covered from below by ($(i-1), $j)") | ||
end | ||
if get(x, CartesianIndex(i, j-1), NONE) == RIGHT | ||
error("Square ($i, $j) should be empty, is covered from the left by ($i, $(j-1))") | ||
end | ||
end | ||
end | ||
return true | ||
end |