Skip to content

Commit

Permalink
Disable certain spawn tests under Valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Feb 19, 2015
1 parent 8756f4c commit 22b5a61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ wait(p)

ccall(:close,Cint,(Cint,),fds)
output = readall(master)
@test output == "julia> 1\r\nquit()\r\n1\r\n\r\njulia> "
if ccall(:jl_running_on_valgrind,Cint,()) == 0
@test output == "julia> 1\r\nquit()\r\n1\r\n\r\njulia> "
end
close(master)

end
Expand Down
15 changes: 13 additions & 2 deletions test/spawn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#TODO:
# - Windows:
# - Add a test whether coreutils are available and skip tests if not

valgrind_off = ccall(:jl_running_on_valgrind,Cint,()) == 0

yes = `perl -le 'while (1) {print STDOUT "y"}'`

#### Examples used in the manual ####
Expand Down Expand Up @@ -38,7 +41,11 @@ begin
kill(p)
end

@test_throws Base.UVError run(`foo_is_not_a_valid_command`)
if valgrind_off
# If --trace-children=yes is passed to valgrind, valgrind will
# exit here with an error code, and no UVError will be raised.
@test_throws Base.UVError run(`foo_is_not_a_valid_command`)
end

if false
prefixer(prefix, sleep) = `perl -nle '$|=1; print "'$prefix' ", $_; sleep '$sleep';'`
Expand Down Expand Up @@ -154,7 +161,11 @@ close(sock)

# issue #4535
exename=joinpath(JULIA_HOME,(ccall(:jl_is_debugbuild,Cint,())==0?"julia":"julia-debug"))
@test readall(pipe(`$exename -f -e 'println(STDERR,"Hello World")'`, stderr=`cat`)) == "Hello World\n"
if valgrind_off
# If --trace-children=yes is passed to valgrind, we will get a
# valgrind banner here, not "Hello World\n".
@test readall(pipe(`$exename -f -e 'println(STDERR,"Hello World")'`, stderr=`cat`)) == "Hello World\n"
end

# issue #6310
@test readall(pipe(`echo "2+2"`, `$exename -f`)) == "4\n"
Expand Down

0 comments on commit 22b5a61

Please sign in to comment.