| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
(cherry picked from commit 6cbb57f62d345d7a5d6aeb1b3b5d37a845344d5e)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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 ec5db539b9df99c8b96149768dc2e8598dce2afa)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 4caf5c2753f1aa28d6f4bc1aa377975fd2a62331)
* test_cppext now builds the C++ extension with setuptools.
* Add @test.support.requires_venv_with_pip.
(cherry picked from commit ca0cc9c433830e14714a5cc93fb4e7254da3dd76)
|
| |
|
|
|
|
|
|
|
|
| |
Fix C++ compiler warnings: "zero as null pointer constant"
(clang -Wzero-as-null-pointer-constant).
* Add the _Py_NULL macro used by static inline functions to use
nullptr in C++.
* Replace NULL with nullptr in _testcppext.cpp.
|
|
|
|
|
|
|
| |
Use _Py_CAST(), _Py_STATIC_CAST() and _PyASCIIObject_CAST() in
static inline functions to fix C++ compiler warnings:
"use of old-style cast" (clang -Wold-style-cast).
test_cppext now builds the C++ test extension with -Wold-style-cast.
|
|
|
|
|
|
|
|
|
|
| |
Fix C++ compiler warnings on cast macros, like _PyObject_CAST(), when
casting a constant expression to a non constant type: use
const_cast<> in C++.
* In C++, Py_SAFE_DOWNCAST() now uses static_cast<> rather than
reinterpret_cast<>.
* Add tests to the _testcppext C++ extension.
* test_cppext no longer captures stdout in verbose mode.
|
|
Build a basic C++ test extension to check that the Python C API is
compatible with C++ and does not emit C++ compiler warnings.
* Add Modules/_testcppext.cpp: C++ extension
* Add Lib/test/test_cppext.py: test building the C++ extension.
|