Skip to content

Commit

Permalink
Fix and test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Nov 21, 2024
1 parent b99229f commit b67ad4d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ITensorPkgSkeleton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ function change_branch_name(path, branch_name)
return nothing
end

function generate(pkg_name)
# TODO: Use `joinpath(first(DEPOT_PATH), "dev", pkg_name)`?
pkg_path = joinpath(homedir(), ".julia", "dev", pkg_name)
function default_path()
# TODO: Use something like `joinpath(first(DEPOT_PATH), "dev", pkg_name)`
# to make it more general.
return joinpath(homedir(), ".julia", "dev")
end

function generate(pkg_name; path=default_path())
pkg_path = joinpath(path, pkg_name)
# TODO: Turn this into a keyword argument.
template_dir = joinpath(pkgdir(ITensorPkgSkeleton), "templates", "default")

branch_name = default_branch_name()
Expand Down
8 changes: 8 additions & 0 deletions templates/default/test/test_basics.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@eval module $(gensym())
using {PKGNAME}: {PKGNAME}
using Test: @test, @testset

@testset "{PKGNAME}" begin
# Tests go here.
end
end
15 changes: 15 additions & 0 deletions test/test_basics.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@eval module $(gensym())
using ITensorPkgSkeleton: ITensorPkgSkeleton
using Test: @test, @testset

@testset "ITensorPkgSkeleton" begin
path = tempdir()
@test isnothing(ITensorPkgSkeleton.generate("NewPkg"; path))
@test isdir(joinpath(path, "NewPkg"))
@test isdir(joinpath(path, "NewPkg", ".github"))
@test isdir(joinpath(path, "NewPkg", "benchmark"))
@test isdir(joinpath(path, "NewPkg", "docs"))
@test isdir(joinpath(path, "NewPkg", "src"))
@test isdir(joinpath(path, "NewPkg", "test"))
end
end

0 comments on commit b67ad4d

Please sign in to comment.