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 <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-04-11 15:02:24 -04:00
parent abf9cfe90e
commit 811270a832
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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])