diff options
| author | gjaeger1 <jaegergeorg@web.de> | 2019-07-10 23:30:58 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-07-11 00:30:58 +0300 |
| commit | 30e42009c03cbb53e3462e1c4ee29af666474742 (patch) | |
| tree | aaae8ad451e31b7ff72a685bdbb3525616241005 /test cases/frameworks/1 boost/test_python_module.py | |
| parent | 748c9d817d8b6a0bb79eeba6256370db777754f4 (diff) | |
| download | meson-30e42009c03cbb53e3462e1c4ee29af666474742.tar.gz | |
Adapting Boost Python library detection to Boost >= 1.67. Closes #4288.
Diffstat (limited to 'test cases/frameworks/1 boost/test_python_module.py')
| -rw-r--r-- | test cases/frameworks/1 boost/test_python_module.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test cases/frameworks/1 boost/test_python_module.py b/test cases/frameworks/1 boost/test_python_module.py new file mode 100644 index 000000000..acf6e42d6 --- /dev/null +++ b/test cases/frameworks/1 boost/test_python_module.py @@ -0,0 +1,27 @@ +import sys +sys.path.append(sys.argv[1]) + +# import compiled python module depending on version of python we are running with +if sys.version_info[0] == 2: + import python2_module + +if sys.version_info[0] == 3: + import python3_module + + +def run(): + msg = 'howdy' + if sys.version_info[0] == 2: + w = python2_module.World() + + if sys.version_info[0] == 3: + w = python3_module.World() + + w.set(msg) + + assert(msg == w.greet()) + version_string = str(sys.version_info[0]) + "." + str(sys.version_info[1]) + assert(version_string == w.version()) + +if __name__ == '__main__': + run() |
