pytest-cmake 0.9.0__tar.gz → 0.10.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.
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/PKG-INFO +1 -1
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/cmake/FindPytest.cmake +11 -10
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/cmake/PytestAddTests.cmake +15 -5
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/pyproject.toml +1 -1
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/setup.py +1 -1
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/.gitignore +0 -0
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/LICENSE +0 -0
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/README.md +0 -0
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/build_backend.py +0 -0
- {pytest_cmake-0.9.0 → pytest_cmake-0.10.0}/build_config.py +0 -0
@@ -55,8 +55,8 @@ if (Pytest_FOUND AND NOT TARGET Pytest::Pytest)
|
|
55
55
|
|
56
56
|
function(pytest_discover_tests NAME)
|
57
57
|
cmake_parse_arguments(
|
58
|
-
PARSE_ARGV 1 "" "STRIP_PARAM_BRACKETS;BUNDLE_TESTS"
|
59
|
-
"WORKING_DIRECTORY;TRIM_FROM_NAME"
|
58
|
+
PARSE_ARGV 1 "" "STRIP_PARAM_BRACKETS;INCLUDE_FILE_PATH;BUNDLE_TESTS"
|
59
|
+
"WORKING_DIRECTORY;TRIM_FROM_NAME;TRIM_FROM_FULL_NAME"
|
60
60
|
"LIBRARY_PATH_PREPEND;PYTHON_PATH_PREPEND;ENVIRONMENT;DEPENDS"
|
61
61
|
)
|
62
62
|
|
@@ -100,13 +100,13 @@ if (Pytest_FOUND AND NOT TARGET Pytest::Pytest)
|
|
100
100
|
set(_BUNDLE_TESTS $ENV{BUNDLE_PYTHON_TESTS})
|
101
101
|
endif()
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
103
|
+
# Serialize environment if necessary.
|
104
|
+
set(ENCODED_ENVIRONMENT "")
|
105
|
+
foreach(env ${_ENVIRONMENT})
|
106
|
+
string(REPLACE [[\]] [\\]] env ${env})
|
107
|
+
string(REPLACE [[;]] [\\;]] env ${env})
|
108
|
+
list(APPEND ENCODED_ENVIRONMENT ${env})
|
109
|
+
endforeach()
|
110
110
|
|
111
111
|
set(_include_file "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_include.cmake")
|
112
112
|
set(_tests_file "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_tests.cmake")
|
@@ -123,10 +123,11 @@ if (Pytest_FOUND AND NOT TARGET Pytest::Pytest)
|
|
123
123
|
-D "LIBRARY_PATH=${LIBRARY_PATH}"
|
124
124
|
-D "PYTHON_PATH=${PYTHON_PATH}"
|
125
125
|
-D "TRIM_FROM_NAME=${_TRIM_FROM_NAME}"
|
126
|
+
-D "TRIM_FROM_FULL_NAME=${_TRIM_FROM_FULL_NAME}"
|
126
127
|
-D "STRIP_PARAM_BRACKETS=${_STRIP_PARAM_BRACKETS}"
|
128
|
+
-D "INCLUDE_FILE_PATH=${_INCLUDE_FILE_PATH}"
|
127
129
|
-D "WORKING_DIRECTORY=${_WORKING_DIRECTORY}"
|
128
130
|
-D "ENVIRONMENT=${ENCODED_ENVIRONMENT}"
|
129
|
-
-D "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}"
|
130
131
|
-D "CTEST_FILE=${_tests_file}"
|
131
132
|
-P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PytestAddTests.cmake")
|
132
133
|
|
@@ -61,7 +61,7 @@ if(CMAKE_SCRIPT_MODE_FILE)
|
|
61
61
|
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
62
62
|
)
|
63
63
|
|
64
|
-
string(REGEX MATCH "=+ ERRORS =+(.*)" _error ${_output_lines})
|
64
|
+
string(REGEX MATCH "=+ ERRORS =+(.*)" _error "${_output_lines}")
|
65
65
|
|
66
66
|
if (_error)
|
67
67
|
message(${_error})
|
@@ -72,7 +72,7 @@ if(CMAKE_SCRIPT_MODE_FILE)
|
|
72
72
|
string(REPLACE [[;]] [[\;]] _output_lines "${_output_lines}")
|
73
73
|
string(REPLACE "\n" ";" _output_lines "${_output_lines}")
|
74
74
|
|
75
|
-
set(test_pattern "([^:]+)(::([^:]+))?::([^:]+)")
|
75
|
+
set(test_pattern "([^:]+)\.py(::([^:]+))?::([^:]+)")
|
76
76
|
|
77
77
|
foreach (line ${_output_lines})
|
78
78
|
string(REGEX MATCHALL ${test_pattern} matching "${line}")
|
@@ -82,13 +82,13 @@ if(CMAKE_SCRIPT_MODE_FILE)
|
|
82
82
|
continue()
|
83
83
|
endif()
|
84
84
|
|
85
|
+
set(_file ${CMAKE_MATCH_1})
|
85
86
|
set(_class ${CMAKE_MATCH_3})
|
86
87
|
set(_func ${CMAKE_MATCH_4})
|
87
88
|
|
88
89
|
if (TRIM_FROM_NAME)
|
89
|
-
|
90
|
-
string(REGEX REPLACE "${
|
91
|
-
string(REGEX REPLACE "${pattern}" "" _func "${_func}")
|
90
|
+
string(REGEX REPLACE "${TRIM_FROM_NAME}" "" _class "${_class}")
|
91
|
+
string(REGEX REPLACE "${TRIM_FROM_NAME}" "" _func "${_func}")
|
92
92
|
endif()
|
93
93
|
|
94
94
|
if (_class)
|
@@ -101,6 +101,16 @@ if(CMAKE_SCRIPT_MODE_FILE)
|
|
101
101
|
string(REGEX REPLACE "\\[(.+)\\]$" ".\\1" test_name "${test_name}")
|
102
102
|
endif()
|
103
103
|
|
104
|
+
if (INCLUDE_FILE_PATH)
|
105
|
+
cmake_path(CONVERT "${_file}" TO_CMAKE_PATH_LIST _file)
|
106
|
+
string(REGEX REPLACE "/" "." _file "${_file}")
|
107
|
+
set(test_name "${_file}.${test_name}")
|
108
|
+
endif()
|
109
|
+
|
110
|
+
if (TRIM_FROM_FULL_NAME)
|
111
|
+
string(REGEX REPLACE "${TRIM_FROM_FULL_NAME}" "" test_name "${test_name}")
|
112
|
+
endif()
|
113
|
+
|
104
114
|
set(test_name "${TEST_GROUP_NAME}.${test_name}")
|
105
115
|
set(test_case "${WORKING_DIRECTORY}/${line}")
|
106
116
|
|
@@ -9,7 +9,7 @@ backend-path = ["."]
|
|
9
9
|
|
10
10
|
[project]
|
11
11
|
name = "pytest-cmake"
|
12
|
-
version = "0.
|
12
|
+
version = "0.10.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"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|