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-21 10:15:27 -05:00
|
|
|
ignore = open(".gitignore", "w")
|
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-21 10:15:27 -05:00
|
|
|
ignore.write("%s\n" % name)
|
2015-12-17 10:32:01 -05:00
|
|
|
source = "%s.c" % name.split("/")[-1]
|
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("file") ]
|
|
|
|
res += [ CoreTest("date") ]
|
2016-02-26 09:23:52 -05:00
|
|
|
res += [ CoreTest("idle") ]
|
2016-04-29 11:18:44 -04:00
|
|
|
res += [ CoreTest("database") ]
|
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") ]
|
2016-04-24 10:36:15 -04:00
|
|
|
|
|
|
|
res += SConscript("playlists/Sconscript")
|
2015-12-11 14:52:52 -05:00
|
|
|
res += [ CoreTest("playlist") ]
|
2015-12-14 13:55:50 -05:00
|
|
|
res += [ CoreTest("tempq") ]
|
2015-12-15 08:16:06 -05:00
|
|
|
|
2015-12-17 10:32:01 -05:00
|
|
|
core_objs += [ env.Object("../../core/core.c") ]
|
2015-12-11 14:52:52 -05:00
|
|
|
res += [ CoreTest("audio") ]
|
2015-08-31 08:11:24 -04:00
|
|
|
|
2015-12-21 10:15:27 -05:00
|
|
|
ignore.close()
|
2015-08-21 00:48:23 -04:00
|
|
|
Return("res")
|