Perl tests are now part of the build system
This commit is contained in:
parent
8c44d583e6
commit
2f3bc9c4b0
4 changed files with 27 additions and 9 deletions
|
|
@ -114,6 +114,8 @@ else:
|
||||||
lib = env.SConscript(["src/SConscript"])
|
lib = env.SConscript(["src/SConscript"])
|
||||||
env.Alias(env.SConscript(["examples/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)
|
env.Alias("install", targets)
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,17 @@
|
||||||
# -*- python -*-
|
# -*- python -*-
|
||||||
Import("env libhammer_shared")
|
import os.path
|
||||||
|
Import("env libhammer_shared testruns targets")
|
||||||
|
|
||||||
perlenv = env.Clone()
|
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=["../.."],
|
CPPPATH=["../.."],
|
||||||
LIBS=['hammer'],
|
LIBS=['hammer'],
|
||||||
LIBPATH=["../.."],
|
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(qq[-I$$Config{archlib}/CORE\n]);'")
|
||||||
perlenv.ParseConfig("perl -MConfig -e'print($$Config{ccflags} . \"\n\");'")
|
perlenv.ParseConfig("perl -MConfig -e'print($$Config{ccflags} . \"\n\");'")
|
||||||
|
|
@ -16,4 +20,15 @@ swig = ['hammer.i']
|
||||||
|
|
||||||
libhammer_perl = perlenv.SharedLibrary('hammer', swig, SHLIBPREFIX='')
|
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"
|
print "Reading perl sconscript"
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ pytestenv['ENV']['LD_LIBRARY_PATH'] = os.path.dirname(str(libhammer_shared[0]))
|
||||||
pytests = ['hammer_tests.py']
|
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")
|
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)
|
pytest = Alias("testpython", [pytestexec], pytestexec)
|
||||||
AlwaysBuild(pytest)
|
AlwaysBuild(pytestexec)
|
||||||
testruns.append(pytest)
|
testruns.extend(pytest)
|
||||||
|
|
||||||
pyinstallexec = pythonenv.Command(None, libhammer_python, 'python ' + os.path.join(pydir, 'setup.py ') + ' install')
|
pyinstallexec = pythonenv.Command(None, libhammer_python, 'python ' + os.path.join(pydir, 'setup.py ') + ' install')
|
||||||
pyinstall = Alias("installpython", [pyinstallexec], pyinstallexec)
|
pyinstall = Alias("installpython", [pyinstallexec], pyinstallexec)
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ int main(int argc, char** argv) {
|
||||||
register_parser_tests();
|
register_parser_tests();
|
||||||
register_grammar_tests();
|
register_grammar_tests();
|
||||||
register_misc_tests();
|
register_misc_tests();
|
||||||
|
if (g_test_slow() || g_test_perf())
|
||||||
register_benchmark_tests();
|
register_benchmark_tests();
|
||||||
|
|
||||||
g_test_run();
|
g_test_run();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue