imgcmp and travis
This commit is contained in:
parent
a3a8cb9368
commit
8a0fc00435
@ -12,7 +12,7 @@ notifications:
|
|||||||
# uncomment the following lines to override the default test script
|
# uncomment the following lines to override the default test script
|
||||||
script:
|
script:
|
||||||
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
|
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
|
||||||
- julia -e 'Pkg.clone("Images"); Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")'
|
- julia -e 'Pkg.clone("Images"); Pkg.checkout("50872b3045600d6811b1ffba343bf75467d681c5"); Pkg.clone("ImageMagick"); Pkg.build("ImageMagick")'
|
||||||
- julia -e 'Pkg.clone("Cairo"); Pkg.build("Cairo")'
|
- julia -e 'Pkg.clone("Cairo"); Pkg.build("Cairo")'
|
||||||
- julia -e 'Pkg.clone(pwd()); Pkg.build("Plots")'
|
- julia -e 'Pkg.clone(pwd()); Pkg.build("Plots")'
|
||||||
- julia -e 'Pkg.test("Plots"; coverage=true)'
|
- julia -e 'Pkg.test("Plots"; coverage=true)'
|
||||||
|
|||||||
@ -53,43 +53,52 @@ function compareToReferenceImage(tmpfn, reffn)
|
|||||||
push!(imgbox, makeImageWidget(reffn))
|
push!(imgbox, makeImageWidget(reffn))
|
||||||
|
|
||||||
# add the buttons
|
# add the buttons
|
||||||
doNothingButton = Gtk.GtkButtonLeaf("Skip")
|
# doNothingButton = Gtk.GtkButtonLeaf("Skip")
|
||||||
replaceReferenceButton = Gtk.GtkButtonLeaf("Replace reference image")
|
# replaceReferenceButton = Gtk.GtkButtonLeaf("Replace reference image")
|
||||||
btnbox = Gtk.GtkButtonBoxLeaf(:h)
|
# btnbox = Gtk.GtkButtonBoxLeaf(:h)
|
||||||
push!(btnbox, doNothingButton)
|
# push!(btnbox, doNothingButton)
|
||||||
push!(btnbox, replaceReferenceButton)
|
# push!(btnbox, replaceReferenceButton)
|
||||||
|
|
||||||
# create the window
|
# # create the window
|
||||||
box = Gtk.GtkBoxLeaf(:v)
|
# box = Gtk.GtkBoxLeaf(:v)
|
||||||
push!(box, imgbox)
|
# push!(box, imgbox)
|
||||||
push!(box, btnbox)
|
# push!(box, btnbox)
|
||||||
win = Gtk.GtkWindowLeaf("Should we make this the new reference image?")
|
win = Gtk.GtkWindowLeaf("Should we make this the new reference image?")
|
||||||
push!(win, Gtk.GtkFrameLeaf(box))
|
push!(win, Gtk.GtkFrameLeaf(imgbox))
|
||||||
|
|
||||||
# we'll wait on this condition
|
showall(win)
|
||||||
c = Condition()
|
|
||||||
Gtk.on_signal_destroy((x...) -> notify(c), win)
|
|
||||||
|
|
||||||
Gtk.signal_connect(replaceReferenceButton, "clicked") do widget
|
# now ask the question
|
||||||
|
if Gtk.ask_dialog("Should we make this the new reference image?", "No", "Yes")
|
||||||
replaceReferenceImage(tmpfn, reffn)
|
replaceReferenceImage(tmpfn, reffn)
|
||||||
notify(c)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Gtk.signal_connect(doNothingButton, "clicked") do widget
|
destroy(win)
|
||||||
notify(c)
|
|
||||||
end
|
|
||||||
|
|
||||||
# wait until a button is clicked, then close the window
|
# # we'll wait on this condition
|
||||||
Gtk.showall(win)
|
# c = Condition()
|
||||||
wait(c)
|
# Gtk.on_signal_destroy((x...) -> notify(c), win)
|
||||||
Gtk.destroy(win)
|
|
||||||
|
# Gtk.signal_connect(replaceReferenceButton, "clicked") do widget
|
||||||
|
# replaceReferenceImage(tmpfn, reffn)
|
||||||
|
# notify(c)
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Gtk.signal_connect(doNothingButton, "clicked") do widget
|
||||||
|
# notify(c)
|
||||||
|
# end
|
||||||
|
|
||||||
|
# # wait until a button is clicked, then close the window
|
||||||
|
# Gtk.showall(win)
|
||||||
|
# wait(c)
|
||||||
|
# Gtk.destroy(win)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# TODO: use julia's Condition type and the wait() and notify() functions to initialize a Window, then wait() on a condition that
|
# TODO: use julia's Condition type and the wait() and notify() functions to initialize a Window, then wait() on a condition that
|
||||||
# is referenced in a button press callback (the button clicked callback will call notify() on that condition)
|
# is referenced in a button press callback (the button clicked callback will call notify() on that condition)
|
||||||
|
|
||||||
function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1,1], eps = 1e-3)
|
function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1,1], eps = 1e-2)
|
||||||
|
|
||||||
# first
|
# first
|
||||||
Plots._debugMode.on = debug
|
Plots._debugMode.on = debug
|
||||||
@ -155,7 +164,7 @@ function image_comparison_tests(pkg::Symbol, idx::Int; debug = false, sigma = [1
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function image_comparison_tests(pkg::Symbol; skip = [], debug = false, sigma = [1,1], eps = 1e-3)
|
function image_comparison_tests(pkg::Symbol; skip = [], debug = false, sigma = [1,1], eps = 1e-2)
|
||||||
for i in 1:length(PlotExamples.examples)
|
for i in 1:length(PlotExamples.examples)
|
||||||
i in skip && continue
|
i in skip && continue
|
||||||
@fact image_comparison_tests(pkg, i, debug=debug, sigma=sigma, eps=eps) --> true
|
@fact image_comparison_tests(pkg, i, debug=debug, sigma=sigma, eps=eps) --> true
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 43 KiB |
Loading…
x
Reference in New Issue
Block a user