From b2c010ba2b8f24574f0815c1dcd587fb0d598991 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 27 Aug 2020 11:44:31 -0400 Subject: [PATCH] fix ccall test for not-found library output (#37220) --- test/ccall.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/ccall.jl b/test/ccall.jl index ccb959aaad23da..d6aabe4ce8d0f6 100644 --- a/test/ccall.jl +++ b/test/ccall.jl @@ -1554,15 +1554,15 @@ let end # issue #34061 -o_file = tempname() -output = read(Cmd(`$(Base.julia_cmd()) --output-o=$o_file -e 'Base.reinit_stdio(); - f() = ccall((:dne, :does_not_exist), Cvoid, ()); - f()'`; ignorestatus=true), String) -@test occursin(output, """ -ERROR: could not load library "does_not_exist" -does_not_exist.so: cannot open shared object file: No such file or directory -""") -@test !isfile(o_file) +let o_file = tempname(), err = Base.PipeEndpoint() + run(pipeline(Cmd(`$(Base.julia_cmd()) --output-o=$o_file -e 'Base.reinit_stdio(); + f() = ccall((:dne, :does_not_exist), Cvoid, ()); + f()'`; ignorestatus=true), stderr=err), wait=false) + output = read(err, String) + @test occursin("""ERROR: could not load library "does_not_exist" + """, output) + @test !isfile(o_file) +end # pass NTuple{N,T} as Ptr{T}/Ref{T} let