Skip to content

Commit

Permalink
Improvements to relocatability test script (#4468)
Browse files Browse the repository at this point in the history
use `run` to get printouts and `finally` to not swallow errors in `catch`
  • Loading branch information
jkrumbiegel authored Oct 10, 2024
1 parent 6be105c commit 2f9775a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions relocatability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ using PackageCompiler

create_app(joinpath(pwd(), "MakieApp"), "executable"; force=true, incremental=true, include_transitive_dependencies=false)
exe = joinpath(pwd(), "executable", "bin", "MakieApp")
@test success(`$(exe)`)
# `run` allows to see potential informative printouts, `success` swallows those
p = run(`$(exe)`)
@test p.exitcode == 0
julia_pkg_dir = joinpath(Base.DEPOT_PATH[1], "packages")
@test isdir(julia_pkg_dir)
mvd_julia_pkg_dir = julia_pkg_dir * ".old"
mv(julia_pkg_dir, mvd_julia_pkg_dir)
mv(julia_pkg_dir, mvd_julia_pkg_dir, force = true)
# Move package dir so that we can test relocatability (hardcoded paths to package dir being invalid now)
try
mv(julia_pkg_dir, mvd_julia_pkg_dir)
@test success(`$(exe)`)
catch e
p2 = run(`$(exe)`)
@test p2.exitcode == 0
finally
mv(mvd_julia_pkg_dir, julia_pkg_dir)
end

0 comments on commit 2f9775a

Please sign in to comment.