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

verify_output fails on Linux if there is no X11 #1011

Closed
gaborcsardi opened this issue Apr 13, 2020 · 1 comment · Fixed by #1047
Closed

verify_output fails on Linux if there is no X11 #1011

gaborcsardi opened this issue Apr 13, 2020 · 1 comment · Fixed by #1047
Labels
bug an unexpected problem or unintended behavior snapshot 📷

Comments

@gaborcsardi
Copy link
Member

In general it fails if there is on png() device.

TBH I am not sure if it is testthat's business to deal with graphic output at all, but at this point we might not be able to change this.

We could still use a more minimal device, e.g. the devoid package could be handy here?

@hadley hadley added bug an unexpected problem or unintended behavior snapshot 📷 labels Apr 13, 2020
gaborcsardi added a commit to r-lib/webfakes that referenced this issue Apr 14, 2020
@gaborcsardi
Copy link
Member Author

gaborcsardi commented Apr 22, 2020

I am not sure why but if there is a png() device, but there is no X11 support, it still fails. Probably because png() uses X11 by default, and will not fall back to cairo, even if there is no X11.

So this is my current workaround:

skip_without_png_device <- function() {
  if (.Platform$OS.type == "windows") return()
  if (! capabilities("png") || ! capabilities("X11")) {
    skip("Needs a PNG device")
  }
}

hadley added a commit that referenced this issue Jun 16, 2020
I experimented with getting rid of the device all together, but I couldn't get it to work, likely because of the hoops that evaluate jumps through to capture graphics device state. I think pdf() should work everywhere.

Fixes #1011
hadley added a commit that referenced this issue Jun 17, 2020
I experimented with getting rid of the device all together, but I couldn't get it to work, likely because of the hoops that evaluate jumps through to capture graphics device state. I think pdf() should work everywhere.

Fixes #1011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior snapshot 📷
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants