diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 43de800..895ae7e 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -13,6 +13,7 @@ jobs: contents: write runs-on: ubuntu-latest steps: + - uses: julia-actions/cache@v2 - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 with: diff --git a/Project.toml b/Project.toml index 93c0f28..f10f90f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,12 +1,11 @@ name = "Exodus" uuid = "f57ae99e-f805-4780-bdca-96e224be1e5a" authors = ["cmhamel "] -version = "0.13.2" +version = "0.13.3" [deps] DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" Exodus_jll = "fc7263ad-bce8-5229-97b1-c6ddabda41b1" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [weakdeps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" @@ -25,8 +24,7 @@ DocStringExtensions = "0.9" Exodus_jll = "8.19" JET = "0.8" MPI = "0.20" -PartitionedArrays = "0.4, 0.5" -Pkg = "1" +PartitionedArrays = "0.4" Test = "1" TestSetExtensions = "2" Unitful = "1" diff --git a/docs/src/opening_files.md b/docs/src/opening_files.md index 87daa1f..8ae0401 100644 --- a/docs/src/opening_files.md +++ b/docs/src/opening_files.md @@ -20,16 +20,17 @@ Initialization: Number of side sets = 4 Block: - + unnamed_block_1 NodeSet: - + unnamed_nset_1 unnamed_nset_2 unnamed_nset_3 unnamed_nset_4 SideSet: - + unnamed_sset_1 unnamed_sset_2 unnamed_sset_3 unnamed_sset_4 NodalVariable: u + ``` \ No newline at end of file diff --git a/src/ExoDiff.jl b/src/ExoDiff.jl index 83f8508..591e783 100644 --- a/src/ExoDiff.jl +++ b/src/ExoDiff.jl @@ -30,11 +30,8 @@ function exodiff( ex_2::String; command_file = nothing ) - # if Sys.iswindows() - # exodus_windows_error() - # end + @assert !Sys.iswindows() - # @assert is exo_cmd = String[] @@ -82,4 +79,59 @@ function exodiff( rm("exodiff_stderr.log", force=true) return return_bool -end \ No newline at end of file +end + +function exodiff( + ex_1::String, + ex_2::String, + cli_args::Vector{String} +) + + @assert !Sys.iswindows() + + exo_cmd = String[] + + for arg in cli_args + push!(exo_cmd, arg) + end + + # push files to compare to command list + push!(exo_cmd, abspath(ex_1)) + push!(exo_cmd, abspath(ex_2)) + + # finally run the command + errors_found = false + exodiff_exe() do exe + pushfirst!(exo_cmd, "$exe") + cmd = Cmd(exo_cmd) + + redirect_stdio(stdout="exodiff.log", stderr="exodiff_stderr.log") do + try + run(cmd, wait=true) + catch + errors_found = true + end + end + end + + # now handle errors + return_bool = false + if errors_found + open("exodiff_stderr.log") do f + words = read(f, String) |> lowercase + + # look for no such file error + if contains(words, "no such file") + println("\n\nFile not found error in exodiff\n\n") + exodiff_error(Cmd(exo_cmd)) + end + end + + return_bool = false + else + return_bool = true + end + + rm("exodiff_stderr.log", force=true) + return return_bool +end diff --git a/test/runtests.jl b/test/runtests.jl index fd4725c..aa40fa0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -128,6 +128,7 @@ if Sys.iswindows() else @exodus_unit_test_set "exodiff help" begin exodiff() + exodiff("./example_output/output.gold", "./example_output/output.gold", ["-Help"]) == true end @exodus_unit_test_set "exodiff" begin @@ -364,6 +365,7 @@ end # JET testing # report_package("Exodus") -@testset ExtendedTestSet "JET.jl" begin - test_package("Exodus"; target_defined_modules=true) -end +# @testset ExtendedTestSet "JET.jl" begin +# # test_package("Exodus"; target_defined_modules=true) +# JET.test_all("Exodus") +# end