Skip to content

Commit

Permalink
fix(CI): Inkscape not available in CI, add check to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kunzaatko committed Jan 9, 2025
1 parent da60540 commit 50e2bde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/save-fig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ Return the set of formats to generate based on the given `backends` required `fo
# Examples
```jldoctest
julia> MakieMaestro.get_formats([CairoMakie], Set([MakieMaestro.PdfTex])) # Added Svg so the PdfTex is possible to create
2-element Vector{MakieMaestro.Format}:
Svg::Format = 1
PdfTex::Format = 4
julia> (Sys.which("inkscape") === nothing) || MakieMaestro.Svg ∈ MakieMaestro.get_formats([CairoMakie], Set([MakieMaestro.PdfTex])) # Added Svg so the PdfTex is possible to create
true
julia> MakieMaestro.get_formats([GLMakie], Set([MakieMaestro.Pdf]))
ERROR: ArgumentError: None of the backends Module[GLMakie] support the formats Set(MakieMaestro.Format[MakieMaestro.Pdf])
Expand Down
10 changes: 6 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include("./tools.jl")
@testset "DocTests" begin
# NOTE: Show for `Unitful.jl` does nm⁻¹ on macOS and nm^-1 on Linux. This is necessary, since the `jldoctest` is only one
if !haskey(ENV, "GITHUB_ACTIONS") ||
haskey(ENV, "RUNNER_OS") && ENV["RUNNER_OS"] == "Linux"
haskey(ENV, "RUNNER_OS") && ENV["RUNNER_OS"] == "Linux"
# NOTE: Better than doc-testing in `make.jl` because, I can track the coverage
# NOTE: When updating, must update also in `docs/make.jl` and `test/fix_doctests.jl`<18-12-24>
DocMeta.setdocmeta!(
Expand Down Expand Up @@ -76,9 +76,11 @@ include("./tools.jl")
@testset "theme" begin end
@testset "`savefig`" begin
@test MakieMaestro.get_formats([CairoMakie], Set([MakieMaestro.Png])) ==
[MakieMaestro.Png] # Allowed formats
@test MakieMaestro.Svg in
MakieMaestro.get_formats([CairoMakie], Set([MakieMaestro.PdfTex])) # Added necessary Svg format
[MakieMaestro.Png] # Allowed formats
if Sys.which("inkscape") !== nothing
@test MakieMaestro.Svg in
MakieMaestro.get_formats([CairoMakie], Set([MakieMaestro.PdfTex])) # Added necessary Svg format
end
@test_throws ArgumentError MakieMaestro.get_formats(
[GLMakie], Set([MakieMaestro.Pdf])
)
Expand Down

0 comments on commit 50e2bde

Please sign in to comment.