Commit graph

5 commits

Author SHA1 Message Date
Victor Stinner
a15396146f
[3.11] gh-108303: Add Lib/test/test_cppext/ sub-directory (#108325) (#108336)
gh-108303: Add Lib/test/test_cppext/ sub-directory (#108325)

* Move test_cppext to its own directory
* Rename setup_testcppext.py to setup.py
* Rename _testcppext.cpp to extension.cpp
* The source (extension.cpp) is now also copied by the test.

(cherry picked from commit 21dda09600)
2023-08-23 05:11:53 +02:00
Miss Islington (bot)
d9107aa015
gh-94731: Revert to C-style casts for _Py_CAST (GH-94782) (#94849)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
(cherry picked from commit 6cbb57f62d)
2022-07-15 09:35:23 +02:00
Miss Islington (bot)
ffbd6ae37c
gh-94751: Install, import and run the test C++ extension (MVP) (GH-94754) (#94780)
This is a quick-and-dirty way to run the C++ tests.
It can definitely be improved in the future, but it should fail when things go wrong.

- Run test functions on import (yes, this can definitely be improved)
- Fudge setuptools metadata (name & version) to make the extension installable
- Install and import the extension in test_cppext
(cherry picked from commit ec5db539b9)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-07-13 11:09:06 +02:00
Miss Islington (bot)
62f72e4811
gh-91321: Fix test_cppext for C++03 (GH-93902) (#93904)
Don't build _testcppext.cpp with -Wzero-as-null-pointer-constant when
testing C++03: only use this compiler flag with C++11.
(cherry picked from commit a38c2a61d5)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-16 15:17:35 +02:00
Victor Stinner
ef591cf8e3
gh-91321: Fix compatibility with C++ older than C++11 (#93784) (#93802)
* Fix the compatibility of the Python C API with C++ older than C++11.
* _Py_NULL is only defined as nullptr on C++11 and newer.

(cherry picked from commit 4caf5c2753)

* test_cppext now builds the C++ extension with setuptools.
* Add @test.support.requires_venv_with_pip.

(cherry picked from commit ca0cc9c433)
2022-06-14 16:05:14 +02:00