https://github.com/JuliaLang/julia
Raw File
Tip revision: b5ccd0f2ef29f86e1c95f09e148793e9d3bf15ea authored by Alex Arslan on 04 October 2019, 01:57:38 UTC
Set VERSION to 1.3.0-rc3 (#33464)
Tip revision: b5ccd0f
stack_overflow.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test

# helper function for returning stderr and stdout
# from running a command (ignoring failure status)
function readchomperrors(exename::Cmd)
    out = Base.PipeEndpoint()
    err = Base.PipeEndpoint()
    p = run(exename, devnull, out, err, wait=false)
    o = @async(readchomp(out))
    e = @async(readchomp(err))
    return (success(p), fetch(o), fetch(e))
end

let exename = Base.julia_cmd()
    @show readchomperrors(`$exename -e "f() = f(); f()"`)
    @show readchomperrors(`$exename -e "f() = f(); fetch(@schedule f())"`)
end
back to top