2
2
pytest-cpp
3
3
==========
4
4
5
- Use `pytest <https://pypi.python.org/pypi/pytest >`_ runner to discover and execute C++ tests.
6
-
7
5
|python | |version | |anaconda | |ci | |black |
8
6
7
+ Use `pytest <https://pypi.python.org/pypi/pytest >`_ runner to discover and execute C++ tests.
8
+
9
9
Supports `Google Test <https://code.google.com/p/googletest >`_,
10
10
`Boost::Test <http://www.boost.org/doc/libs/release/libs/test >`_,
11
11
and `Catch2 <https://github.com/catchorg/Catch2 >`_:
12
12
13
- .. image :: https://raw.githubusercontent.com/pytest-dev/pytest-cpp/master/images/screenshot.png
14
-
15
13
.. |version | image :: http://img.shields.io/pypi/v/pytest-cpp.png
16
14
:target: https://crate.io/packages/pytest-cpp
17
15
@@ -39,17 +37,37 @@ This brings several benefits:
39
37
* Filter which tests to run using standard test filtering capabilities, such as
40
38
by file names, directories, keywords by using the ``-k `` option, etc.;
41
39
40
+ .. contents :: **Table of Contents**
41
+
42
+
43
+ Installation
44
+ ============
45
+
46
+ Install using `pip <http://pip-installer.org/ >`_:
47
+
48
+ .. code-block :: console
49
+
50
+ $ pip install pytest-cpp
51
+
42
52
Usage
43
53
=====
44
54
45
- Once installed, when py.test runs it will search and run tests
46
- found in executable files, detecting if the suites are
55
+ .. code-block :: console
56
+
57
+ $ pytest
58
+
59
+ Once installed, pytest runs will search and run tests
60
+ found in **executable ** files, detecting if the suites are
47
61
Google, Boost, or Catch2 tests automatically.
48
62
49
63
Configuration Options
50
64
~~~~~~~~~~~~~~~~~~~~~
51
65
52
- **cpp_files **
66
+ Following are the options that can be put in the pytest configuration file related
67
+ to pytest-cpp.
68
+
69
+ cpp_files
70
+ ^^^^^^^^^
53
71
54
72
You can configure which files are tested for suites by using the ``cpp_files ``
55
73
ini configuration option:
@@ -61,7 +79,8 @@ ini configuration option:
61
79
62
80
By default matches ``test_* `` and ``*_test `` executable files.
63
81
64
- **cpp_arguments **
82
+ cpp_arguments
83
+ ^^^^^^^^^^^^^
65
84
66
85
*New in version 1.1 *.
67
86
@@ -82,7 +101,8 @@ pytest's ``-o`` option:
82
101
83
102
$ pytest -o cpp_arguments='-v --log-dir=logs'
84
103
85
- **cpp_ignore_py_files **
104
+ cpp_ignore_py_files
105
+ ^^^^^^^^^^^^^^^^^^^
86
106
87
107
*New in version 1.2 *.
88
108
@@ -96,7 +116,8 @@ Set it to ``False`` if you have C++ executable files that end with the ``*.py``
96
116
[pytest]
97
117
cpp_ignore_py_files = False
98
118
99
- **cpp_harness **
119
+ cpp_harness
120
+ ^^^^^^^^^^^
100
121
101
122
*New in version 1.3 *.
102
123
@@ -108,14 +129,6 @@ wrapping the test binary, like valgrind and memcheck:
108
129
[pytest]
109
130
cpp_harness = valgrind --tool =memcheck
110
131
111
- Install
112
- =======
113
-
114
- Install using `pip <http://pip-installer.org/ >`_:
115
-
116
- .. code-block :: console
117
-
118
- $ pip install pytest-cpp
119
132
120
133
Changelog
121
134
=========
0 commit comments