2014-06-14 10:50:18 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
import sys, os
|
|
|
|
Import("test_env")
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
all = False
|
|
|
|
for arg in sys.argv[1:]:
|
|
|
|
arg = os.path.normpath(arg)
|
|
|
|
name = os.path.basename(arg)
|
|
|
|
if (arg.find("tests") == 0) and (name == "tests"):
|
|
|
|
all = True
|
|
|
|
if (arg.find("tests/core") == 0) and (name == "core"):
|
|
|
|
all = True
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
res = []
|
|
|
|
objs = []
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
def get_core_obj(name):
|
|
|
|
global objs
|
|
|
|
if not os.path.exists("../../core/%s.cpp" % name):
|
|
|
|
return []
|
|
|
|
objs += test_env.Object("%s.cpp-core" % name, "../../core/%s.cpp" % name)
|
|
|
|
return objs
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
def add_test(test):
|
|
|
|
global all
|
|
|
|
global res
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
if (all == True) and (len(res) > 0):
|
|
|
|
Depends(test, res[-1])
|
|
|
|
res += [ test ]
|
2014-06-14 10:50:18 -04:00
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
def test(name):
|
|
|
|
extra = get_core_obj(name)
|
|
|
|
exe = test_env.Program(name, [ "%s.cpp" % name ] + extra)
|
|
|
|
test = Command("%s.fake" % name, [], "tests/core/%s" % name);
|
|
|
|
Alias("tests/core/%s" % name, test)
|
|
|
|
Depends(test, exe)
|
|
|
|
add_test(test)
|
2014-06-14 10:50:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-01 13:13:31 -04:00
|
|
|
###
|
|
|
|
#
|
|
|
|
# Test configuration starts here
|
|
|
|
#
|
|
|
|
|
|
|
|
test( "version" )
|
|
|
|
test( "file" )
|
|
|
|
test( "database" )
|
|
|
|
test( "index" )
|
|
|
|
test( "filter" )
|
|
|
|
test( "idle" )
|
|
|
|
|
|
|
|
test_env.UsePackage("taglib")
|
|
|
|
test( "tags" )
|
|
|
|
test( "random" )
|
|
|
|
|
|
|
|
get_core_obj("callback")
|
|
|
|
test( "queue" )
|
|
|
|
test( "library" )
|
|
|
|
test( "playlist" )
|
|
|
|
test( "deck" )
|
|
|
|
test( "driver" )
|
|
|
|
test( "audio" )
|
|
|
|
|
2014-06-14 10:50:18 -04:00
|
|
|
|
|
|
|
Return("res")
|