Fix stalling of keytests when invalid DISPLAY

Before, the keytests would run infinitely if the
tests were run, e.g. through SSH without X forwarding.
To reproduce that problem, run

  DISPLAY='' ctest -R hello

This commit causes the test to correctly fail in such situations.
(Collaboration with Scott Kostyshak)
This commit is contained in:
Kornel Benko 2014-08-25 13:45:32 +02:00
parent 742ba333bf
commit f2937e676a

View File

@ -48,6 +48,12 @@ else()
set(LYX_WINDOW_NAME "") set(LYX_WINDOW_NAME "")
endif() endif()
#check for plausible DISPLAY environment (needed bei keytests)
set(DISPLAY_VAR $ENV{DISPLAY})
if(NOT DISPLAY_VAR MATCHES "^[a-zA-Z\\.]*:[0-9]+\(\\.[0-9]+\)?$")
message(FATAL_ERROR "Invalid DISPLAY environment value (== '${DISPLAY_VAR}')")
endif()
set(LYX_EXE "${BINDIR}/${LYX}") set(LYX_EXE "${BINDIR}/${LYX}")
set(use_hacked $ENV{XVKBD_HACKED}) set(use_hacked $ENV{XVKBD_HACKED})
if(NOT use_hacked) if(NOT use_hacked)