pybind11/tests
Dan 930bb16c79
Call PySys_SetArgv when initializing interpreter. (#2341)
* Call PySys_SetArgv when initializing interpreter.

* Document argc/argv parameters in initialize_interpreter.

* Remove manual memory management from set_interpreter_argv in favor of smart pointers.

* Use size_t for indexers in set_interpreter_argv.

* Minimize macros for flow control in set_interpreter_argv.

* Fix 'unused variable' warning on Py2

* whitespace

* Define wide_char_arg_deleter outside set_interpreter_argv.

* Do sys.path workaround in C++ rather than eval.

* Factor out wchar conversion to a separate function.

* Restore widened_argv variable declaration.

* Fix undeclared widened_arg variable on some paths.

* Use delete[] to match new wchar_t[].

* Fix compiler errors

* Use PY_VERSION_HEX for a cleaner CVE-2008-5983 mode check.

* Fix typo

* Use explicit type for deleter so delete[] works cross-compiler.

* Always use PySys_SetArgvEx because pybind11 doesn't support pythons that don't include it.

* Remove pointless ternary operator.

* Use unique_ptr.reset instead of a second initialization.

* Rename add_program_dir_to_path parameter to clarify intent.

* Add defined() check before evaluating HAVE_BROKEN_MBSTOWCS.

* Apply clang-tidy fixes

* Pre-commit

* refactor: use const for set_interpreter_argv

* Try to fix const issue and allocate vector properly

* fix: copy strings on Python 2

* Applying clang-format-diff relative to master.

The only manual change is an added empty line between pybind11 and system `#include`s.

```
git diff -U0 --no-color master | python3 $HOME/clone/llvm-project/clang/tools/clang-format/clang-format-diff.py -p1 -style=file -i
```

Co-authored-by: Boris Staletic <boris.staletic@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2021-08-26 14:12:54 -07:00
..
extra_python_package fix: the CMake config in Python package had a hard coded path (#3144) 2021-07-27 17:23:52 -04:00
extra_setuptools maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_cmake_build maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_embed Call PySys_SetArgv when initializing interpreter. (#2341) 2021-08-26 14:12:54 -07:00
CMakeLists.txt chore: increase CMake upper limit (#3124) 2021-07-28 18:04:14 -07:00
conftest.py style: use Black everywhere (#2594) 2020-10-16 16:38:13 -04:00
constructor_stats.h refactor: module -> module_ with typedef (#2544) 2020-10-03 13:38:03 -04:00
cross_module_gil_utils.cpp Make sure detail::get_internals acquires the GIL before making Python calls. (#1836) 2019-07-15 16:47:02 +02:00
env.py env: Add surrogate for pytest.deprecated_call for ptyest<3.9 (#2923) 2021-04-02 14:34:09 -04:00
local_bindings.h Feature/local exception translator (#2650) 2021-07-21 05:22:18 -07:00
object.h maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
pybind11_cross_module_tests.cpp Feature/local exception translator (#2650) 2021-07-21 05:22:18 -07:00
pybind11_tests.cpp refactor: module -> module_ with typedef (#2544) 2020-10-03 13:38:03 -04:00
pybind11_tests.h maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
pytest.ini Make sure all warnings in pytest get turned into errors (#2838) 2021-02-01 14:52:20 +01:00
requirements.txt tests: fix pytest usage on Python 3.10 (#3221) 2021-08-26 10:52:13 -07:00
test_async.cpp refactor: module -> module_ with typedef (#2544) 2020-10-03 13:38:03 -04:00
test_async.py tests: cleanup and ci hardening (#2397) 2020-08-16 16:02:12 -04:00
test_buffers.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_buffers.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_builtin_casters.cpp Cleanup of file-scoped and globally-scoped warning suppression pragmas across pybind11 header files. (#3201) 2021-08-19 11:37:04 -07:00
test_builtin_casters.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_call_policies.cpp functions: Add doc on incorrect argument index (#2979) 2021-05-06 10:13:30 -04:00
test_call_policies.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_callbacks.cpp Allow python builtins to be used as callbacks (#1413) 2021-07-27 14:16:28 -04:00
test_callbacks.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_chrono.cpp fix: allow assignment of time points of resolutions other than that of a system clock (#2481) 2020-09-13 10:24:00 -04:00
test_chrono.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_class.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_class.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_constants_and_functions.cpp Removing __INTEL_COMPILER section from pragma block at the top of pybind11.h (#3135) 2021-07-27 15:33:31 -07:00
test_constants_and_functions.py Plug leaking function_records in cpp_function initialization in case of exceptions (found by Valgrind in #2746) (#2756) 2021-01-14 19:34:32 +01:00
test_copy_move.cpp NOLINT reduction (#3096) 2021-07-12 13:10:28 -07:00
test_copy_move.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_custom_type_casters.cpp fix(clang-tidy): performance fixes applied in tests and CI (#3051) 2021-06-22 12:11:54 -04:00
test_custom_type_casters.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_docstring_options.cpp fix: do not set docstring for function when empty (#2745) 2020-12-27 22:56:30 -05:00
test_docstring_options.py fix: do not set docstring for function when empty (#2745) 2020-12-27 22:56:30 -05:00
test_eigen.cpp * Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087) 2021-07-13 18:14:58 -07:00
test_eigen.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_enum.cpp Avoid conversion to int_ rhs argument of enum eq/ne (#1912) 2019-09-19 18:23:27 +02:00
test_enum.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_eval_call.py style: use Black everywhere (#2594) 2020-10-16 16:38:13 -04:00
test_eval.cpp test_eval: Show example of working closure (#2743) 2021-08-06 15:51:53 -04:00
test_eval.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_exceptions.cpp Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 2021-08-23 17:30:01 -07:00
test_exceptions.h fix: Mingw64 corrected and add a CI job to test it (#3132) 2021-07-30 13:48:41 -04:00
test_exceptions.py Clone of @virtuald's PR #2112 with minor enhancements. (#3215) 2021-08-23 17:30:01 -07:00
test_factory_constructors.cpp fix(clang-tidy): performance fixes applied in tests and CI (#3051) 2021-06-22 12:11:54 -04:00
test_factory_constructors.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_gil_scoped.cpp fix(clang-tidy): performance fixes applied in tests and CI (#3051) 2021-06-22 12:11:54 -04:00
test_gil_scoped.py style: use Black everywhere (#2594) 2020-10-16 16:38:13 -04:00
test_iostream.cpp Adding iostream.h thread-safety documentation. (#2995) 2021-07-12 13:39:06 -07:00
test_iostream.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_kwargs_and_defaults.cpp NOLINT reduction (#3096) 2021-07-12 13:10:28 -07:00
test_kwargs_and_defaults.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_local_bindings.cpp Feature/local exception translator (#2650) 2021-07-21 05:22:18 -07:00
test_local_bindings.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_methods_and_attributes.cpp maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 2021-07-27 15:32:26 -07:00
test_methods_and_attributes.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_modules.cpp fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) 2021-06-21 10:37:48 -04:00
test_modules.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_multiple_inheritance.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_multiple_inheritance.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_numpy_array.cpp view for numpy arrays (#987) 2021-08-26 14:11:01 -07:00
test_numpy_array.py view for numpy arrays (#987) 2021-08-26 14:11:01 -07:00
test_numpy_dtypes.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_numpy_dtypes.py ci: extend msys2 mingw CI (#3207) 2021-08-19 14:42:55 -04:00
test_numpy_vectorize.cpp maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 2021-07-27 15:32:26 -07:00
test_numpy_vectorize.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_opaque_types.cpp fix(clang-tidy): performance fixes applied in tests and CI (#3051) 2021-06-22 12:11:54 -04:00
test_opaque_types.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_operator_overloading.cpp fix(clang-tidy): performance fixes applied in tests and CI (#3051) 2021-06-22 12:11:54 -04:00
test_operator_overloading.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_pickling.cpp pickle setstate: setattr __dict__ only if not empty (#2972) 2021-06-30 12:34:32 -07:00
test_pickling.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_pytypes.cpp Add make_simple_namespace function and tests (#2840) 2021-08-26 08:04:22 -07:00
test_pytypes.py Add make_simple_namespace function and tests (#2840) 2021-08-26 08:04:22 -07:00
test_sequences_and_iterators.cpp fix(clang-tidy): Add cppcoreguidelines-init-vars,slicing, and throw-by-value-catch-by-reference checks (#3094) 2021-07-13 09:54:32 -04:00
test_sequences_and_iterators.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_smart_ptr.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_smart_ptr.py Fix various minor memory leaks in the tests (found by Valgrind in #2746) (#2758) 2021-01-01 17:05:22 +01:00
test_stl_binders.cpp fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052) 2021-06-21 10:37:48 -04:00
test_stl_binders.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_stl.cpp maint(clang-tidy): Improve code readability with explicit boolean casts (#3148) 2021-07-27 15:32:26 -07:00
test_stl.py maint(precommit): Apply isort (#3195) 2021-08-13 12:37:05 -04:00
test_tagbased_polymorphic.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_tagbased_polymorphic.py style: use Black everywhere (#2594) 2020-10-16 16:38:13 -04:00
test_union.cpp Fix assertion failure for unions (#1685) (#1709) 2019-06-11 23:28:58 +02:00
test_union.py ci: GHA basic format & pre-commit (#2309) 2020-07-20 13:35:21 -04:00
test_virtual_functions.cpp maint(clang-tidy): Bugprone enable checks (#3166) 2021-08-06 14:30:28 -04:00
test_virtual_functions.py Add a Valgrind build on debug Python 3.9 (#2746) 2021-01-15 21:07:31 +01:00
valgrind-numpy-scipy.supp docs: fix various typos (#3075) 2021-07-04 19:58:35 -04:00
valgrind-python.supp chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 2021-01-31 17:29:09 -05:00