Skip to content

Commit

Permalink
Include generated precompile file
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 26, 2020
1 parent 48b1e5e commit 6b2ce2c
Show file tree
Hide file tree
Showing 3 changed files with 20 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
10 changes: 10 additions & 0 deletions test/modules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
## Revise-like module file detection
# works for precompiled packages
let (parentfile, included_files) = modulefiles(Atom)

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

expected = Set(atommodfiles)
actual = Set((parentfile, included_files...))
@test actual == expected
Expand All @@ -35,6 +40,11 @@

## CSTPraser-based module file detection
let included_files = normpath.(modulefiles("Atom", atomjlfile))

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

# finds all the files in Atom module except display/webio.jl
for f in atommodfiles
f == webiofile && continue
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ atomsrcdir = joinpath′(atomjldir, "src")
atomjlfile = joinpath′(atomsrcdir, "Atom.jl")
webiofile = joinpath′(atomsrcdir, "display", "webio.jl")

precompileDeactivated = !isnothing(match(r"\#(.+)include\(\"\.\.\/deps\/SnoopCompile\/precompile\/precompile_Atom\.jl\"\)", Base.read(atomjlfile, String)))
precompiledir = joinpath′(atomjldir, "deps", "SnoopCompile","precompile")


# files in `Atom` module (except files in its submodules)
atommodfiles = let
files = []
debuggerdir = joinpath′(atomsrcdir, "debugger")
profilerdir = joinpath′(atomsrcdir, "profiler")

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 +30,10 @@ atommodfiles = let
push!(files, joinpath′(d, "traceur.jl"))
continue
end
# if !precompileDeactivated
# push!(files, joinpath′(d, "precompile_Atom.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 6b2ce2c

Please sign in to comment.