Skip to content

Commit

Permalink
Fixes for tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jun 29, 2017
1 parent 3fe9af6 commit 33baae3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![Build Status](https://travis-ci.org/timholy/Revise.jl.svg?branch=master)](https://travis-ci.org/timholy/Revise.jl)

[![Build status](https://ci.appveyor.com/api/projects/status/e1xnsj4e5q9308y6/branch/master?svg=true)](https://ci.appveyor.com/project/timholy/revise-jl/branch/master)

[![codecov.io](http://codecov.io/github/timholy/Revise.jl/coverage.svg?branch=master)](http://codecov.io/github/timholy/Revise.jl?branch=master)

`Revise.jl` makes it easier to continuously update code in a running
Expand Down
12 changes: 9 additions & 3 deletions src/Revise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,9 @@ function parse_source(file::AbstractString, mod::Module, path)
end
fm = FileModules(mod, md)
if path != nothing
file2modules[file] = fm
push!(new_files, file)
nfile = normpath(file)
file2modules[nfile] = fm
push!(new_files, nfile)
end
fm
end
Expand Down Expand Up @@ -418,7 +419,12 @@ function revise_file_queued(file)
@schedule revise_file_queued(file)
end

function revise_file_now(file)
function revise_file_now(file0)
file = normpath(file0)
if !haskey(file2modules, file)
println("Revise is currently tracking the following files: ", keys(file2modules))
error(file, " is not currently being tracked.")
end
oldmd = file2modules[file]
newmd = parse_source(file, oldmd.topmod, nothing)
if newmd != nothing
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ to_remove = String[]
end

@testset "File paths" begin
testdir = tempname()
testdir = joinpath(tempdir(), randstring(10))
mkdir(testdir)
push!(to_remove, testdir)
push!(LOAD_PATH, testdir)
Expand Down Expand Up @@ -176,5 +176,7 @@ end

# These may cause warning messages about "not an existing file", but that's fine
for name in to_remove
rm(name; force=true, recursive=true)
try
rm(name; force=true, recursive=true)
end
end

0 comments on commit 33baae3

Please sign in to comment.