{"id":18243214,"url":"https://github.com/pytest-dev/pytest-cpp","last_synced_at":"2025-05-15T16:04:40.688Z","repository":{"id":19548919,"uuid":"22797415","full_name":"pytest-dev/pytest-cpp","owner":"pytest-dev","description":"Use pytest's runner to discover and execute C++ tests","archived":false,"fork":false,"pushed_at":"2025-03-31T16:03:22.000Z","size":524,"stargazers_count":133,"open_issues_count":6,"forks_count":23,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-04-09T09:49:55.933Z","etag":null,"topics":["c-plus-plus","pytest"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mazedigital/mailjet","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pytest-dev.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-09T23:32:11.000Z","updated_at":"2025-03-31T16:03:25.000Z","dependencies_parsed_at":"2023-10-03T18:44:28.617Z","dependency_job_id":"39ae3b10-4ac5-4232-9b84-cf04f1ee6292","html_url":"https://github.com/pytest-dev/pytest-cpp","commit_stats":{"total_commits":217,"total_committers":16,"mean_commits":13.5625,"dds":"0.30414746543778803","last_synced_commit":"214d751b27203a0625e257aa6d811f36f4e30da0"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pytest-dev","download_url":"https://codeload.github.com/pytest-dev/pytest-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018061,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","pytest"],"created_at":"2024-11-05T08:03:53.765Z","updated_at":"2025-04-11T21:13:06.226Z","avatar_url":"https://github.com/pytest-dev.png","language":"C++","readme":"==========\npytest-cpp\n==========\n\n|python| |version| |anaconda| |ci| |black|\n\nUse `pytest \u003chttps://pypi.python.org/pypi/pytest\u003e`_ runner to discover and execute C++ tests.\n\nSupports `Google Test \u003chttps://code.google.com/p/googletest\u003e`_,\n`Boost.Test \u003chttp://www.boost.org/doc/libs/release/libs/test\u003e`_,\nand `Catch2 \u003chttps://github.com/catchorg/Catch2\u003e`_:\n\n.. |version| image:: http://img.shields.io/pypi/v/pytest-cpp.png\n  :target: https://crate.io/packages/pytest-cpp\n\n.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-cpp.svg\n    :target: https://anaconda.org/conda-forge/pytest-cpp\n\n.. |ci| image:: https://github.com/pytest-dev/pytest-cpp/workflows/test/badge.svg\n    :target: https://github.com/pytest-dev/pytest-cpp/actions\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/pytest-cpp.svg\n    :target: https://pypi.python.org/pypi/pytest-cpp/\n    :alt: Supported Python versions\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n\nThis brings several benefits:\n\n* Allows you to run all your tests in multi-language projects with a single\n  command;\n* Execute C++ tests in **parallel** using\n  `pytest-xdist \u003chttps://pypi.python.org/pypi/pytest-xdist\u003e`_ plugin;\n* Use ``--junitxml`` option to produce a single and uniform xml file with all\n  your test suite results;\n* Filter which tests to run using standard test filtering capabilities, such as\n  by file names, directories, keywords by using the ``-k`` option, etc.;\n\n.. contents:: **Table of Contents**\n\n\nInstallation\n============\n\nInstall using `pip \u003chttp://pip-installer.org/\u003e`_:\n\n.. code-block:: console\n\n    $ pip install pytest-cpp\n\nUsage\n=====\n\n.. code-block:: console\n\n    $ pytest\n\nOnce installed, pytest runs will search and run tests\nfound in **executable** files, detecting if the suites are\nGoogle, Boost, or Catch2 tests automatically.\n\nConfiguration Options\n~~~~~~~~~~~~~~~~~~~~~\n\nFollowing are the options that can be put in the pytest configuration file related\nto pytest-cpp.\n\ncpp_files\n^^^^^^^^^\n\nYou can configure which files are tested for suites by using the ``cpp_files``\nini configuration option:\n\n.. code-block:: ini\n\n    [pytest]\n    cpp_files = test_suite*\n\nBy default matches ``test_*`` and ``*_test`` executable files.\n\ncpp_arguments\n^^^^^^^^^^^^^\n\nArguments to the C++ tests can be provided with the\n``cpp_arguments`` ini configuration option.\n\nFor example:\n\n.. code-block:: ini\n\n    [pytest]\n    cpp_arguments =-v --log-dir=logs\n\nYou can change this option directly in the command-line using\npytest's ``-o`` option:\n\n.. code-block:: console\n\n    $ pytest -o cpp_arguments='-v --log-dir=logs'\n\n**Important**: do not pass filtering arguments (for example ``--gtest_filter``), as this will conflict\nwith the plugin functionality and behave incorrectly.\n\nTo filter tests, use the standard pytest filtering facilities (such as ``-k``).\n\ncpp_ignore_py_files\n^^^^^^^^^^^^^^^^^^^\n\nThis option defaults to ``True`` and configures the plugin to ignore ``*.py`` files that\nwould otherwise match the ``cpp_files`` option.\n\nSet it to ``False`` if you have C++ executable files that end with the ``*.py`` extension.\n\n.. code-block:: ini\n\n    [pytest]\n    cpp_ignore_py_files = False\n\ncpp_harness\n^^^^^^^^^^^\n\nThis option allows the usage of tools that are used by invoking them on the console\nwrapping the test binary, like valgrind and memcheck:\n\n.. code-block:: ini\n\n    [pytest]\n    cpp_harness = valgrind --tool=memcheck\n\n\ncpp_harness_collect\n^^^^^^^^^^^^^^^^^^^\n\nThis option allows the usage of tools or emulators (like wine or qemu) that are used by invoking them\non the console wrapping the test binary during a test collection.\n\nMight be used in the combination with ``cpp_harness`` to run a binary in emulators, like wine or qemu\nin cross-compilation targets.\n\n.. code-block:: ini\n\n    [pytest]\n    cpp_harness_collect = qemu-x86_64 -L libs/\n\nor\n\n.. code-block:: ini\n\n    [pytest]\n    cpp_harness_collect = qemu-x86_64 -L libs/\n    cpp_harness = qemu-x86_64 -L libs/\n\nChangelog\n=========\n\nPlease consult `CHANGELOG \u003chttps://github.com/pytest-dev/pytest-cpp/blob/master/CHANGELOG.md\u003e`_.\n\nSupport\n=======\n\nAll feature requests and bugs are welcome, so please make sure to add\nfeature requests and bugs to the\n`issues \u003chttps://github.com/pytest-dev/pytest-cpp/issues\u003e`_ page!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytest-dev%2Fpytest-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-cpp/lists"}