Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Please give a summary of the tests that you added to verify your changes.

# Checklist:

- [ ] My code follows the style guidelines of this project. Please run `using JuliaFormatter; format(".")` in the base directory of the repository (`~/.julia/dev/BlockSparseArrays`) to format your code according to our style guidelines.
- [ ] My code follows the style guidelines of this project. Please run the [ITensorFormatter](https://github.com/ITensor/ITensorFormatter.jl) in the base directory of the repository (`~/.julia/dev/BlockSparseArrays`) to format your code according to our style guidelines.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have added tests that verify the behavior of the changes I made.
Expand Down
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
*.cov
*.mem
*.o
*.swp
.DS_Store
.benchmarkci
.tmp
.vscode/
Manifest.toml
LocalPreferences.toml
Manifest*.toml
benchmark/*.json
dev/
docs/LocalPreferences.toml
docs/Manifest.toml
docs/build/
docs/src/index.md
examples/LocalPreferences.toml
test/LocalPreferences.toml
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "BlockSparseArrays"
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
version = "0.10.29"
version = "0.10.30"
authors = ["ITensor developers <support@itensor.org> and contributors"]

[workspace]
Expand Down
27 changes: 15 additions & 12 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const pat = r"(?:--group=)(\w+)"
arg_id = findfirst(contains(pat), ARGS)
const GROUP = uppercase(
if isnothing(arg_id)
get(ENV, "GROUP", "ALL")
arg = get(ENV, "GROUP", "ALL")
# For some reason `ENV["GROUP"]` is set to `""`
# when running via GitHub Actions, so handle that case:
arg == "" ? "ALL" : arg
else
only(match(pat, ARGS[arg_id]).captures)
end
Expand All @@ -16,35 +19,35 @@ const GROUP = uppercase(
"""
match files of the form `test_*.jl`, but exclude `*setup*.jl`
"""
function istestfile(fn)
function istestfile(path)
fn = basename(path)
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
!contains(fn, "setup")
end
"""
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
"""
function isexamplefile(fn)
function isexamplefile(path)
fn = basename(path)
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
end

@time begin
# tests in groups based on folder structure
for testgroup in filter(isdir, readdir(@__DIR__))
if GROUP == "ALL" || GROUP == uppercase(testgroup)
groupdir = joinpath(@__DIR__, testgroup)
for file in filter(istestfile, readdir(groupdir))
filename = joinpath(groupdir, file)
@eval @safetestset $file begin
for testgroup in filter(isdir, readdir(@__DIR__; join = true))
if GROUP == "ALL" || GROUP == uppercase(basename(testgroup))
for filename in filter(istestfile, readdir(testgroup; join = true))
@eval @safetestset $(basename(filename)) begin
include($filename)
end
end
end
end

# single files in top folder
for file in filter(istestfile, readdir(@__DIR__))
(file == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
@eval @safetestset $file begin
for file in filter(istestfile, readdir(@__DIR__; join = true))
(basename(file) == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
@eval @safetestset $(basename(file)) begin
include($file)
end
end
Expand Down
Loading