From c3490a91dbf1d8b940821cdef1539134339f4e48 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 19 Aug 2024 10:58:38 +0200 Subject: [PATCH 1/2] format --- docs/make.jl | 2 +- test/pvtk_files.jl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 1683526..5126f9f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -37,7 +37,7 @@ makedocs( "Reference" => "reference.md", "VTKBase.jl" => vtkbase_docs, "Contributing" => "contributing.md", - "License" => "license.md", + "License" => "license.md" ]) deploydocs(repo = "github.com/JuliaVTK/ReadVTK.jl", diff --git a/test/pvtk_files.jl b/test/pvtk_files.jl index b819768..4269145 100644 --- a/test/pvtk_files.jl +++ b/test/pvtk_files.jl @@ -23,7 +23,7 @@ extents = [ (1:10, 1:5, 1:4), # process 1 (10:15, 1:5, 1:4), # process 2 (1:10, 5:12, 1:4), # process 3 - (10:15, 5:12, 1:4), # process 4 + (10:15, 5:12, 1:4) # process 4 ] saved_files = Vector{Vector{String}}(undef, 4) # files saved by each "process" @@ -102,14 +102,14 @@ all_data = [ (points = rand(3, 5), # 5 points on process 1 cells = [ # 2 cells on process 1 MeshCell(VTKCellTypes.VTK_TRIANGLE, [1, 4, 2]), - MeshCell(VTKCellTypes.VTK_QUAD, [2, 4, 3, 5]), + MeshCell(VTKCellTypes.VTK_QUAD, [2, 4, 3, 5]) ]), # Process 2 (points = rand(3, 4), # 4 points on process 2 cells = [ # 1 cell on process 2 - MeshCell(VTKCellTypes.VTK_QUAD, [1, 2, 3, 4]), - ]), + MeshCell(VTKCellTypes.VTK_QUAD, [1, 2, 3, 4]) + ]) ] saved_files = Vector{Vector{String}}(undef, 2) # files saved by each "process" From 02374680211ce3523714477dcc5a7d34f8b9f585 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 19 Aug 2024 11:20:41 +0200 Subject: [PATCH 2/2] fix tests --- test/Project.toml | 3 ++- test/pvtk_files.jl | 10 ++++++++++ test/runtests.jl | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 93bce72..9237c71 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,8 +1,9 @@ [deps] +ReadVTK = "dc215faf-f008-4882-a9f7-a79a826fadc3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192" [compat] StaticArrays = "1" -WriteVTK = "1.13" +WriteVTK = "1.19" diff --git a/test/pvtk_files.jl b/test/pvtk_files.jl index 4269145..8f9f359 100644 --- a/test/pvtk_files.jl +++ b/test/pvtk_files.jl @@ -143,6 +143,13 @@ saved_files = paraview_collection(path_pvd) do pvd end # (2) Read back files +# Since WriteVTK uses relative paths, we need to change to the directory where +# the files were saved. We remember the current directory and change back to it +# at the end of the test. +# See https://github.com/JuliaVTK/WriteVTK.jl/pull/141 and +# https://github.com/JuliaVTK/ReadVTK.jl/pull/62 +current_directory = pwd() +cd(TEST_EXAMPLES_DIR) # a) RectilinearGrid file @testset "pvtr" begin @@ -280,3 +287,6 @@ end @test pvd.timesteps == Vector(times) @test isnothing(show(devnull, pvd)) end + +# Change back to the original directory +cd(current_directory) diff --git a/test/runtests.jl b/test/runtests.jl index e5b5a12..f54463f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,7 +9,7 @@ using ReadVTK, WriteVTK TEST_EXAMPLES_COMMIT = "1f961a7ad38e76a8d552b8392d8cd661ab9f79b4" # Local folder to store downloaded example files. If you change this, also adapt `../.gitignore`! -TEST_EXAMPLES_DIR = "examples" +TEST_EXAMPLES_DIR = abspath("examples") function get_test_example_file(filename)