Skip to content

Commit

Permalink
add precompile to files to atommodfiles when precompile is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 26, 2020
1 parent f730042 commit 9858ffd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/SnoopCompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: julia --project -e 'using Pkg; Pkg.instantiate();'
- name : Add SnoopCompile and current package
run: julia -e 'using Pkg; Pkg.add(PackageSpec(url = "https://github.com/aminya/SnoopCompile.jl", rev ="blacklist_snoopi")); Pkg.develop(PackageSpec(; path=pwd()));'
run: julia -e 'using Pkg; Pkg.add(PackageSpec(url = "https://github.com/timholy/SnoopCompile.jl", rev ="master")); Pkg.develop(PackageSpec(; path=pwd()));'
- name: Install Test dependencies
run: julia -e 'using SnoopCompile; SnoopCompile.addtestdep()'
- name: Generating precompile files
Expand Down
4 changes: 4 additions & 0 deletions test/modules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
let (parentfile, included_files) = modulefiles(Atom)
expected = Set(atommodfiles)
actual = Set((parentfile, included_files...))

println(expected)
println(actual)

@test actual == expected

# can't detect display/webio.jl
Expand Down
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ atomsrcdir = joinpath′(atomjldir, "src")
atomjlfile = joinpath′(atomsrcdir, "Atom.jl")
webiofile = joinpath′(atomsrcdir, "display", "webio.jl")



# files in `Atom` module (except files in its submodules)
atommodfiles = let
files = []
debuggerdir = joinpath′(atomsrcdir, "debugger")
profilerdir = joinpath′(atomsrcdir, "profiler")
precompileDeactivated = !isnothing(match(r"\#(.?)include\(\"\.\.\/deps\/SnoopCompile\/precompile\/precompile_Atom\.jl\"\)", Base.read(atomjlfile, String)))
precompiledir = joinpath′(atomjldir, "deps", "SnoopCompile","precompile")

if !precompileDeactivated
push!(files, joinpath′(precompiledir, "precompile_Atom.jl"))
end

for (d, ds, fs) in walkdir(atomsrcdir)
# NOTE: update directories below when you create an new submodule
# the 2 files below are in Atom module
Expand All @@ -25,6 +34,7 @@ atommodfiles = let
push!(files, joinpath′(d, "traceur.jl"))
continue
end

for f in fs
# NOTE: currently both Revise-like and CSTPraser-based approach fails
# to detect display/webio.jl as a file in Atom module
Expand Down

0 comments on commit 9858ffd

Please sign in to comment.