|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57391 - in sandbox/SCons: libs/python/test tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-11-04 19:03:44
Author: loonycyborg
Date: 2009-11-04 19:03:43 EST (Wed, 04 Nov 2009)
New Revision: 57391
URL: http://svn.boost.org/trac/boost/changeset/57391
Log:
Added support for building the most of boost.python's regression tests.
Added:
sandbox/SCons/libs/python/test/SConscript (contents, props changed)
Text files modified:
sandbox/SCons/libs/python/test/args.py | 4 ++--
sandbox/SCons/tools/scons/boost-configure.py | 5 ++++-
sandbox/SCons/tools/scons/boost-libs.py | 6 +++---
sandbox/SCons/tools/scons/boost-tests.py | 13 ++++++++++---
4 files changed, 19 insertions(+), 9 deletions(-)
Added: sandbox/SCons/libs/python/test/SConscript
==============================================================================
--- (empty file)
+++ sandbox/SCons/libs/python/test/SConscript 2009-11-04 19:03:43 EST (Wed, 04 Nov 2009)
@@ -0,0 +1,115 @@
+# vi: syntax=python:et:ts=4
+Import("env")
+
+if not (env.CheckPython() and env["LINK_DYNAMIC"]):
+ Return()
+
+def BPLTest(env, name, sources = None, script = None):
+ run = env.BoostRunPythonScript(name + ".py")
+ if sources:
+ for source in sources:
+ Depends(run,
+ env.PythonExtension(source != name and source or (source + "_ext"), source + ".cpp")
+ )
+ else:
+ Depends(run, env.PythonExtension(name + "_ext", name + ".cpp"))
+env.AddMethod(BPLTest)
+
+env.AppendENVPath('PYTHONPATH', Dir('.').path)
+
+env.BPLTest("crossmod_exception", ["crossmod_exception_a", "crossmod_exception_b"])
+for test in Split("""
+ injected
+ properties
+ return_arg
+ staticmethod
+ shared_ptr
+ enable_shared_from_this
+ andreas_beyer
+ polymorphism
+ polymorphism2
+
+ wrapper_held_type
+ polymorphism2_auto_ptr
+
+ auto_ptr
+
+ minimal
+ args
+ raw_ctor
+ numpy
+ enum
+ exception_translator
+ """):
+ env.BPLTest(test)
+env.BPLTest("test_cltree", ["cltree"])
+env.BPLTest("newtest", ["m1", "m2"])
+env.BPLTest("const_argument")
+env.BPLTest("keywords_test", ["keywords"])
+Depends(
+ env.BoostRunPythonScript("test_builtin_converters.py"),
+ env.PythonExtension("builtin_converters_ext", "test_builtin_converters.cpp")
+ )
+for test in Split("""
+ test_pointer_adoption
+ operators
+ operators_wrapper
+ callbacks
+ defaults
+
+ object
+ list
+ long
+ dict
+ tuple
+ str
+ slice
+
+ virtual_functions
+ back_reference
+ implicit
+ data_members
+
+ ben_scott1
+
+ bienstman1
+ bienstman2
+ bienstman3
+
+ multi_arg_constructor
+ """):
+ env.BPLTest(test)
+env.BPLTest("iterator", ["iterator", "input_iterator"])
+env.BPLTest("stl_iterator")
+
+env.BPLTest("extract")
+
+env.BPLTest("crossmod_opaque", ["crossmod_opaque_a", "crossmod_opaque_b"])
+
+for test in Split("""
+ opaque
+ voidptr
+
+ pickle1
+ pickle2
+ pickle3
+ pickle4
+
+ nested
+
+ docstring
+ pytype_function
+
+ vector_indexing_suite
+
+ pointer_vector
+ """):
+ env.BPLTest(test)
+Depends(
+ env.BoostRunPythonScript("map_indexing_suite.py"),
+ env.PythonExtension("map_indexing_suite_ext", [
+ "map_indexing_suite.cpp",
+ "int_map_indexing_suite.cpp",
+ "a_map_indexing_suite.cpp"])
+ )
+env.BoostRunTest("import_", "import_.cpp", "./${SOURCES[0]} ${SOURCES[1]}", "import_.py")
Modified: sandbox/SCons/libs/python/test/args.py
==============================================================================
--- sandbox/SCons/libs/python/test/args.py (original)
+++ sandbox/SCons/libs/python/test/args.py 2009-11-04 19:03:43 EST (Wed, 04 Nov 2009)
@@ -139,8 +139,8 @@
import sys
status = run()[0]
if (status == 0): print "Done."
- import args_ext
- help(args_ext)
+ #import args_ext
+ #help(args_ext)
sys.exit(status)
Modified: sandbox/SCons/tools/scons/boost-configure.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-configure.py (original)
+++ sandbox/SCons/tools/scons/boost-configure.py 2009-11-04 19:03:43 EST (Wed, 04 Nov 2009)
@@ -34,7 +34,10 @@
class CheckPython(DependencyChecker):
def Check(self, env):
import distutils.sysconfig
- self.flags = dict(CPPPATH = [distutils.sysconfig.get_python_inc()])
+ self.flags = dict(
+ CPPPATH = [distutils.sysconfig.get_python_inc()],
+ LIBPATH = [distutils.sysconfig.PREFIX + "/lib"],
+ LIBS = "python" + distutils.sysconfig.get_config_var('VERSION'))
env.AppendUnique(**self.flags)
self.have_dep = self.conf.CheckCHeader("Python.h")
Modified: sandbox/SCons/tools/scons/boost-libs.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-libs.py (original)
+++ sandbox/SCons/tools/scons/boost-libs.py 2009-11-04 19:03:43 EST (Wed, 04 Nov 2009)
@@ -27,9 +27,9 @@
def PythonExtension(env, lib, sources, **kw):
if env["LINK_DYNAMIC"]:
- env.Alias(lib,
- env.SharedLibrary(lib, sources, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), **kw)
- )
+ ext = env.SharedLibrary(lib, sources, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), **kw)
+ env.Alias(lib, ext)
+ return ext
def boost_copy_func(dest, source, env):
import os, stat, shutil
Modified: sandbox/SCons/tools/scons/boost-tests.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-tests.py (original)
+++ sandbox/SCons/tools/scons/boost-tests.py 2009-11-04 19:03:43 EST (Wed, 04 Nov 2009)
@@ -9,10 +9,15 @@
def BoostCompileTest(env, test, source = None, **kw):
env.Alias("$BOOST_LIB", env.Object(test, (source is None) and (test + ".cpp") or source), **kw)
- def BoostRunTest(env, test, source = None, **kw):
+ def BoostRun(env, prog, name, command = "./$SOURCE"):
+ run = env.Command("$BOOST_LIB-"+name, prog, command)
+ env.Alias("$BOOST_LIB", run)
+ return run
+ def BoostRunPythonScript(env, script):
+ return env.BoostRun(env.File(script), "run-" + script, "python $SOURCE")
+ def BoostRunTest(env, test, source = None, command = "./$SOURCE", command_sources = [], **kw):
test_prog = env.Program(test, (source is None) and (test + ".cpp") or source, **kw)
- test = env.Command("$BOOST_LIB-"+test, test_prog, "./$SOURCE")
- env.Alias("$BOOST_LIB", test)
+ return env.BoostRun([test_prog, command_sources], test, command)
def BoostRunTests(env, tests, **kw):
for test in Flatten(tests):
env.BoostRunTest(test, **kw)
@@ -20,6 +25,8 @@
for test in Flatten(tests):
env.BoostCompileTest(test, **kw)
env.AddMethod(BoostCompileTest)
+ env.AddMethod(BoostRun)
+ env.AddMethod(BoostRunPythonScript)
env.AddMethod(BoostRunTest)
env.AddMethod(BoostRunTests)
env.AddMethod(BoostCompileTests)
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk