Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a warning and a failure instead of an UnDefinedVarError if GTK is not loaded #30

Open
oxinabox opened this issue Jun 30, 2020 · 4 comments

Comments

@oxinabox
Copy link

I was very confused that i kept getting:

┌ Warning: Should we make this the new reference image?
└ @ VisualRegressionTests ~/.julia/packages/VisualRegressionTests/q0Rxt/src/imgcomp.jl:39
LayeredLayouts.jl: Error During Test at /Users/oxinabox/.julia/packages/VisualRegressionTests/q0Rxt/src/macros.jl:18
  Test threw exception
  Expression: test_images(testFilename, ref("1"), popup = true, tol = 0.02) |> success
  UndefVarError: replace_refimg_dialog not defined
  Stacktrace:
   [1] test_images(::String, ::String; popup::Bool, newfn::String, kw::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:tol,),Tuple{Float64}}}) at /Users/oxinabox/.julia/packages/VisualRegressionTests/q0Rxt/src/imgcomp.jl:40

when testing things.
I assumed there was a bug in the package.
But then i looked in the source and saw that Requires.jl is being used to include the file with that function defined in it, only if GTK was loaded.

We should be able to use isdefined to check if that function is defined.
and if it isn't then rather than having an undefined error,
say something like "Please load GTK to regenerate images"

@FelixBenning
Copy link

I can not get it to work at all, even after I add Gtk to the package requirements I still get this error.

@kellertuer
Copy link

On my new machine I am running into the same problem and have not yet found a way to make it work.

@oxinabox
Copy link
Author

oxinabox commented Dec 9, 2020

You need to do using Gtk as well as using VisualRegressionTests

@kellertuer
Copy link

Ah, I forgot the using Gtk – I don't know why it ever worked without that; now it worked. Thanks for providing this issue that I found what the error message means :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants