diff options
author | Mats Wichmann <mats@linux.com> | 2018-08-15 14:16:11 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2018-08-15 14:16:11 (GMT) |
commit | 52ecb92eb30698b67de2662a892e20be3f1fda20 (patch) | |
tree | 4f93ce6501a5fa057005b5e5a72b4e819d9343de /test/SWIG | |
parent | 2a39eb278ecca56f66011f2d602e12b924ad0e2c (diff) | |
download | SCons-52ecb92eb30698b67de2662a892e20be3f1fda20.zip SCons-52ecb92eb30698b67de2662a892e20be3f1fda20.tar.gz SCons-52ecb92eb30698b67de2662a892e20be3f1fda20.tar.bz2 |
Move checking for python header to common location
A previous change added a check for Python.h in one SWIG test which did
not have it which turns that test into a skip instead of a fail if the
header is not installed. It was pointed out that having 12 tests check
for the same thing might be optimised by putting the check in the routine
which returns info about the python development environment, so this
change makes that modification.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/SWIG')
-rw-r--r-- | test/SWIG/SWIGOUTDIR-python.py | 6 | ||||
-rw-r--r-- | test/SWIG/build-dir.py | 6 | ||||
-rw-r--r-- | test/SWIG/generated_swigfile.py | 6 | ||||
-rw-r--r-- | test/SWIG/live.py | 11 | ||||
-rw-r--r-- | test/SWIG/module-deduced-name.py | 6 | ||||
-rw-r--r-- | test/SWIG/module-parens.py | 6 | ||||
-rw-r--r-- | test/SWIG/module-quoted.py | 6 | ||||
-rw-r--r-- | test/SWIG/module-spaces.py | 6 | ||||
-rw-r--r-- | test/SWIG/noproxy.py | 6 | ||||
-rw-r--r-- | test/SWIG/recursive-includes-cpp.py | 7 | ||||
-rw-r--r-- | test/SWIG/remove-modules.py | 6 | ||||
-rw-r--r-- | test/SWIG/subdir.py | 6 |
12 files changed, 16 insertions, 62 deletions
diff --git a/test/SWIG/SWIGOUTDIR-python.py b/test/SWIG/SWIGOUTDIR-python.py index db0cc95..53b5bdf 100644 --- a/test/SWIG/SWIGOUTDIR-python.py +++ b/test/SWIG/SWIGOUTDIR-python.py @@ -30,7 +30,6 @@ that Python files are created in the specified output directory. """ import TestSCons -import os import sys test = TestSCons.TestSCons() @@ -39,11 +38,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # On Windows, build a 32-bit exe if on 32-bit python. if sys.platform == 'win32' and sys.maxsize <= 2**32: diff --git a/test/SWIG/build-dir.py b/test/SWIG/build-dir.py index eba3fea..b203abe 100644 --- a/test/SWIG/build-dir.py +++ b/test/SWIG/build-dir.py @@ -29,7 +29,6 @@ Make sure SWIG works when a VariantDir (or variant_dir) is used. Test case courtesy Joe Maruszewski. """ -import os.path import sys import TestSCons @@ -49,11 +48,8 @@ else: test.subdir(['source']) -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) if sys.platform == 'win32' and sys.maxsize <= 2**32: swig_arch_var="TARGET_ARCH='x86'," diff --git a/test/SWIG/generated_swigfile.py b/test/SWIG/generated_swigfile.py index d09b473..4686dae 100644 --- a/test/SWIG/generated_swigfile.py +++ b/test/SWIG/generated_swigfile.py @@ -29,7 +29,6 @@ Verify that SCons realizes the -noproxy option means no .py file will be created. """ -import os import sys import TestSCons @@ -54,11 +53,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # handle testing on other platforms: ldmodule_prefix = '_' diff --git a/test/SWIG/live.py b/test/SWIG/live.py index 7c4bdce..f0cf1d5 100644 --- a/test/SWIG/live.py +++ b/test/SWIG/live.py @@ -28,7 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test SWIG behavior with a live, installed SWIG. """ -import os.path +import os import sys import TestSCons @@ -46,12 +46,9 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') - -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = python_include + '/Python.h' -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) + swig = swig.replace('\\','/') python = python.replace('\\','/') python_include = python_include.replace('\\','/') @@ -170,4 +167,4 @@ test.pass_test() # tab-width:4 # indent-tabs-mode:nil # End: -# vim: set expandtab tabstop=4 shiftwidth=4:
\ No newline at end of file +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/SWIG/module-deduced-name.py b/test/SWIG/module-deduced-name.py index bdaef4f..6b4d6d9 100644 --- a/test/SWIG/module-deduced-name.py +++ b/test/SWIG/module-deduced-name.py @@ -31,7 +31,6 @@ emitter should return the basename of the module only. """ import TestSCons -import os import sys test = TestSCons.TestSCons() @@ -40,11 +39,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Cannot find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Cannot find %s, skipping test.\n' % Python_h) # On Windows, build a 32-bit exe if on 32-bit python. if sys.platform == 'win32' and sys.maxsize <= 2**32: diff --git a/test/SWIG/module-parens.py b/test/SWIG/module-parens.py index d8c1744..040ef28 100644 --- a/test/SWIG/module-parens.py +++ b/test/SWIG/module-parens.py @@ -29,7 +29,6 @@ Verify that we handle %module(directors="1") statements, both with and without white space before the opening parenthesis. """ -import os.path import sys import TestSCons @@ -39,11 +38,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # swig-python expects specific filenames. # the platform specific suffix won't necessarily work. diff --git a/test/SWIG/module-quoted.py b/test/SWIG/module-quoted.py index 6f4b891..8bf9e86 100644 --- a/test/SWIG/module-quoted.py +++ b/test/SWIG/module-quoted.py @@ -29,7 +29,6 @@ Verify that we correctly parse quoted module names; e.g. %module "test" (SWIG permits double-quoted names but not single-quoted ones.) """ -import os.path import sys import TestSCons @@ -39,11 +38,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # swig-python expects specific filenames. # the platform specific suffix won't necessarily work. diff --git a/test/SWIG/module-spaces.py b/test/SWIG/module-spaces.py index 2833dff..ce16497 100644 --- a/test/SWIG/module-spaces.py +++ b/test/SWIG/module-spaces.py @@ -29,7 +29,6 @@ Verify that we correctly parse module names with spaces on the line after the module name ; e.g. "%module test " """ -import os.path import sys import TestSCons @@ -39,11 +38,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # swig-python expects specific filenames. # the platform specific suffix won't necessarily work. diff --git a/test/SWIG/noproxy.py b/test/SWIG/noproxy.py index 1aaeb08..b4abbc3 100644 --- a/test/SWIG/noproxy.py +++ b/test/SWIG/noproxy.py @@ -29,7 +29,6 @@ Verify that SCons realizes the -noproxy option means no .py file will be created. """ -import os import sys import TestSCons @@ -47,11 +46,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # handle testing on other platforms: ldmodule_prefix = '_' diff --git a/test/SWIG/recursive-includes-cpp.py b/test/SWIG/recursive-includes-cpp.py index 34c7d6e..4cb8fe5 100644 --- a/test/SWIG/recursive-includes-cpp.py +++ b/test/SWIG/recursive-includes-cpp.py @@ -44,11 +44,8 @@ for pre_req in ['swig', 'python']: if not test.where_is(pre_req): test.skip_test('Can not find installed "' + pre_req + '", skipping test.%s' % os.linesep) -# file generated by swig will #include <Python.h>, make sure we have one -python, py_include, py_libpath, py_lib = test.get_platform_python_info() -Python_h = os.path.join(py_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) +python, python_include, python_libpath, python_lib, python_h = \ + test.get_platform_python_info() if sys.platform == 'win32': python_lib = os.path.dirname(sys.executable) + "/libs/" + ('python%d%d'%(sys.version_info[0],sys.version_info[1])) + '.lib' diff --git a/test/SWIG/remove-modules.py b/test/SWIG/remove-modules.py index f5ce60d..ecbc19c 100644 --- a/test/SWIG/remove-modules.py +++ b/test/SWIG/remove-modules.py @@ -29,7 +29,6 @@ Verify that swig-generated modules are removed. The %module directive specifies the module name. """ -import os.path import sys import TestSCons @@ -47,11 +46,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # handle testing on other platforms: ldmodule_prefix = '_' diff --git a/test/SWIG/subdir.py b/test/SWIG/subdir.py index e23b858..062f8dc 100644 --- a/test/SWIG/subdir.py +++ b/test/SWIG/subdir.py @@ -29,7 +29,6 @@ Verify that we expect the .py file created by the -python flag to be in the same subdirectory as the taget. """ -import os import sys import TestSCons @@ -49,11 +48,8 @@ swig = test.where_is('swig') if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') -python, python_include, python_libpath, python_lib = \ +python, python_include, python_libpath, python_lib, python_h = \ test.get_platform_python_info() -Python_h = os.path.join(python_include, 'Python.h') -if not os.path.exists(Python_h): - test.skip_test('Can not find %s, skipping test.\n' % Python_h) # handle testing on other platforms: ldmodule_prefix = '_' |