|
73 | 73 | end
|
74 | 74 | end
|
75 | 75 |
|
| 76 | + @testset "run_interactive" begin |
| 77 | + platform = default_host_platform |
| 78 | + io = IOBuffer() |
| 79 | + @test run_interactive(preferred_runner()(mktempdir(); platform), `/bin/bash -c "echo hello world"`, stdout=io) |
| 80 | + s = String(take!(io)) |
| 81 | + @test s == "hello world\n" |
| 82 | + # Make sure that `run_interactive` consistently throws an error when the process fails, |
| 83 | + # whatever is the type of `stdout`, or it consistently ignores failures if so requested. |
| 84 | + # Ref: https://github.com/JuliaPackaging/BinaryBuilderBase.jl/pull/201#issuecomment-1003192121 |
| 85 | + cmd = `/bin/bash -c "false"` |
| 86 | + @test_throws ProcessFailedException run_interactive(preferred_runner()(mktempdir(); platform), cmd) |
| 87 | + @test_throws ProcessFailedException run_interactive(preferred_runner()(mktempdir(); platform), cmd; stdout=IOBuffer()) |
| 88 | + cmd = Cmd(`/bin/bash -c "false"`; ignorestatus=true) |
| 89 | + @test !run_interactive(preferred_runner()(mktempdir(); platform), cmd) |
| 90 | + @test !run_interactive(preferred_runner()(mktempdir(); platform), cmd; stdout=IOBuffer()) |
| 91 | + end |
| 92 | + |
76 | 93 | if lowercase(get(ENV, "BINARYBUILDER_FULL_SHARD_TEST", "false")) == "true"
|
77 | 94 | @info("Beginning full shard test... (this can take a while)")
|
78 | 95 | platforms = supported_platforms()
|
|
322 | 339 | end
|
323 | 340 | end
|
324 | 341 | end
|
325 |
| - |
326 |
| -@testset "outptut runner" begin |
327 |
| - io = IOBuffer() |
328 |
| - run_interactive(BinaryBuilderBase.preferred_runner()(mktempdir(); platform=Platform("x86_64", "linux"; libc="musl")), `/bin/bash -c "echo hello world"`, stdout=io) |
329 |
| - s = String(take!(io)) |
330 |
| - @test s == "hello world\n" |
331 |
| -end |
|
0 commit comments