Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few more tests on master #866

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
# Check #697
echo "Test #697"
dn=$(mktemp -d)
ver=$(julia -e '(!isempty(VERSION.prerelease) && VERSION.prerelease[1] == "DEV") ? println(Base.GIT_VERSION_INFO.commit) : println(VERSION)')
path=$(julia -e '(!isempty(VERSION.prerelease) && VERSION.prerelease[1] == "DEV") ? println(Base.GIT_VERSION_INFO.commit) : println("refs/tags/v",VERSION)')
curl -s -L https://github.com/JuliaLang/julia/archive/$path.tar.gz --output - | tar -xz -C $dn
julia --project test/juliadir.jl "$dn/julia-$ver"
Expand Down
2 changes: 1 addition & 1 deletion src/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function _track(id, modname; modified_files=revision_queue)
# Save the result (unnecessary if already in pkgdatas, but doesn't hurt either)
pkgdatas[id] = pkgdata
elseif modname === :Compiler
compilerdir = normpath(joinpath(juliadir, "Compiler"))
compilerdir = normpath(joinpath(juliadir, "Compiler", "src"))
compilerdir_pre_112 = normpath(joinpath(juliadir, "base", "compiler"))
isdir(compilerdir) || (compilerdir = compilerdir_pre_112)
pkgdata = get(pkgdatas, id, nothing)
Expand Down
2 changes: 1 addition & 1 deletion test/backedges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ do_test("Backedges") && @testset "Backedges" begin
src2 = src.code[idtype].args[1]
methodinfo = Revise.MethodInfo()
isrequired = Revise.minimal_evaluation!(methodinfo, frame, :sigs)[1]
@test sum(isrequired) == length(src.code)-1 # skips the `return` at the end
@test sum(isrequired) == length(src.code)-count(e->isexpr(e, :latestworld), src.code)-1 # skips the `return` at the end

src = """
# issue #249
Expand Down
4 changes: 2 additions & 2 deletions test/non_jl_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ end
sleep(mtimedelay)
m=MyFile(path)
includet(m)
yry() # comes from test/common.jl
@yry() # comes from test/common.jl
@test fake_lang.y() == "2"
@test fake_lang.x() == "1"
sleep(mtimedelay)
cp(joinpath(@__DIR__, "fake_lang", "new_test.program"), path, force=true)
yry()
@yry()
@test fake_lang.x() == "2"
@test_throws MethodError fake_lang.y()
finally
Expand Down
14 changes: 14 additions & 0 deletions test/switch_version.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
using Revise, Pkg, Test

if isdefined(Core, :var"@latestworld")
import Core: @latestworld
else
# In older Julia versions, there were more implicit
# world age increments, so the macro is generally not
# required.
macro latestworld()
nothing
end
end

mktempdir() do thisdir
Pkg.activate(thisdir)

Expand All @@ -17,13 +29,15 @@ mktempdir() do thisdir
isdefined(Base, :errormonitor) && Base.errormonitor(t)
wait(Revise.revision_event)
revise()
@latestworld
@test somemethod() === 1 # present in v2
# ...and then switch back (check that it's bidirectional and also to reset state)
v1_cmd = """using Pkg; Pkg.activate("."); Pkg.develop(path = joinpath("$(escape_string(dirname(@__FILE__)))", "pkgs", "PkgChange_v1"))"""
t = @async run(pipeline(Cmd(`$(Base.julia_cmd()) -e $v1_cmd`; dir=$thisdir); stderr, stdout))
isdefined(Base, :errormonitor) && Base.errormonitor(t)
wait(Revise.revision_event)
revise()
@latestworld
@test_throws MethodError somemethod() # not present in v1
end
end
Loading