Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
fd904f8a
Commit
fd904f8a
authored
Apr 14, 2021
by
Dennis Gläser
Browse files
[ci][makeyml] support case of no tests
parent
402056ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci/makepipelineconfig.py
View file @
fd904f8a
...
...
@@ -37,6 +37,7 @@ def substituteAndWrite(mapping):
commandIndentation
=
' '
*
args
[
'indentation'
]
duneConfigCommand
=
'dunecontrol --opts=$DUNE_OPTS_FILE --current all'
with
open
(
args
[
'outfile'
],
'w'
)
as
ymlFile
:
def
makeScriptString
(
commands
):
...
...
@@ -45,7 +46,7 @@ with open(args['outfile'], 'w') as ymlFile:
# if no configuration is given, build and run all tests
if
not
args
[
'testconfig'
]:
buildCommand
=
[
'
dune
c
on
trol --opts=$DUNE_OPTS_FILE --current all'
,
buildCommand
=
[
dune
C
on
figCommand
,
'dunecontrol --opts=$DUNE_OPTS_FILE --current '
'make -k -j4 build_tests'
]
testCommand
=
[
'cd build-cmake'
,
'dune-ctest -j4 --output-on-failure'
]
...
...
@@ -58,24 +59,35 @@ with open(args['outfile'], 'w') as ymlFile:
testNames
=
config
.
keys
()
targetNames
=
[
tc
[
'target'
]
for
tc
in
config
.
values
()]
# The MakeFile generated by cmake contains .NOTPARALLEL statement,
# as it only allows one call to `CMakeFiles/Makefile2` at a time.
# Parallelism is taken care of within that latter Makefile. Thus,
# we let the script create a small custom makeFile here on top of
# `Makefile2`, where we define a new target to be built in parallel
buildCommand
=
[
'rm -f TestMakefile'
,
'touch TestMakefile'
,
'echo "include CMakeFiles/Makefile2" >> TestMakefile'
,
'echo "" >> TestMakefile'
,
'|
\n
'
+
commandIndentation
+
' "echo "build_selected_tests: {}" >> TestMakefile"'
.
format
(
' '
.
join
(
targetNames
)),
'make -j4 build_selected_tests'
]
testCommand
=
[
'cd build-cmake'
,
'dune-ctest -j4 --output-on-failure -R {}'
.
format
(
' '
.
join
(
testNames
))]
if
not
targetNames
:
buildCommand
=
[
duneConfigCommand
,
'echo "No tests to be built."'
]
else
:
# The MakeFile generated by cmake contains .NOTPARALLEL,
# as it only allows a single call to `CMakeFiles/Makefile2`.
# Parallelism is taken care of within that latter Makefile.
# We let the script create a small custom makeFile here on top
# of `Makefile2`, defining a new target to be built in parallel
buildCommand
=
[
duneConfigCommand
,
'cd build-cmake'
,
'rm -f TestMakefile && touch TestMakefile'
,
'echo "include CMakeFiles/Makefile2" >> TestMakefile'
,
'echo "" >> TestMakefile'
,
'|
\n
'
+
commandIndentation
+
' echo "build_selected_tests: {}" >> TestMakefile'
.
format
(
' '
.
join
(
targetNames
)),
'make -f TestMakefile -j4 build_selected_tests'
]
if
not
testNames
:
testCommand
=
[
'echo "No tests to be run, make empty report."'
,
'cd build-cmake'
,
'dune-ctest -R NOOP'
]
else
:
testCommand
=
[
'cd build-cmake'
,
'dune-ctest -j4 --output-on-failure -R {}'
.
format
(
' '
.
join
(
testNames
))]
substituteAndWrite
({
'build_script'
:
makeScriptString
(
buildCommand
),
'test_script'
:
makeScriptString
(
testCommand
)})
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment