swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: 60cb4a56a6accb7ffa2a4c5bbcf3a59ccbb1ef40 authored by Dilum Aluthge on 21 February 2022, 07:05:17 UTC
Append an `@vendored` entry to the end of the default `LOAD_PATH` that expands to `$(Sys.BINDIR)/../share/julia/vendored/v$(VERSION.major).$(VERSION.minor)`
Tip revision: 60cb4a5
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(@async f())"`)
end
back to top