ocarina/tests/Sconscript
Anna Schumaker f23fb9e0f5 gui/settings: Add new settings file
The settings layer will track various configuration options set by the
user.  This belongs in the gui, and not core, because it controls
settings specific to this gui implementation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00

46 lines
980 B
Python

#!/usr/bin/python
import sys, os
Import("env")
tests = []
for arg in sys.argv[1:]:
if arg.find("tests") == 0:
tests += [ arg ]
if len(tests) == 0:
Return()
def testing_group(group):
group = [ "tests" ] + group
for arg in tests:
if arg in set(group + [ g + "/" for g in group]):
return True
return False
check_sanity = testing_group([])
env.Append(CCFLAGS = "-DCONFIG_TESTING")
env.UsePackage("glib-2.0")
test_o = env.Object("test", "test.c")
def UnitTest(test, sources):
name = os.path.basename(test)
make = env.Program(name, sources + [ test_o ])
run = Command("%s.fake" % name, [], "tests/%s" % test)
Depends(run, make)
Alias("tests/%s" % test, run)
return run
Export("UnitTest", "testing_group")
#Generate empty audio files
SConscript("Music/Sconscript")
res = UnitTest("sanity", [ "sanity.c" ])
res += SConscript("core/Sconscript")
res += SConscript("gui/Sconscript")
if check_sanity == True:
for t in res[1:]:
Depends(t, res[0])
Return("res")