From 2a39eb278ecca56f66011f2d602e12b924ad0e2c Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 13 Aug 2018 10:40:42 -0600 Subject: SWIG recursive test checkes for Python.h The generated code will #include , so skip the test if the appropriate development support for Python is not installed, the test will FAIL otherwise. The other SWIG tests do this already. Signed-off-by: Mats Wichmann --- src/CHANGES.txt | 1 + test/SWIG/recursive-includes-cpp.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 6534f3a..be5a90a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -120,6 +120,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - quiet py3 warning in UtilTests.py - fix tests specifying octal constants for py3 - fix must_contain tests for py3 + - one swig test now checks for Python.h instead of failing From Hao Wu - typo in customized decider example in user guide diff --git a/test/SWIG/recursive-includes-cpp.py b/test/SWIG/recursive-includes-cpp.py index b943406..34c7d6e 100644 --- a/test/SWIG/recursive-includes-cpp.py +++ b/test/SWIG/recursive-includes-cpp.py @@ -44,6 +44,12 @@ 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 , 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) + if sys.platform == 'win32': python_lib = os.path.dirname(sys.executable) + "/libs/" + ('python%d%d'%(sys.version_info[0],sys.version_info[1])) + '.lib' if( not os.path.isfile(python_lib)): @@ -150,4 +156,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: -- cgit v0.12