Skip to content

Commit

Permalink
Display STDOUT from Pkg.build
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Sep 6, 2017
1 parent f32499f commit 1ca3510
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/pkg/entry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ function build(pkg::AbstractString, build_file::AbstractString, errfile::Abstrac
--eval $code
```

success(pipeline(cmd, stderr=STDERR))
success(pipeline(cmd, stdout=STDOUT, stderr=STDERR))
end

function build!(pkgs::Vector, seen::Set, errfile::AbstractString)
Expand Down
17 changes: 17 additions & 0 deletions test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,23 @@ temp_pkg_dir() do
@test contains(msg, "INFO: Main.JULIA_RC_LOADED defined true")
end
end

let package = "Output"
stdout_file = Pkg.dir(package, "stdout.txt")
stderr_file = Pkg.dir(package, "stderr.txt")
content = """
println(STDOUT, "stdout")
println(STDERR, "stderr")
"""
write_build(package, content)

code = "Pkg.build(\"$package\")"
msg = run(pipeline(
`$(Base.julia_cmd()) --startup-file=no -e $code`,
stdout=stdout_file, stderr=stderr_file))
@test last(readlines(stdout_file)) == "stdout"
@test last(readlines(stderr_file)) == "stderr"
end
end

@testset "Pkg functions with .jl extension" begin
Expand Down

0 comments on commit 1ca3510

Please sign in to comment.