|
379 | 379 | @test isempty(state.platforms)
|
380 | 380 | end
|
381 | 381 |
|
| 382 | +function step7_state() |
| 383 | + state = step5_state(""" |
| 384 | + cd libfoo |
| 385 | + make install |
| 386 | + exit 1 |
| 387 | + """) |
| 388 | + state.patches = [PatchSource("foo.patch", "this is a patch")] |
| 389 | + return state |
| 390 | +end |
| 391 | + |
| 392 | +@testset "Wizard - Deployment" begin |
| 393 | + state = step7_state() |
| 394 | + # First, test local deployment |
| 395 | + mktempdir() do out_dir |
| 396 | + with_wizard_output(state, state->Wizard._deploy(state)) do ins, outs |
| 397 | + call_response(ins, outs, "How should we deploy this build recipe?", "\e[B\r") |
| 398 | + call_response(ins, outs, "Enter directory to write build_tarballs.jl to:", "$(out_dir)\r") |
| 399 | + end |
| 400 | + @test isfile(joinpath(out_dir, "build_tarballs.jl")) |
| 401 | + @test isfile(joinpath(out_dir, "bundled", "patches", "foo.patch")) |
| 402 | + end |
| 403 | + |
| 404 | + # Next, test writing out to stdout |
| 405 | + state = step7_state() |
| 406 | + with_wizard_output(state, state->Wizard._deploy(state)) do ins, outs |
| 407 | + call_response(ins, outs, "How should we deploy this build recipe?", "\e[B\e[B\r") |
| 408 | + @test readuntil_sift(outs, "Your generated build_tarballs.jl:") |
| 409 | + @test readuntil_sift(outs, "name = \"libfoo\"") |
| 410 | + @test readuntil_sift(outs, "make install") |
| 411 | + @test readuntil_sift(outs, "LibraryProduct(\"libfoo\", :libfoo)") |
| 412 | + @test readuntil_sift(outs, "ExecutableProduct(\"fooifier\", :fooifier)") |
| 413 | + @test readuntil_sift(outs, "dependencies = Dependency[") |
| 414 | + end |
| 415 | +end |
| 416 | + |
382 | 417 | @testset "GitHub - authentication" begin
|
383 | 418 | withenv("GITHUB_TOKEN" => "") do
|
384 | 419 | @test Wizard.github_auth(allow_anonymous=true) isa GitHub.AnonymousAuth
|
|
0 commit comments