#!/usr/bin/python import os Import("env", "UnitTest", "testing_group") res = [] core_objs = [] def CoreTest(name): global core_objs test = name.split("/")[-1] source = "%s.c" % test if os.path.exists("%s.cpp" % test): source = "%s.cpp" % test 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) ] run = UnitTest("core/%s" % name, [ test ] + core_objs) Alias("tests/core", run) if len(res) > 0 and testing_group(["tests/core"]): Depends(run, res[-1]) return run Export("core_objs", "CoreTest") res += [ CoreTest("version") ] res += [ CoreTest("string") ] res += [ CoreTest("random") ] res += [ CoreTest("file") ] res += [ CoreTest("date") ] res += SConscript("containers/Sconscript") res += [ CoreTest("filter") ] res += [ CoreTest("idle") ] res += SConscript("tags/Sconscript") res += [ CoreTest("queue") ] res += [ CoreTest("playlist") ] res += [ CoreTest("collection") ] res += [ CoreTest("history") ] res += [ CoreTest("tempq") ] res += [ CoreTest("audio") ] Return("res")