Skip to content

Commit c384536

Browse files
authored
Apply update_template patch (#35)
1 parent aaf527c commit c384536

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Please give a summary of the tests that you added to verify your changes.
3333

3434
# Checklist:
3535

36-
- [ ] My code follows the style guidelines of this project. Please run `using JuliaFormatter; format(".")` in the base directory of the repository (`~/.julia/dev/BackendSelection`) to format your code according to our style guidelines.
36+
- [ ] 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/BackendSelection`) to format your code according to our style guidelines.
3737
- [ ] I have performed a self-review of my own code.
3838
- [ ] I have commented my code, particularly in hard-to-understand areas.
3939
- [ ] I have added tests that verify the behavior of the changes I made.

.gitignore

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
*.jl.*.cov
2-
*.jl.cov
3-
*.jl.mem
1+
*.cov
2+
*.mem
43
*.o
54
*.swp
65
.DS_Store
76
.benchmarkci
87
.tmp
98
.vscode/
10-
Manifest.toml
9+
LocalPreferences.toml
10+
Manifest*.toml
1111
benchmark/*.json
1212
dev/
13-
docs/LocalPreferences.toml
14-
docs/Manifest.toml
1513
docs/build/
1614
docs/src/index.md
17-
examples/LocalPreferences.toml
18-
test/LocalPreferences.toml

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BackendSelection"
22
uuid = "680c2d7c-f67a-4cc9-ae9c-da132b1447a5"
3-
version = "0.1.19"
3+
version = "0.1.20"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[compat]

test/runtests.jl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const pat = r"(?:--group=)(\w+)"
77
arg_id = findfirst(contains(pat), ARGS)
88
const GROUP = uppercase(
99
if isnothing(arg_id)
10-
get(ENV, "GROUP", "ALL")
10+
arg = get(ENV, "GROUP", "ALL")
11+
# For some reason `ENV["GROUP"]` is set to `""`
12+
# when running via GitHub Actions, so handle that case:
13+
arg == "" ? "ALL" : arg
1114
else
1215
only(match(pat, ARGS[arg_id]).captures)
1316
end
@@ -16,35 +19,35 @@ const GROUP = uppercase(
1619
"""
1720
match files of the form `test_*.jl`, but exclude `*setup*.jl`
1821
"""
19-
function istestfile(fn)
22+
function istestfile(path)
23+
fn = basename(path)
2024
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
2125
!contains(fn, "setup")
2226
end
2327
"""
2428
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
2529
"""
26-
function isexamplefile(fn)
30+
function isexamplefile(path)
31+
fn = basename(path)
2732
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
2833
end
2934

3035
@time begin
3136
# tests in groups based on folder structure
32-
for testgroup in filter(isdir, readdir(@__DIR__))
33-
if GROUP == "ALL" || GROUP == uppercase(testgroup)
34-
groupdir = joinpath(@__DIR__, testgroup)
35-
for file in filter(istestfile, readdir(groupdir))
36-
filename = joinpath(groupdir, file)
37-
@eval @safetestset $file begin
37+
for testgroup in filter(isdir, readdir(@__DIR__; join = true))
38+
if GROUP == "ALL" || GROUP == uppercase(basename(testgroup))
39+
for filename in filter(istestfile, readdir(testgroup; join = true))
40+
@eval @safetestset $(basename(filename)) begin
3841
include($filename)
3942
end
4043
end
4144
end
4245
end
4346

4447
# single files in top folder
45-
for file in filter(istestfile, readdir(@__DIR__))
46-
(file == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
47-
@eval @safetestset $file begin
48+
for file in filter(istestfile, readdir(@__DIR__; join = true))
49+
(basename(file) == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
50+
@eval @safetestset $(basename(file)) begin
4851
include($file)
4952
end
5053
end

0 commit comments

Comments
 (0)