pytest-cmake 0.4.1__tar.gz → 0.5.2__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.
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/PKG-INFO +3 -1
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/cmake/FindPytest.cmake +2 -0
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/cmake/PytestAddTests.cmake +17 -9
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/pyproject.toml +3 -1
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/setup.py +1 -1
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/.gitignore +0 -0
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/LICENSE +0 -0
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/README.md +0 -0
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/build_backend.py +0 -0
- {pytest_cmake-0.4.1 → pytest_cmake-0.5.2}/build_config.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: pytest-cmake
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.5.2
|
4
4
|
Summary: Provide CMake module for Pytest
|
5
5
|
Author-email: Jeremy Retailleau <jeremy.retailleau@gmail.com>
|
6
6
|
License: MIT License
|
@@ -35,6 +35,8 @@ Classifier: Programming Language :: Python :: 3.7
|
|
35
35
|
Classifier: Programming Language :: Python :: 3.8
|
36
36
|
Classifier: Programming Language :: Python :: 3.9
|
37
37
|
Classifier: Programming Language :: Python :: 3.10
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
38
40
|
Classifier: Topic :: Software Development :: Build Tools
|
39
41
|
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,<4,>=2.7
|
40
42
|
Requires-Dist: pytest<9,>=4
|
@@ -99,6 +99,8 @@ if (Pytest_FOUND AND NOT TARGET Pytest::Pytest)
|
|
99
99
|
set(_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
100
100
|
endif()
|
101
101
|
|
102
|
+
get_filename_component(_WORKING_DIRECTORY "${_WORKING_DIRECTORY}" REALPATH)
|
103
|
+
|
102
104
|
# Override option by environment variable if available.
|
103
105
|
if (DEFINED ENV{BUNDLE_PYTHON_TESTS})
|
104
106
|
set(_BUNDLE_TESTS $ENV{BUNDLE_PYTHON_TESTS})
|
@@ -42,28 +42,36 @@ if(CMAKE_SCRIPT_MODE_FILE)
|
|
42
42
|
# Set environment for collecting tests.
|
43
43
|
set(ENV{${LIB_ENV_PATH}} "${LIBRARY_PATH}")
|
44
44
|
set(ENV{PYTHONPATH} "${PYTHON_PATH}")
|
45
|
+
set(ENV{PYTHONWARNINGS} "ignore")
|
45
46
|
|
46
47
|
execute_process(
|
47
|
-
COMMAND ${PYTEST_EXECUTABLE}
|
48
|
+
COMMAND "${PYTEST_EXECUTABLE}"
|
48
49
|
--collect-only -q
|
49
50
|
--rootdir=${WORKING_DIRECTORY} .
|
50
|
-
OUTPUT_VARIABLE
|
51
|
-
ERROR_VARIABLE
|
51
|
+
OUTPUT_VARIABLE _output_lines
|
52
|
+
ERROR_VARIABLE _output_lines
|
52
53
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
53
54
|
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
54
55
|
)
|
55
56
|
|
57
|
+
string(REGEX MATCH "=+ ERRORS =+(.*)" _error ${_output_lines})
|
58
|
+
|
59
|
+
if (_error)
|
60
|
+
message(${_error})
|
61
|
+
message(FATAL_ERROR "An error occurred during the collection of Python tests.")
|
62
|
+
endif()
|
63
|
+
|
56
64
|
# Convert output into list.
|
57
|
-
string(REPLACE [[;]] [[\;]]
|
58
|
-
string(REPLACE "\n" ";"
|
65
|
+
string(REPLACE [[;]] [[\;]] _output_lines "${_output_lines}")
|
66
|
+
string(REPLACE "\n" ";" _output_lines "${_output_lines}")
|
59
67
|
|
60
68
|
set(test_pattern "([^:]+)(::([^:]+))?::([^:]+)")
|
61
69
|
|
62
|
-
foreach (
|
63
|
-
string(REGEX MATCHALL ${test_pattern}
|
70
|
+
foreach (line ${_output_lines})
|
71
|
+
string(REGEX MATCHALL ${test_pattern} matching "${line}")
|
64
72
|
|
65
73
|
# Ignore lines not identified as a test.
|
66
|
-
if (NOT
|
74
|
+
if (NOT matching)
|
67
75
|
continue()
|
68
76
|
endif()
|
69
77
|
|
@@ -82,7 +90,7 @@ if(CMAKE_SCRIPT_MODE_FILE)
|
|
82
90
|
endif()
|
83
91
|
|
84
92
|
set(test_name "${TEST_GROUP_NAME}.${test_name}")
|
85
|
-
set(test_case "${WORKING_DIRECTORY}/${
|
93
|
+
set(test_case "${WORKING_DIRECTORY}/${line}")
|
86
94
|
|
87
95
|
string(APPEND _content
|
88
96
|
"add_test(\n"
|
@@ -9,7 +9,7 @@ backend-path = ["."]
|
|
9
9
|
|
10
10
|
[project]
|
11
11
|
name = "pytest-cmake"
|
12
|
-
version = "0.
|
12
|
+
version = "0.5.2"
|
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"
|
@@ -32,6 +32,8 @@ classifiers = [
|
|
32
32
|
"Programming Language :: Python :: 3.8",
|
33
33
|
"Programming Language :: Python :: 3.9",
|
34
34
|
"Programming Language :: Python :: 3.10",
|
35
|
+
"Programming Language :: Python :: 3.11",
|
36
|
+
"Programming Language :: Python :: 3.12",
|
35
37
|
]
|
36
38
|
|
37
39
|
[tool.hatch.build.hooks.custom]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|