From 811270a8326ccca1c726a3052f1c545239b26807 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 11 Apr 2016 15:02:24 -0400 Subject: [PATCH] build: Don't run gui tests if $DISPLAY is not set I have tests running on ocarinaproject.net, which is headless and doesn't run an X server. Gui tests cann't run without an X server. Signed-off-by: Anna Schumaker --- Sconstruct | 3 ++- tests/Sconscript | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sconstruct b/Sconstruct index d2baeb03..bcec18d2 100644 --- a/Sconstruct +++ b/Sconstruct @@ -18,7 +18,8 @@ class OEnvironment(Environment): self.Append(CXXCOMSTR = "C++ $TARGET") self.Append(CCCOMSTR = "CC $TARGET") self.Append(LINKCOMSTR = "Linking $TARGET") - self.Append(ENV = { "DISPLAY" : os.environ["DISPLAY"] }) + if "DISPLAY" in os.environ.keys(): + self.Append(ENV = { "DISPLAY" : os.environ["DISPLAY"] }) self.Debug = CONFIG_DEBUG self.Version = CONFIG_VERSION diff --git a/tests/Sconscript b/tests/Sconscript index f7e1fbd2..1ffaf4d8 100644 --- a/tests/Sconscript +++ b/tests/Sconscript @@ -37,7 +37,10 @@ SConscript("Music/Sconscript") res = UnitTest("sanity", [ "sanity.c" ]) res += SConscript("core/Sconscript") -res += SConscript("gui/Sconscript") + +if "DISPLAY" in os.environ.keys(): + res += SConscript("gui/Sconscript") + if check_sanity == True: for t in res[1:]: Depends(t, res[0])