ocarina/tests/core/Sconscript

69 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/usr/bin/python
import sys, os
Import("test_env")
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
res = []
objs = []
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
def add_test(test):
global all
global res
if (all == True) and (len(res) > 0):
Depends(test, res[-1])
res += [ test ]
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)
###
#
# 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" )
Return("res")