Skip to content

Commit 47ca527

Browse files
authored
Fix shared runtests when there are nested includes (#117)
1 parent 2feb46c commit 47ca527

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ITensorPkgSkeleton"
22
uuid = "3d388ab1-018a-49f4-ae50-18094d5f71ea"
3-
version = "0.3.41"
3+
version = "0.3.42"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[workspace]

src/ITensorPkgSkeleton.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,14 @@ function _run_isolated_testfile(
136136
)
137137
mod = Module(gensym(:SafeTestset))
138138
Core.eval(mod, :(using Test))
139+
# Module(...) does not define one-argument include(path), so nested includes in
140+
# test files would fail without adding this method.
141+
Core.eval(mod, :(include(path) = Base.include($mod, path)))
139142
return Core.eval(
140143
mod,
141144
quote
142145
@testset $label begin
143-
Base.include($mod, $path)
146+
include($path)
144147
end
145148
end
146149
)

0 commit comments

Comments
 (0)