Skip to content

Commit

Permalink
show output if test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Nov 12, 2023
1 parent 35a4813 commit f6cb684
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,19 @@ end

@testset "julia_cmd" begin
julia_basic = Base.julia_cmd()
function get_julia_cmd(arg)
io = Base.BufferStream()
cmd = `$julia_basic $arg -e 'print(repr(Base.julia_cmd()))'`
try
run(pipeline(cmd, stdout=io, stderr=io))
catch
@error "cmd failed" cmd read(io, String)
rethrow()
end
return read(io, String)
end

opts = Base.JLOptions()
get_julia_cmd(arg) = strip(read(`$julia_basic $arg -e 'print(repr(Base.julia_cmd()))'`, String), ['`'])

for (arg, default) in (
("-C$(unsafe_string(opts.cpu_target))", false),
Expand Down

0 comments on commit f6cb684

Please sign in to comment.