Skip to content

Commit aa74feb

Browse files
committed
Minor
1 parent d8ae05d commit aa74feb

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ jobs:
4242
arch: ${{ matrix.arch }}
4343
- uses: julia-actions/cache@v2
4444
- uses: julia-actions/julia-buildpkg@v1
45-
- run: cd test/; julia --project=.. --color=yes --check-bounds=yes ${{ matrix.test_set.files }}
45+
- run: |
46+
cd test/
47+
julia --project=.. maketests.jl
48+
julia --project=.. --color=yes --check-bounds=yes ${{ matrix.test_set.files }}
4649
docs:
4750
name: Documentation
4851
runs-on: ubuntu-latest

test/maketests.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Tutorials
2+
using Test
3+
4+
function get_title(files,filename)
5+
for (title,fn) in files
6+
if fn == filename
7+
return title
8+
end
9+
end
10+
error("File $filename not found!")
11+
end
12+
13+
if (length(ARGS) != 0)
14+
files = [get_title(Tutorials.files,filename)=>filename for filename in ARGS]
15+
else
16+
files = Tutorials.files
17+
end
18+
19+
for (title,filename) in files
20+
# Create temporal modules to isolate and protect test scopes
21+
tmpdir = mktempdir(;cleanup=true)
22+
tmpmod = split(filename,".")[1]
23+
tmpfile = joinpath(tmpdir,tmpmod)
24+
isfile(tmpfile) && error("File $tmpfile already exists!")
25+
testpath = joinpath(@__DIR__,"../src", filename)
26+
open(tmpfile,"w") do f
27+
println(f, "# This file is automatically generated")
28+
println(f, "# Do not edit")
29+
println(f)
30+
println(f, "module $tmpmod include(\"$testpath\") end")
31+
end
32+
# @time @testset "$title" begin include(tmpfile) end
33+
end

0 commit comments

Comments
 (0)