diff --git a/Sconstruct b/Sconstruct index 301fdbde..e7f739f3 100644 --- a/Sconstruct +++ b/Sconstruct @@ -5,8 +5,6 @@ import os CONFIG_VERSION = "6.3" CONFIG_DEBUG = True CONFIG_TEST_VALGRIND = False -CONFIG_TEST_COVERAGE = False -CONFIG_TEST_CPPCHECK = False # Set up default environment @@ -18,8 +16,6 @@ class OEnvironment(Environment): Debug = False Version = 0 Valgrind = False - Coverage = False - CppCheck = False def __init__(self, CCFLAGS = CONFIG_CCFLAGS): Environment.__init__(self, CCFLAGS = CCFLAGS) @@ -30,8 +26,6 @@ class OEnvironment(Environment): self.Debug = CONFIG_DEBUG self.Version = CONFIG_VERSION self.Valgrind = CONFIG_TEST_VALGRIND - self.Coverage = CONFIG_TEST_COVERAGE - self.CppCheck = CONFIG_TEST_CPPCHECK def UsePackage(self, name): self.ParseConfig("pkg-config --cflags --libs %s" % name) @@ -47,9 +41,6 @@ lib = SConscript("lib/Sconscript") gui = SConscript("gui/Sconscript") tests = SConscript("tests/Sconscript") -Clean(tests, Glob("*.gcov")) -Clean(tests, Glob("tests/*.gcda")) -Clean(tests, Glob("tests/*.gcno")) ocarina = env.Program("bin/ocarina", core + lib + gui) diff --git a/tests/Sconscript b/tests/Sconscript index e29e0ca1..f9c24411 100644 --- a/tests/Sconscript +++ b/tests/Sconscript @@ -1,31 +1,14 @@ #!/usr/bin/python - import sys, os Import("test_env") -test_env.UsePackage("glib-2.0") test_env.DEBUG = True -if test_env.Coverage == True: - test_env.Append( CCFLAGS = [ "--coverage" ] ) - test_env.Append( LINKFLAGS = [ "-lgcov", "-coverage" ] ) -check_depends = True - -for arg in sys.argv: - if arg.find("tests/core") == 0 and len(arg) > 11: - check_depends = False - break - if arg.find("tests/lib") == 0 and len(arg) > 10: - check_depends = False - break - valgrind = "" if test_env.Valgrind == True: - valgrind = "valgrind -q --leak-check=full --error-exitcode=42" -gcov = "gcov -r tests/%s/*.gcda" + valgrind = "valgrind -q --error-exitcode=42" res = [] - def all_tests_enabled(dir): for arg in sys.argv[1:]: arg = os.path.normpath(arg) @@ -52,52 +35,23 @@ def generic_test(name, dir, objs, extra): global valgrind obj = get_test_obj(name, dir) + test_objs = extra if obj != None: objs += [ obj ] test_objs = extra + objs - else: - test_objs = extra - exe = test_env.Program(name, [ "%s.cpp" % name ] + test_objs) - test = Command("%s.fake" % name, [], "%s tests/%s/%s" % (valgrind, dir, name)); + exe = test_env.Program(name, [ "%s.cpp" % name ] + test_objs) + test = Command("%s.fake" % name, [], "%s tests/%s/%s" % (valgrind, dir, name)) + Alias("tests/%s/%s" % (dir, name), test) Depends(test, exe) add_test(test, dir) return objs - -class TestList: - def __init__(self, subdir, tests): - self.subdir = subdir - self.tests = tests - - f = open(".gitignore", "w") - for t in tests: - f.write(t.Name + "\n") - f.close() - - def prepare(self): - res = [] - for t in self.tests: - res += [ t.prepare(self.subdir) ] - - if test_env.Coverage == True: - res += [ Command("%s.gcov" % self.subdir, [], gcov % self.subdir) ] - Depends(res[len(res) - 1], res[len(res) - 2]) - AlwaysBuild(res[len(res) - 1]) - return res - -Export("OTest", "TestList") Export("get_test_obj", "generic_test") - -core = SConscript("core/Sconscript") -lib = SConscript("lib/Sconscript") - -#res = [ core, lib ] -if test_env.CppCheck == True: - res += [ Command("cpp.check", [], "cppcheck -q --error-exitcode=42 .") ] - Depends(res[len(res) - 1], res[len(res) - 2]) +SConscript("core/Sconscript") +SConscript("lib/Sconscript") Return("res")