2014-06-14 10:50:18 -04:00
|
|
|
#!/usr/bin/python
|
2015-08-21 00:48:23 -04:00
|
|
|
import os
|
2015-12-11 11:01:02 -05:00
|
|
|
Import("env", "UnitTest", "testing_group")
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2015-12-11 11:01:02 -05:00
|
|
|
res = []
|
2015-08-27 09:04:21 -04:00
|
|
|
core_objs = []
|
2015-12-11 11:01:02 -05:00
|
|
|
|
2015-12-11 14:52:52 -05:00
|
|
|
def CoreTest(name):
|
2015-08-27 09:04:21 -04:00
|
|
|
global core_objs
|
2015-12-11 14:12:54 -05:00
|
|
|
|
2015-12-11 14:52:52 -05:00
|
|
|
test = name.split("/")[-1]
|
|
|
|
source = "%s.c" % test
|
|
|
|
if os.path.exists("%s.cpp" % test):
|
|
|
|
source = "%s.cpp" % test
|
|
|
|
|
2015-12-11 14:12:54 -05:00
|
|
|
test = os.path.abspath(source)
|
|
|
|
core = os.path.sep.join([x for x in test.split("/") if x != "tests"])
|
|
|
|
if os.path.exists(core):
|
|
|
|
core_objs += [ env.Object(core) ]
|
2015-12-11 14:52:52 -05:00
|
|
|
|
2015-12-11 14:12:54 -05:00
|
|
|
run = UnitTest("core/%s" % name, [ test ] + core_objs)
|
2015-08-21 00:48:23 -04:00
|
|
|
Alias("tests/core", run)
|
2015-12-11 11:01:02 -05:00
|
|
|
if len(res) > 0 and testing_group(["tests/core"]):
|
|
|
|
Depends(run, res[-1])
|
2015-08-21 00:48:23 -04:00
|
|
|
return run
|
2015-12-11 14:12:54 -05:00
|
|
|
Export("core_objs", "CoreTest")
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
|
2015-12-11 14:52:52 -05:00
|
|
|
res += [ CoreTest("version") ]
|
|
|
|
res += [ CoreTest("string") ]
|
|
|
|
res += [ CoreTest("random") ]
|
|
|
|
res += [ CoreTest("file") ]
|
|
|
|
res += [ CoreTest("date") ]
|
2015-11-30 09:39:53 -05:00
|
|
|
|
2015-12-11 14:12:54 -05:00
|
|
|
res += SConscript("containers/Sconscript")
|
2015-12-11 14:52:52 -05:00
|
|
|
res += [ CoreTest("filter") ]
|
|
|
|
res += [ CoreTest("idle") ]
|
2015-08-27 09:04:21 -04:00
|
|
|
|
2015-12-11 14:12:54 -05:00
|
|
|
res += SConscript("tags/Sconscript")
|
2015-12-11 14:52:52 -05:00
|
|
|
res += [ CoreTest("queue") ]
|
|
|
|
res += [ CoreTest("playlist") ]
|
|
|
|
res += [ CoreTest("collection") ]
|
2015-12-12 09:04:25 -05:00
|
|
|
res += [ CoreTest("history") ]
|
2015-12-14 13:55:50 -05:00
|
|
|
res += [ CoreTest("tempq") ]
|
2015-12-15 08:16:06 -05:00
|
|
|
|
|
|
|
core_objs += [ env.Object("../../core/core.cpp") ]
|
2015-12-11 14:52:52 -05:00
|
|
|
res += [ CoreTest("audio") ]
|
2015-08-31 08:11:24 -04:00
|
|
|
|
2015-08-21 00:48:23 -04:00
|
|
|
Return("res")
|