Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
7b9ec5fd
Commit
7b9ec5fd
authored
2 years ago
by
Samuel Burbulla
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/dune-python-add-test' into 'master'
[cmake][python][bugfix] Fix dune_python_add_test after
!1130
See merge request
!1156
parents
2c3a1db0
ae3dc1b1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1156
[cmake][python][bugfix] Fix dune_python_add_test after !1130
Pipeline
#52805
passed
2 years ago
Stage: .pre
Stage: test
Stage: downstream
Pipeline: Dune Nightly Test
#52806
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/modules/DunePythonTestCommand.cmake
+24
-4
24 additions, 4 deletions
cmake/modules/DunePythonTestCommand.cmake
with
24 additions
and
4 deletions
cmake/modules/DunePythonTestCommand.cmake
+
24
−
4
View file @
7b9ec5fd
...
...
@@ -16,6 +16,16 @@
# The Python module to execute using the python interpreter. It will be executed during :code:`make test_python`
# and during `ctest`. You are required to either pass SCRIPT or MODULE.
#
# .. cmake_param:: LABELS
# :multi:
#
# A list of labels to add to the test. This sets
# the LABELS property on the test so :code:`ctest -L ${label_regex}` can
# be used to run all tests with certain labels. We always add the label
# :code:`python` per default. The labels are forwarded to
# :ref:`dune_add_test`. See :ref:`dune_add_test` for a
# more detailed documentation.
#
# .. cmake_param:: WORKING_DIRECTORY
# :single:
# :argname: dir
...
...
@@ -23,6 +33,13 @@
# The working directory of the command. Defaults to
# the current build directory.
#
# .. cmake_param:: TIMEOUT
# :single:
#
# If set, the test will time out after the given number of seconds. This supersedes
# any timeout setting in ctest (see `cmake --help-property TIMEOUT`). If you
# specify the MPI_RANKS option, you need to specify a TIMEOUT.
#
# .. cmake_param:: NAME
# :single:
#
...
...
@@ -40,20 +57,23 @@ include_guard(GLOBAL)
function
(
dune_python_add_test
)
# Parse Arguments
set
(
OPTION
)
set
(
SINGLE NAME
)
set
(
MULTI SCRIPT MODULE
CMAKE_GUARD
LABELS TIMEOUT
)
set
(
SINGLE NAME
WORKING_DIRECTORY
)
set
(
MULTI SCRIPT MODULE LABELS TIMEOUT
)
cmake_parse_arguments
(
PYTEST
""
"
${
SINGLE
}
"
"
${
MULTI
}
"
${
ARGN
}
)
if
(
PYTEST_COMMAND
)
message
(
FATAL_ERROR
"dune_python_add_test: COMMAND argument should not be used, use SCRIPT instead providing only the Python script and not the Python interpreter"
)
endif
()
# Apply defaults
set
(
PYTEST_CMAKE_GUARD
${
PYTEST_CMAKE_GUARD
}
DUNE_ENABLE_PYTHONBINDINGS
)
set
(
PYTEST_LABELS
${
PYTEST_LABELS
}
python
)
if
(
NOT PYTEST_TIMEOUT
)
set
(
PYTEST_TIMEOUT 3600
)
endif
()
if
(
NOT PYTEST_WORKING_DIRECTORY
)
set
(
PYTEST_WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
()
if
((
NOT PYTEST_MODULE
)
AND
(
NOT PYTEST_SCRIPT
))
message
(
FATAL_ERROR
"dune_python_add_test: Either SCRIPT or MODULE need to be specified!"
)
endif
()
...
...
@@ -81,8 +101,8 @@ function(dune_python_add_test)
COMMAND
${
PYTEST_COMMAND
}
CMD_ARGS
${
PYTEST_CMD_ARGS
}
PYTHON_TEST
CMAKE_GUARD
${
PYTEST_CMAKE_GUARD
}
LABELS
${
PYTEST_LABELS
}
WORKING_DIRECTORY
${
PYTEST_WORKING_DIRECTORY
}
TIMEOUT
${
PYTEST_TIMEOUT
}
${
PYTEST_UNPARSED_ARGUMENTS
}
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment