Skip to content

Commit

Permalink
Fix tests for v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Bazdresch committed Apr 3, 2024
1 parent ea9ef2d commit b6bf180
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
21 changes: 20 additions & 1 deletion src/Gaston.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,35 @@ function showable(mime::MIME"image/svg+xml", f::Figure)
return false
end

function gp_start()
global P
gstdin = Pipe()
gstdout = Pipe()
gstderr = Pipe()
gproc = run(pipeline(`gnuplot`,
stdin = gstdin, stdout = gstdout, stderr = gstderr),
wait = false)
process_running(gproc) || error("There was a problem starting up gnuplot.")
close(gstdout.in)
close(gstderr.in)
close(gstdin.out)
Base.start_reading(gstderr.out)
P.gstdin = gstdin
P.gstdout = gstdout
P.gstderr = gstderr
end

# initialize gnuplot
function __init__()
global P, gnuplot_state, GNUPLOT_VERSION
global gnuplot_state

gnuplot_state.gnuplot_available = false

try
code = success(`gnuplot --version`)
if code
gnuplot_state.gnuplot_available = true
gp_start()
else
@warn ("There was a problem starting gnuplot. Gaston will be unable to produce any plots.")
end
Expand Down
12 changes: 10 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,23 @@ end
@test_throws TypeError closefigure(1.0)
@test_throws TypeError closefigure(1:2)
# plot
@test_throws ArgumentError p = plot(0:10,0:11)
if VERSION < v"1.7-"
@test_throws ArgumentError p = plot(0:10,0:11)
else
@test_throws DimensionMismatch p = plot(0:10,0:11)
end
#@test_throws DimensionMismatch surf([1,2],[3,4],[5,6,7])
#@test_throws DimensionMismatch surf([1,2,3],[3,4],[5,6,7])
#plot!
closeall()
@test_throws ErrorException p = plot!(0:10)
# imagesc
z = rand(5,6)
@test_throws ArgumentError imagesc(1:5,1:7,z)
if VERSION < v"1.7-"
@test_throws ArgumentError imagesc(1:5,1:7,z)
else
@test_throws DimensionMismatch imagesc(1:5,1:7,z)
end
# histogram
#@test_throws MethodError histogram(0:10+im*0:10)
# save
Expand Down

2 comments on commit b6bf180

@mbaz
Copy link
Owner

@mbaz mbaz commented on b6bf180 Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/104117

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.1.1 -m "<description of version>" b6bf180c6c1b4768302f49f2515d8c24a2bb5f23
git push origin v1.1.1

Please sign in to comment.