Skip to content

Commit da66c79

Browse files
committed
Remove BinaryBuilder and fix tests on nightly
1 parent 7bd4dc0 commit da66c79

File tree

3 files changed

+19
-83
lines changed

3 files changed

+19
-83
lines changed

test/Project.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
[deps]
2-
BinaryBuilder = "12aac903-9f7c-5d81-afc2-d9565ea332ae"
32
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
43
CMake_jll = "3f4e10e2-61f2-5801-8945-23b9d642d0e6"
54
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
65
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
76
ReTest = "e0db7c4e-2690-44b9-bad6-7687da720f89"
87
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
9-
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
108
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11-
p7zip_jll = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
12-
13-
[compat]
14-
# This is the last release that won't error out on Julia >1.7:
15-
# https://github.com/JuliaPackaging/BinaryBuilder.jl/pull/1318
16-
#
17-
# We don't require much of BinaryBuilder so until BB2 comes out this should be
18-
# safe.
19-
BinaryBuilder = "0.5.8"

test/bitfield/build_tarballs.jl

Lines changed: 0 additions & 35 deletions
This file was deleted.

test/test_bitfield.jl

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import CMake_jll: cmake
2-
using p7zip_jll, Tar
32
using Clang.Generators
43

54
function build_libbitfield_native()
@@ -30,32 +29,11 @@ function build_libbitfield_native()
3029
return success
3130
end
3231

33-
34-
function build_libbitfield_binarybuilder()
35-
@info "Building libbitfield binary with BinaryBuilder."
36-
success = true
37-
try
38-
cd(@__DIR__) do
39-
run(`$(Base.julia_cmd()) --project bitfield/build_tarballs.jl`)
40-
# from Pkg.download_verify_unpack
41-
# Note that we filter out the extra log file that's generated
42-
tarball_path = only(filter(!contains("-logs.v"), readdir("products")))
43-
dest = "build"
44-
rm(dest; recursive = true)
45-
Tar.extract(`$(p7zip_jll.p7zip()) x products/$tarball_path -so`, dest)
46-
end
47-
catch e
48-
@warn "Building libbitfield with BinaryBuilder failed" exception=(e, catch_backtrace())
49-
success = false
50-
end
51-
return success
52-
end
53-
5432
function build_libbitfield()
5533
success = true
5634
try
5735
# Compile binary
58-
if !build_libbitfield_binarybuilder() && !build_libbitfield_native()
36+
if !build_libbitfield_native()
5937
error("Could not build libbitfield binary")
6038
end
6139

@@ -83,22 +61,26 @@ function build_libbitfield()
8361
return success
8462
end
8563

86-
64+
# The actual tests are in this separate function so it's easier to @invokelatest
65+
# all of the new functions.
66+
function test_libbitfield()
67+
bf = Ref(LibBitField.BitField(Int8(10), 1.5, Int32(1e6), Int32(-4), Int32(7), UInt32(3)))
68+
m = Ref(LibBitField.Mirror(10, 1.5, 1e6, -4, 7, 3))
69+
GC.@preserve bf m begin
70+
pbf = Ptr{LibBitField.BitField}(pointer_from_objref(bf))
71+
pm = Ptr{LibBitField.Mirror}(pointer_from_objref(m))
72+
@test LibBitField.toMirror(bf) == m[]
73+
@test LibBitField.toBitfield(m).a == bf[].a
74+
@test LibBitField.toBitfield(m).b == bf[].b
75+
@test LibBitField.toBitfield(m).c == bf[].c
76+
@test LibBitField.toBitfield(m).d == bf[].d
77+
@test LibBitField.toBitfield(m).e == bf[].e
78+
@test LibBitField.toBitfield(m).f == bf[].f
79+
end
80+
end
8781

8882
@testset "Bitfield" begin
8983
if build_libbitfield()
90-
bf = Ref(LibBitField.BitField(Int8(10), 1.5, Int32(1e6), Int32(-4), Int32(7), UInt32(3)))
91-
m = Ref(LibBitField.Mirror(10, 1.5, 1e6, -4, 7, 3))
92-
GC.@preserve bf m begin
93-
pbf = Ptr{LibBitField.BitField}(pointer_from_objref(bf))
94-
pm = Ptr{LibBitField.Mirror}(pointer_from_objref(m))
95-
@test LibBitField.toMirror(bf) == m[]
96-
@test LibBitField.toBitfield(m).a == bf[].a
97-
@test LibBitField.toBitfield(m).b == bf[].b
98-
@test LibBitField.toBitfield(m).c == bf[].c
99-
@test LibBitField.toBitfield(m).d == bf[].d
100-
@test LibBitField.toBitfield(m).e == bf[].e
101-
@test LibBitField.toBitfield(m).f == bf[].f
102-
end
84+
Base.@invokelatest test_libbitfield()
10385
end
10486
end

0 commit comments

Comments
 (0)