pytest-cmake 0.6.0__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pytest-cmake
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: Provide CMake module for Pytest
5
+ Project-URL: Documentation, https://python-cmake.github.io/pytest-cmake
6
+ Project-URL: Repository, https://github.com/python-cmake/pytest-cmake
7
+ Project-URL: Issues, https://github.com/python-cmake/pytest-cmake/issues
8
+ Project-URL: Changelog, https://python-cmake.github.io/pytest-cmake/release/release_notes.html
5
9
  Author-email: Jeremy Retailleau <jeremy.retailleau@gmail.com>
6
10
  License: MIT License
7
11
 
@@ -46,8 +50,7 @@ Description-Content-Type: text/markdown
46
50
 
47
51
  [![PyPi version](https://img.shields.io/pypi/v/pytest-cmake.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.python.org/pypi/pytest-cmake)
48
52
  [![CMake](https://img.shields.io/badge/CMake-3.20...3.29-blue.svg?logo=CMake&logoColor=blue)](https://cmake.org)
49
- [![Documentation](https://readthedocs.org/projects/pytest-cmake/badge/?version=stable)](https://pytest-cmake.readthedocs.io/en/stable/)
50
- [![Test](https://github.com/buddly27/pytest-cmake/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/buddly27/pytest-cmake/actions/workflows/test.yml)
53
+ [![Test](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml)
51
54
  [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
52
55
 
53
56
  This project provides convenient ways to use [Pytest](https://docs.pytest.org/)
@@ -57,12 +60,12 @@ versions on Linux, macOS or Windows using the
57
60
  function:
58
61
 
59
62
  ```cmake
60
- find_package(Pytest 4.6.11 REQUIRED)
63
+ find_package(Pytest 8.2.1 REQUIRED)
61
64
  ```
62
65
 
63
66
  A ``pytest_discover_tests`` function is provided to simplify automatic
64
67
  testing for C++ projects with Python bindings. It can create CTest tests
65
- for each Python test collected within a correct environment:
68
+ for each Python test collected within a controlled environment:
66
69
 
67
70
  ```cmake
68
71
  pytest_discover_tests(
@@ -92,4 +95,4 @@ Running the tests will display the status for each test collected as follows:
92
95
  ## Documentation
93
96
 
94
97
  Full documentation, including installation and setup guides, can be found at
95
- https://pytest-cmake.readthedocs.io/en/stable/
98
+ https://python-cmake.github.io/pytest-cmake/
@@ -2,8 +2,7 @@
2
2
 
3
3
  [![PyPi version](https://img.shields.io/pypi/v/pytest-cmake.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.python.org/pypi/pytest-cmake)
4
4
  [![CMake](https://img.shields.io/badge/CMake-3.20...3.29-blue.svg?logo=CMake&logoColor=blue)](https://cmake.org)
5
- [![Documentation](https://readthedocs.org/projects/pytest-cmake/badge/?version=stable)](https://pytest-cmake.readthedocs.io/en/stable/)
6
- [![Test](https://github.com/buddly27/pytest-cmake/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/buddly27/pytest-cmake/actions/workflows/test.yml)
5
+ [![Test](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml)
7
6
  [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
7
 
9
8
  This project provides convenient ways to use [Pytest](https://docs.pytest.org/)
@@ -13,12 +12,12 @@ versions on Linux, macOS or Windows using the
13
12
  function:
14
13
 
15
14
  ```cmake
16
- find_package(Pytest 4.6.11 REQUIRED)
15
+ find_package(Pytest 8.2.1 REQUIRED)
17
16
  ```
18
17
 
19
18
  A ``pytest_discover_tests`` function is provided to simplify automatic
20
19
  testing for C++ projects with Python bindings. It can create CTest tests
21
- for each Python test collected within a correct environment:
20
+ for each Python test collected within a controlled environment:
22
21
 
23
22
  ```cmake
24
23
  pytest_discover_tests(
@@ -48,4 +47,4 @@ Running the tests will display the status for each test collected as follows:
48
47
  ## Documentation
49
48
 
50
49
  Full documentation, including installation and setup guides, can be found at
51
- https://pytest-cmake.readthedocs.io/en/stable/
50
+ https://python-cmake.github.io/pytest-cmake/
@@ -100,6 +100,7 @@ if (Pytest_FOUND AND NOT TARGET Pytest::Pytest)
100
100
  set(_BUNDLE_TESTS $ENV{BUNDLE_PYTHON_TESTS})
101
101
  endif()
102
102
 
103
+ set(_include_file "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_include.cmake")
103
104
  set(_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_tests.cmake")
104
105
 
105
106
  add_custom_target(
@@ -120,9 +121,17 @@ if (Pytest_FOUND AND NOT TARGET Pytest::Pytest)
120
121
  -D "CTEST_FILE=${_tests_file}"
121
122
  -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PytestAddTests.cmake")
122
123
 
124
+ file(WRITE "${_include_file}"
125
+ "if(EXISTS \"${_tests_file}\")\n"
126
+ " include(\"${_tests_file}\")\n"
127
+ "else()\n"
128
+ " add_test(${NAME}_NOT_BUILT ${NAME}_NOT_BUILT)\n"
129
+ "endif()\n"
130
+ )
131
+
123
132
  # Add discovered tests to directory TEST_INCLUDE_FILES
124
133
  set_property(DIRECTORY
125
- APPEND PROPERTY TEST_INCLUDE_FILES "${_tests_file}")
134
+ APPEND PROPERTY TEST_INCLUDE_FILES "${_include_file}")
126
135
 
127
136
  endfunction()
128
137
 
@@ -86,17 +86,18 @@ if(CMAKE_SCRIPT_MODE_FILE)
86
86
  set(_class ${CMAKE_MATCH_3})
87
87
  set(_func ${CMAKE_MATCH_4})
88
88
 
89
+ if (TRIM_FROM_NAME)
90
+ set(pattern "${TRIM_FROM_NAME}")
91
+ string(REGEX REPLACE "${pattern}" "" _class "${_class}")
92
+ string(REGEX REPLACE "${pattern}" "" _func "${_func}")
93
+ endif()
94
+
89
95
  if (_class)
90
96
  set(test_name "${_class}.${_func}")
91
97
  else()
92
98
  set(test_name "${_func}")
93
99
  endif()
94
100
 
95
- if (TRIM_FROM_NAME)
96
- string(REGEX REPLACE
97
- "${TRIM_FROM_NAME}" "" test_name "${test_name}")
98
- endif()
99
-
100
101
  set(test_name "${TEST_GROUP_NAME}.${test_name}")
101
102
  set(test_case "${WORKING_DIRECTORY}/${line}")
102
103
 
@@ -9,7 +9,7 @@ backend-path = ["."]
9
9
 
10
10
  [project]
11
11
  name = "pytest-cmake"
12
- version = "0.6.0"
12
+ version = "0.8.0"
13
13
  description = "Provide CMake module for Pytest"
14
14
  readme = "README.md"
15
15
  requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4"
@@ -36,6 +36,12 @@ classifiers = [
36
36
  "Programming Language :: Python :: 3.12",
37
37
  ]
38
38
 
39
+ [project.urls]
40
+ Documentation = "https://python-cmake.github.io/pytest-cmake"
41
+ Repository = "https://github.com/python-cmake/pytest-cmake"
42
+ Issues = "https://github.com/python-cmake/pytest-cmake/issues"
43
+ Changelog = "https://python-cmake.github.io/pytest-cmake/release/release_notes.html"
44
+
39
45
  [tool.hatch.build.hooks.custom]
40
46
  require-runtime-dependencies = true
41
47
  path = "build_config.py"
@@ -60,7 +60,7 @@ class CreateCmakeConfig(install):
60
60
 
61
61
  setup(
62
62
  name="pytest-cmake",
63
- version="0.6.0",
63
+ version="0.8.0",
64
64
  data_files=[
65
65
  (
66
66
  "share/Pytest/cmake",
File without changes
File without changes