Skip to content

Commit d61d111

Browse files
authored
Merge pull request #63 from JuliaDebug/fixtest
fix broken CBinding test, pin down the version
2 parents 95156a6 + 969b6fc commit d61d111

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

test/signatures.jl

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ const LT{T} = Union{LVec{<:Any, T}, T}
1919
const FloatingTypes = Union{Float32, Float64}
2020
end
2121

22-
# Stuff for https://github.com/timholy/Revise.jl/issues/550
23-
if Base.VERSION >= v"1.1"
24-
try
25-
using CBinding
26-
catch
27-
@info "Adding CBinding to the environment for test purposes"
28-
using Pkg
29-
Pkg.add("CBinding") # not available for Julia 1.0
30-
end
31-
eval(:(module Lowering550
32-
using CBinding
33-
end))
34-
end
35-
3622
bodymethtest0(x) = 0
3723
function bodymethtest0(x)
3824
y = 2x
@@ -385,19 +371,6 @@ bodymethtest5(x, y=Dict(1=>2)) = 5
385371
pc = methoddefs!(signatures, frame; define=false)
386372
@test typeof(Lowering422.fneg) Set(Base.unwrap_unionall(sig).parameters[1] for sig in signatures)
387373

388-
# https://github.com/timholy/Revise.jl/issues/550
389-
if Base.VERSION >= v"1.1"
390-
ex = :(@cstruct S {
391-
val::Int8
392-
})
393-
empty!(signatures)
394-
Core.eval(Lowering550, ex)
395-
frame = Frame(Lowering550, ex)
396-
rename_framemethods!(frame)
397-
pc = methoddefs!(signatures, frame; define=false)
398-
@test !isempty(signatures) # really we just need to know that `methoddefs!` completed without getting stuck
399-
end
400-
401374
# Scoped names (https://github.com/timholy/Revise.jl/issues/568)
402375
ex = :(f568() = -1)
403376
Core.eval(Lowering, ex)
@@ -431,4 +404,31 @@ bodymethtest5(x, y=Dict(1=>2)) = 5
431404
end
432405
frame = Frame(Lowering, ex)
433406
rename_framemethods!(frame)
407+
408+
# https://github.com/timholy/Revise.jl/issues/550
409+
if Base.VERSION >= v"1.4"
410+
using Pkg
411+
try
412+
# we test with the old version of CBinding, let's do it in an isolated environment
413+
Pkg.activate(; temp=true)
414+
415+
@info "Adding CBinding to the environment for test purposes"
416+
Pkg.add(; name="CBinding", version="0.9.4") # `@cstruct` isn't defined for v1.0 and above
417+
418+
m = Module()
419+
Core.eval(m, :(using CBinding))
420+
421+
ex = :(@cstruct S {
422+
val::Int8
423+
})
424+
empty!(signatures)
425+
Core.eval(m, ex)
426+
frame = Frame(m, ex)
427+
rename_framemethods!(frame)
428+
pc = methoddefs!(signatures, frame; define=false)
429+
@test !isempty(signatures) # really we just need to know that `methoddefs!` completed without getting stuck
430+
finally
431+
Pkg.activate() # back to the original environment
432+
end
433+
end
434434
end

0 commit comments

Comments
 (0)