Skip to content

Commit f47a234

Browse files
authored
Remove some tests that belong into BinaryBuilderBase (#981)
This removes the need to hardcode some lowlevel implementation details of BBB here, which makes it possible to change those.
1 parent 3af0f83 commit f47a234

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

test/declarative.jl

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using JSON, BinaryBuilder, Test
22

3-
import BinaryBuilder.BinaryBuilderBase: sourcify, dependencify, major, minor, patch, version
3+
import BinaryBuilder.BinaryBuilderBase: sourcify
44

55
@testset "Meta JSON" begin
66
meta_json_buff = IOBuffer()
@@ -61,25 +61,7 @@ import BinaryBuilder.BinaryBuilderBase: sourcify, dependencify, major, minor, pa
6161
@test sourcify(Dict("type" => "git", "url" => "https://github.com/JuliaLang/julia.git", "hash" => "12345")) == GitSource("https://github.com/JuliaLang/julia.git", "12345")
6262
@test sourcify(Dict("type" => "file", "url" => "https://julialang.org", "hash" => "98765")) == FileSource("https://julialang.org", "98765")
6363
@test_throws ErrorException sourcify(Dict("type" => "qux"))
64-
# `PackageSpec(; name = "Foo") != PackageSpec(; name = "Foo")`, so we
65-
# need to manually compare the fields we care about
66-
d = dependencify(Dict("type" => "dependency", "name" => "Foo_jll", "uuid" => nothing,
67-
"version-major" => 0, "version-minor" => 0, "version-patch" => 0))
68-
ref_d = Dependency(PackageSpec(; name = "Foo_jll"))
69-
@test d.pkg.name == ref_d.pkg.name
70-
@test d.pkg.uuid == ref_d.pkg.uuid
71-
v = version(d)
72-
ref_v = version(ref_d)
73-
@test (major(v), minor(v), patch(v)) == (major(ref_v), minor(ref_v), patch(ref_v))
74-
d = dependencify(Dict("type" => "builddependency", "name" => "Qux_jll", "uuid" => nothing,
75-
"version-major" => 1, "version-minor" => 2, "version-patch" => 3))
76-
ref_d = Dependency(PackageSpec(; name = "Qux_jll", version = v"1.2.3"))
77-
@test d.pkg.name == ref_d.pkg.name
78-
@test d.pkg.uuid == ref_d.pkg.uuid
79-
v = version(d)
80-
ref_v = version(ref_d)
81-
@test (major(v), minor(v), patch(v)) == (major(ref_v), minor(ref_v), patch(ref_v))
82-
@test_throws ErrorException dependencify(Dict("type" => "bar"))
64+
8365
@test length(meta["products"]) == 4
8466
@test all(in.((LibraryProduct("libfoo", :libfoo), ExecutableProduct("julia", :julia), LibraryProduct("libfoo2", :libfoo2; dlopen_flags=[:RTLD_GLOBAL]), FrameworkProduct("fooFramework", :libfooFramework)), Ref(meta["products"])))
8567
@test length(meta["script"]) == 2

0 commit comments

Comments
 (0)