Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorPkgSkeleton"
uuid = "3d388ab1-018a-49f4-ae50-18094d5f71ea"
authors = ["ITensor developers <support@itensor.org> and contributors"]
version = "0.3.21"
version = "0.3.22"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ This step is only required once.
```julia
julia> using Pkg: Pkg

julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
julia> Pkg.Registry.add(url = "https://github.com/ITensor/ITensorRegistry")
```
or:
```julia
julia> Pkg.Registry.add(url="git@github.com:ITensor/ITensorRegistry.git")
julia> Pkg.Registry.add(url = "git@github.com:ITensor/ITensorRegistry.git")
```
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.

Expand Down
4 changes: 2 additions & 2 deletions examples/README.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
```julia
julia> using Pkg: Pkg
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
julia> Pkg.Registry.add(url = "https://github.com/ITensor/ITensorRegistry")
```
=#
# or:
#=
```julia
julia> Pkg.Registry.add(url="git@github.com:ITensor/ITensorRegistry.git")
julia> Pkg.Registry.add(url = "git@github.com:ITensor/ITensorRegistry.git")
```
=#
# if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
Expand Down
4 changes: 2 additions & 2 deletions src/ITensorPkgSkeleton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ function pkg_registration_message(; pkgname, path)
```julia
julia> using Pkg: Pkg
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
julia> Pkg.Registry.add(url = "https://github.com/ITensor/ITensorRegistry")
```
or:
```julia
julia> Pkg.Registry.add(url="git@github.com:ITensor/ITensorRegistry.git")
julia> Pkg.Registry.add(url = "git@github.com:ITensor/ITensorRegistry.git")
```
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
Expand Down
4 changes: 2 additions & 2 deletions templates/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ This step is only required once.
```julia
julia> using Pkg: Pkg

julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
julia> Pkg.Registry.add(url = "https://github.com/ITensor/ITensorRegistry")
```
or:
```julia
julia> Pkg.Registry.add(url="git@github.com:ITensor/ITensorRegistry.git")
julia> Pkg.Registry.add(url = "git@github.com:ITensor/ITensorRegistry.git")
```
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.

Expand Down
28 changes: 16 additions & 12 deletions templates/test/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,47 @@ using Suppressor: Suppressor

# check for filtered groups
# either via `--group=ALL` or through ENV["GROUP"]

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,
)

"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
File renamed without changes.
28 changes: 16 additions & 12 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,47 @@ using Suppressor: Suppressor

# check for filtered groups
# either via `--group=ALL` or through ENV["GROUP"]

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,
)

"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