Skip to content
Snippets Groups Projects
Commit 8c30db92 authored by Martin Killenberg's avatar Martin Killenberg
Browse files

setting environment variables from config possible

parent 7ad5cdb1
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,14 @@ env.CTESTOPTS="-j1"
env.RUN_FROM_SUBDIR="examples"
```
- Set extra environment variables:
The variables are gives as space separated lists of key=values pairs. The pairs must not have spaces. JOB_VARIABLES are applied to build and tests (incl. analysis), while TEST_VARIABLES are only in tests and analysis.
```
env.JOB_VARIABLES="A=aha B=bubu"
env.TEST_VARABLES="PATH=${PATH}:/some/path/for/the/test"
```
## Analysis jobs
- Exclude tests from being run in valgrind (currently only possible with a single test):
```
......
......@@ -166,6 +166,9 @@ def doBuild(String label, String buildType) {
else
SUBDIR="${env.RUN_FROM_SUBDIR}"
fi
for VAR in \${JOB_VARIABLES}; do
export ${VAR}
done
sudo -H -u msk_jenkins cmake /scratch/source/\${SUBDIR} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${buildType} -DSUPPRESS_AUTO_DOC_BUILD=true \${CMAKE_EXTRA_ARGS}
sudo -H -u msk_jenkins make ${env.MAKEOPTS}
"""
......@@ -191,6 +194,9 @@ def doTest(String label, String buildType) {
if [ -z "\${CTESTOPTS}" ]; then
CTESTOPTS="${env.MAKEOPTS}"
fi
for VAR in \${JOB_VARIABLES} \${TEST_VARIABLES}; do
export ${VAR}
done
sudo -H -u msk_jenkins ctest --no-compress-output \${CTESTOPTS} -T Test -V || true
sudo -H -u msk_jenkins sed -i Testing/*/Test.xml -e 's_\\(^[[:space:]]*<Name>\\)\\(.*\\)\\(</Name>\\)\$_\\1${label}.${buildType}.\\2\\3_'
sudo -H -u msk_jenkins cp -r /scratch/build-${JOB_NAME}/Testing "${WORKSPACE}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment