diff --git a/SConstruct b/SConstruct index 893dd4185b41d7721d1be2294879e4d25f5fa502..ab0aaf08c6c234e054266c70a2a17cf6820bcb55 100644 --- a/SConstruct +++ b/SConstruct @@ -114,6 +114,8 @@ else: lib = env.SConscript(["src/SConscript"]) env.Alias(env.SConscript(["examples/SConscript"])) -env.Alias("test", testruns) +print testruns +for testrun in testruns: + env.Alias("test", testrun) env.Alias("install", targets) diff --git a/src/bindings/perl/SConscript b/src/bindings/perl/SConscript index 52bc4bc5602d7d4eb576e1fe171604b23404cc46..90e6afcc425a2c3ff522d48811d4c12fb8d19503 100644 --- a/src/bindings/perl/SConscript +++ b/src/bindings/perl/SConscript @@ -1,19 +1,34 @@ # -*- python -*- -Import("env libhammer_shared") +import os.path +Import("env libhammer_shared testruns targets") perlenv = env.Clone() -perlenv.Append(CCFLAGS=["-fpic", '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error', '-DHAMMER_INTERNAL__NO_STDARG_H'], +perlenv.Append(CCFLAGS=["-fpic", '-DSWIG', '-Wno-all', + '-Wno-extra', '-Wno-error', + '-DHAMMER_INTERNAL__NO_STDARG_H'], CPPPATH=["../.."], LIBS=['hammer'], LIBPATH=["../.."], - SWIGFLAGS=["-DHAMMER_INTERNAL__NO_STDARG_H", "-Isrc/", "-perl"]) + SWIGFLAGS=["-DHAMMER_INTERNAL__NO_STDARG_H", + "-Isrc/", "-perl"]) -perlenv.ParseConfig("perl -MConfig -e 'print(qq[-I$$Config{archlib}/CORE\n]);'") -perlenv.ParseConfig("perl -MConfig -e 'print($$Config{ccflags} . \"\n\");'") +perlenv.ParseConfig("perl -MConfig -e'print(qq[-I$$Config{archlib}/CORE\n]);'") +perlenv.ParseConfig("perl -MConfig -e'print($$Config{ccflags} . \"\n\");'") swig = ['hammer.i'] libhammer_perl = perlenv.SharedLibrary('hammer', swig, SHLIBPREFIX='') +Default(libhammer_perl) + +perltestenv = perlenv.Clone() +perltestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0])) +perltests = ['t/hammer.t'] +perltestexec = perltestenv.Command(None, perltests + libhammer_perl + libhammer_shared, "pwd && prove -I%(perldir)s %(perldir)s/t" % dict(perldir=os.path.dirname(str(libhammer_perl[0].path)))) +perltest = Alias("testperl", [perltestexec], perltestexec) +AlwaysBuild(perltestexec) +testruns.append(perltest) + + print "Reading perl sconscript" diff --git a/src/bindings/python/SConscript b/src/bindings/python/SConscript index d91a942300a17def47bf3188c3fe34f82ccdf8d2..e7b956fac0b8f7ead58797d456834f35f8914f5c 100644 --- a/src/bindings/python/SConscript +++ b/src/bindings/python/SConscript @@ -15,8 +15,8 @@ pytestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0])) pytests = ['hammer_tests.py'] pytestexec = pytestenv.Command(['hammer.pyc', 'hammer_tests.pyc'], pytests + libhammer_python, "LD_LIBRARY_PATH=" + os.path.dirname(str(libhammer_shared[0])) + " nosetests -vv $SOURCE") pytest = Alias("testpython", [pytestexec], pytestexec) -AlwaysBuild(pytest) -testruns.append(pytest) +AlwaysBuild(pytestexec) +testruns.extend(pytest) pyinstallexec = pythonenv.Command(None, libhammer_python, 'python ' + os.path.join(pydir, 'setup.py ') + ' install') pyinstall = Alias("installpython", [pyinstallexec], pyinstallexec) diff --git a/src/test_suite.c b/src/test_suite.c index e065f138ece71d5b09c4aa0e1060a2e944f1d283..81f86b2c5007f11375995ad50751dfcb4618b7f5 100644 --- a/src/test_suite.c +++ b/src/test_suite.c @@ -35,7 +35,8 @@ int main(int argc, char** argv) { register_parser_tests(); register_grammar_tests(); register_misc_tests(); - register_benchmark_tests(); + if (g_test_slow() || g_test_perf()) + register_benchmark_tests(); g_test_run(); }