tests: Remove unused testing options
I never really did anything with cppcheck or gcov, so I'm removing these options. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
159f6098f3
commit
8128e5b5e1
|
@ -5,8 +5,6 @@ import os
|
||||||
CONFIG_VERSION = "6.3"
|
CONFIG_VERSION = "6.3"
|
||||||
CONFIG_DEBUG = True
|
CONFIG_DEBUG = True
|
||||||
CONFIG_TEST_VALGRIND = False
|
CONFIG_TEST_VALGRIND = False
|
||||||
CONFIG_TEST_COVERAGE = False
|
|
||||||
CONFIG_TEST_CPPCHECK = False
|
|
||||||
|
|
||||||
|
|
||||||
# Set up default environment
|
# Set up default environment
|
||||||
|
@ -18,8 +16,6 @@ class OEnvironment(Environment):
|
||||||
Debug = False
|
Debug = False
|
||||||
Version = 0
|
Version = 0
|
||||||
Valgrind = False
|
Valgrind = False
|
||||||
Coverage = False
|
|
||||||
CppCheck = False
|
|
||||||
|
|
||||||
def __init__(self, CCFLAGS = CONFIG_CCFLAGS):
|
def __init__(self, CCFLAGS = CONFIG_CCFLAGS):
|
||||||
Environment.__init__(self, CCFLAGS = CCFLAGS)
|
Environment.__init__(self, CCFLAGS = CCFLAGS)
|
||||||
|
@ -30,8 +26,6 @@ class OEnvironment(Environment):
|
||||||
self.Debug = CONFIG_DEBUG
|
self.Debug = CONFIG_DEBUG
|
||||||
self.Version = CONFIG_VERSION
|
self.Version = CONFIG_VERSION
|
||||||
self.Valgrind = CONFIG_TEST_VALGRIND
|
self.Valgrind = CONFIG_TEST_VALGRIND
|
||||||
self.Coverage = CONFIG_TEST_COVERAGE
|
|
||||||
self.CppCheck = CONFIG_TEST_CPPCHECK
|
|
||||||
|
|
||||||
def UsePackage(self, name):
|
def UsePackage(self, name):
|
||||||
self.ParseConfig("pkg-config --cflags --libs %s" % name)
|
self.ParseConfig("pkg-config --cflags --libs %s" % name)
|
||||||
|
@ -47,9 +41,6 @@ lib = SConscript("lib/Sconscript")
|
||||||
gui = SConscript("gui/Sconscript")
|
gui = SConscript("gui/Sconscript")
|
||||||
|
|
||||||
tests = SConscript("tests/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)
|
ocarina = env.Program("bin/ocarina", core + lib + gui)
|
||||||
|
|
|
@ -1,31 +1,14 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
Import("test_env")
|
Import("test_env")
|
||||||
|
|
||||||
test_env.UsePackage("glib-2.0")
|
|
||||||
test_env.DEBUG = True
|
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 = ""
|
valgrind = ""
|
||||||
if test_env.Valgrind == True:
|
if test_env.Valgrind == True:
|
||||||
valgrind = "valgrind -q --leak-check=full --error-exitcode=42"
|
valgrind = "valgrind -q --error-exitcode=42"
|
||||||
gcov = "gcov -r tests/%s/*.gcda"
|
|
||||||
res = []
|
res = []
|
||||||
|
|
||||||
|
|
||||||
def all_tests_enabled(dir):
|
def all_tests_enabled(dir):
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
arg = os.path.normpath(arg)
|
arg = os.path.normpath(arg)
|
||||||
|
@ -52,52 +35,23 @@ def generic_test(name, dir, objs, extra):
|
||||||
global valgrind
|
global valgrind
|
||||||
|
|
||||||
obj = get_test_obj(name, dir)
|
obj = get_test_obj(name, dir)
|
||||||
|
test_objs = extra
|
||||||
if obj != None:
|
if obj != None:
|
||||||
objs += [ obj ]
|
objs += [ obj ]
|
||||||
test_objs = extra + objs
|
test_objs = extra + objs
|
||||||
else:
|
|
||||||
test_objs = extra
|
|
||||||
|
|
||||||
exe = test_env.Program(name, [ "%s.cpp" % name ] + test_objs)
|
exe = test_env.Program(name, [ "%s.cpp" % name ] + test_objs)
|
||||||
test = Command("%s.fake" % name, [], "%s tests/%s/%s" % (valgrind, dir, name));
|
test = Command("%s.fake" % name, [], "%s tests/%s/%s" % (valgrind, dir, name))
|
||||||
|
|
||||||
Alias("tests/%s/%s" % (dir, name), test)
|
Alias("tests/%s/%s" % (dir, name), test)
|
||||||
Depends(test, exe)
|
Depends(test, exe)
|
||||||
add_test(test, dir)
|
add_test(test, dir)
|
||||||
return objs
|
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")
|
Export("get_test_obj", "generic_test")
|
||||||
|
|
||||||
|
SConscript("core/Sconscript")
|
||||||
core = SConscript("core/Sconscript")
|
SConscript("lib/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])
|
|
||||||
|
|
||||||
Return("res")
|
Return("res")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user