Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 15, 2023
1 parent 240358d commit a9775b0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
6 changes: 5 additions & 1 deletion experimental/FTheoryTools/test/tate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ t = global_tate_model(base; completeness_check = false)
@test is_smooth(ambient_space(t)) == false
@test toric_variety(calabi_yau_hypersurface(t)) == ambient_space(t)

isdefined(Main, :test_save_load_roundtrip) || include(
joinpath(Oscar.oscardir, "test", "Serialization", "test_save_load_roundtrip.jl")
)

mktempdir() do path
test_save_load_roundtrip(path, t) do loaded
@test tate_polynomial(loaded) == tate_polynomial(t)
@test tate_polynomial(t) == tate_polynomial(loaded)
@test tate_section_a1(t) == tate_section_a1(loaded)
@test tate_section_a2(t) == tate_section_a2(loaded)
@test tate_section_a3(t) == tate_section_a3(loaded)
Expand Down
4 changes: 4 additions & 0 deletions experimental/QuadFormAndIsom/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ end
Lf = integer_lattice_with_isometry(L; neg = true)
@test order_of_isometry(Lf) == -1

isdefined(Main, :test_save_load_roundtrip) || include(
joinpath(Oscar.oscardir, "test", "Serialization", "test_save_load_roundtrip.jl")
)

mktempdir() do path
test_save_load_roundtrip(path, Lf) do loaded
@test Lf == loaded
Expand Down
4 changes: 3 additions & 1 deletion test/Serialization/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Oscar

isdefined(Main, :test_save_load_roundtrip) ||
include(joinpath(Oscar.oscardir, "test", "Serialization", "test_save_load_roundtrip.jl"))

include("basic_types.jl")
include("PolyhedralGeometry.jl")
include("containers.jl")
Expand All @@ -13,4 +16,3 @@ include("TropicalGeometry.jl")
include("QuadForm.jl")
include("polymake/runtests.jl")
include("upgrades/runtests.jl")

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# This file is dedicated for code that needs to be run on every worker before
# running the tests. This is useful for test-code that is called from multiple files
# that may run on different workers.
# This code is needed for multiple test files that may end up on different workers.
# Thus, this needs to be conditionally included in each of these test files.

function test_save_load_roundtrip(func, path, original::T; params=nothing) where T
function test_save_load_roundtrip(func, path, original::T; params=nothing) where {T}
# save and load from a file
filename = joinpath(path, "original.json")
save(filename, original)
Expand Down Expand Up @@ -31,7 +30,7 @@ function test_save_load_roundtrip(func, path, original::T; params=nothing) where
io = IOBuffer()
save(io, original)
seekstart(io)
loaded = load(io, type=T, params=params)
loaded = load(io; type=T, params=params)
if T <: Vector
@test loaded isa Vector
else
Expand Down
2 changes: 0 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ end
Base.cumulative_compile_timing(true)
end

@everywhere include("Serialization/init_tests.jl")

testlist = [

"Aqua.jl",
Expand Down

0 comments on commit a9775b0

Please sign in to comment.