Skip to content

Commit

Permalink
test/compile test warning from subprocess (#21585)
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy authored and tkelman committed Apr 29, 2017
1 parent 1ae1b79 commit 41376e2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/compile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,26 @@ let dir = mktempdir()
"""

exename = `$(Base.julia_cmd()) --startup-file=no`
@test readchomp(`$exename -E $(testcode)`) == "nothing"
@test readchomp(`$exename -E $(testcode)`) == "nothing"
let fname = tempname()
try
@test readchomp(pipeline(`$exename -E $(testcode)`, stderr=fname)) == "nothing"
@test Test.ismatch_warn("WARNING: replacing module $Test_module.\n", readstring(fname))
finally
rm(fname, force=true)
end
end
# Loading $Test_module from the cache should not bring `Base.Iterators`
# into `Main`, since that would lead to a namespace conflict with
# the module `Iterators` defined above.
let fname = tempname()
try
@test readchomp(pipeline(`$exename -E $(testcode)`, stderr=fname)) == "nothing"
# e.g `@test_nowarn`
@test Test.ismatch_warn(r"^(?!.)"s, readstring(fname))
finally
rm(fname, force=true)
end
end
finally
rm(dir, recursive=true)
end
Expand Down

0 comments on commit 41376e2

Please sign in to comment.