Browse Source

package/ci: added Clang Analyzer and Clang *Sanitizer jobs.

pull/77/head
Vladimír Vondruš 12 years ago
parent
commit
3b3499ac2f
  1. 7
      doc/building.dox
  2. 158
      package/ci/jenkins-clang-analyzer.xml
  3. 103
      package/ci/jenkins-clang-sanitizer-gltests.xml
  4. 166
      package/ci/jenkins-clang-sanitizer.xml

7
doc/building.dox

@ -529,6 +529,13 @@ library with every combination of them. You can add/remove the axes in
Magnum-GLTests depend on active X11 session, thus they should be run from
Jenkins instance running on graphical user session.
Clang Analyzer and *Sanitizer checks are also available. They both require
**Clang**, Analyzer job additionally requires **clang-analyzer** tool.
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job Magnum-ClangAnalyzer < package/ci/jenkins-clang-analyzer.xml
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job Magnum-ClangSanitizer < package/ci/jenkins-clang-sanitizer.xml
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job Magnum-ClangSanitizer-GLTests < package/ci/jenkins-clang-sanitizer-gltests.xml
There is also MinGW-w64, Emscripten, NaCl and Android configuration, add or
update them with the commands below. See @ref building-crosscompiling for more
information about setting up the crosscompilers and `toolchains/` submodule.

158
package/ci/jenkins-clang-analyzer.xml

@ -0,0 +1,158 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.0">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>git://github.com/mosra/magnum.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.CloneOption>
<shallow>true</shallow>
<reference></reference>
</hudson.plugins.git.extensions.impl.CloneOption>
</extensions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>Magnum</customWorkspace>
<axes>
<hudson.matrix.TextAxis>
<name>gl</name>
<values>
<string>desktop</string>
<string>es2</string>
<string>es2desktop</string>
<string>es3</string>
<string>es3desktop</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>compatibility</name>
<values>
<string></string>
<string>deprecated</string>
</values>
</hudson.matrix.TextAxis>
</axes>
<builders>
<hudson.tasks.Shell>
<command>
<![CDATA[
if [ "${compatibility}" = "deprecated" ] ; then
deprecated_build_flag=ON
else
deprecated_build_flag=OFF
fi
if [ ${gl} = "desktop" ] ; then
desktop_flag=ON
es_flag=OFF
windowless_flag=ON
elif [ ${gl} = "es2" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=ON"
desktop_flag=OFF
es_flag=ON
windowless_flag=OFF
elif [ ${gl} = "es2desktop" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=ON -DTARGET_DESKTOP_GLES=ON"
desktop_flag=OFF
es_flag=OFF
windowless_flag=ON
elif [ ${gl} = "es3" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=OFF"
desktop_flag=OFF
es_flag=ON
windowless_flag=OFF
elif [ ${gl} = "es3desktop" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=OFF -DTARGET_DESKTOP_GLES=ON"
desktop_flag=OFF
es_flag=OFF
windowless_flag=ON
fi
mkdir -p build-clang-analyzer-${compatibility}-${gl}
cd build-clang-analyzer-${compatibility}-${gl}
scan-build --use-c++=$(which clang++) cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/clang-analyzer-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/clang-analyzer-${compatibility}-${gl} \
-DCMAKE_INSTALL_RPATH="${JENKINS_HOME}/filesystem/clang-analyzer-${compatibility}/lib;${JENKINS_HOME}/filesystem/clang-analyzer-${compatibility}-${gl}/lib" \
-DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" \
-DCMAKE_EXE_LINKER_FLAGS=-lc++abi \
-DBUILD_TESTS=ON \
-DBUILD_GL_TESTS=${windowless_flag} \
-DBUILD_DEPRECATED=${deprecated_build_flag} \
${gl_flags} \
-DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=${es_flag} \
-DWITH_EGLCONTEXT=ON \
-DWITH_GLXCONTEXT=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=${desktop_flag} \
-DWITH_OBJIMPORTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
-DWITH_WAVAUDIOIMPORTER=ON \
-DWITH_DISTANCEFIELDCONVERTER=${desktop_flag} \
-DWITH_FONTCONVERTER=${desktop_flag} \
-DWITH_MAGNUMINFO=${windowless_flag}
make clean
scan-build --use-c++=$(which clang++) make -j
make install
]]>
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.textfinder.TextFinderPublisher plugin="text-finder@1.9">
<regexp>scan-build: \d+ bugs found</regexp>
<succeedIfFound>false</succeedIfFound>
<unstableIfFound>true</unstableIfFound>
<alsoCheckConsoleOutput>true</alsoCheckConsoleOutput>
</hudson.plugins.textfinder.TextFinderPublisher>
</publishers>
<buildWrappers/>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>true</runSequentially>
<touchStoneCombinationFilter>
<![CDATA[
compatibility == "deprecated" && gl == "desktop"
]]>
</touchStoneCombinationFilter>
<touchStoneResultCondition>
<name>UNSTABLE</name>
<ordinal>1</ordinal>
<color>YELLOW</color>
<completeBuild>true</completeBuild>
</touchStoneResultCondition>
</executionStrategy>
<childCustomWorkspace>.</childCustomWorkspace>
</matrix-project>

103
package/ci/jenkins-clang-sanitizer-gltests.xml

@ -0,0 +1,103 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.0">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>git://github.com/mosra/magnum.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.CloneOption>
<shallow>true</shallow>
<reference></reference>
</hudson.plugins.git.extensions.impl.CloneOption>
</extensions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>Magnum</customWorkspace>
<axes>
<hudson.matrix.TextAxis>
<name>gl</name>
<values>
<string>desktop</string>
<string>es2desktop</string>
<string>es3desktop</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>compatibility</name>
<values>
<string></string>
<string>deprecated</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>sanitizer</name>
<values>
<string>address</string>
<!-- <string>memory</string> -->
<!-- <string>undefined</string> -->
</values>
</hudson.matrix.TextAxis>
</axes>
<builders>
<hudson.tasks.Shell>
<command>
<![CDATA[
cd build-clang-${sanitizer}sanitizer-${compatibility}-${gl}
ninja
ctest --output-on-failure -R GLTest -j5 || true
]]>
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.textfinder.TextFinderPublisher plugin="text-finder@1.9">
<regexp>Errors while running CTest</regexp>
<succeedIfFound>false</succeedIfFound>
<unstableIfFound>true</unstableIfFound>
<alsoCheckConsoleOutput>true</alsoCheckConsoleOutput>
</hudson.plugins.textfinder.TextFinderPublisher>
</publishers>
<buildWrappers/>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>true</runSequentially>
<touchStoneCombinationFilter>
<![CDATA[
compatibility == "deprecated" && gl == "desktop" && sanitizer == "address"
]]>
</touchStoneCombinationFilter>
<touchStoneResultCondition>
<name>SUCCESS</name>
<ordinal>0</ordinal>
<color>BLUE</color>
<completeBuild>true</completeBuild>
</touchStoneResultCondition>
</executionStrategy>
<childCustomWorkspace>.</childCustomWorkspace>
</matrix-project>

166
package/ci/jenkins-clang-sanitizer.xml

@ -0,0 +1,166 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.0">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>git://github.com/mosra/magnum.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.CloneOption>
<shallow>true</shallow>
<reference></reference>
</hudson.plugins.git.extensions.impl.CloneOption>
</extensions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>Magnum</customWorkspace>
<axes>
<hudson.matrix.TextAxis>
<name>gl</name>
<values>
<string>desktop</string>
<string>es2</string>
<string>es2desktop</string>
<string>es3</string>
<string>es3desktop</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>compatibility</name>
<values>
<string></string>
<string>deprecated</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>sanitizer</name>
<values>
<string>address</string>
<!-- <string>memory</string> -->
<!-- <string>undefined</string> -->
</values>
</hudson.matrix.TextAxis>
</axes>
<builders>
<hudson.tasks.Shell>
<command>
<![CDATA[
if [ "${compatibility}" = "deprecated" ] ; then
deprecated_build_flag=ON
else
deprecated_build_flag=OFF
fi
if [ ${gl} = "desktop" ] ; then
desktop_flag=ON
es_flag=OFF
windowless_flag=ON
elif [ ${gl} = "es2" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=ON"
desktop_flag=OFF
es_flag=ON
windowless_flag=OFF
elif [ ${gl} = "es2desktop" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=ON -DTARGET_DESKTOP_GLES=ON"
desktop_flag=OFF
es_flag=OFF
windowless_flag=ON
elif [ ${gl} = "es3" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=OFF"
desktop_flag=OFF
es_flag=ON
windowless_flag=OFF
elif [ ${gl} = "es3desktop" ] ; then
gl_flags="-DTARGET_GLES=ON -DTARGET_GLES2=OFF -DTARGET_DESKTOP_GLES=ON"
desktop_flag=OFF
es_flag=OFF
windowless_flag=ON
fi
mkdir -p build-clang-${sanitizer}sanitizer-${compatibility}-${gl}
cd build-clang-${sanitizer}sanitizer-${compatibility}-${gl}
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/clang-${sanitizer}sanitizer-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/clang-${sanitizer}sanitizer-${compatibility}-${gl} \
-DCMAKE_INSTALL_RPATH="${JENKINS_HOME}/filesystem/clang-${sanitizer}sanitizer-${compatibility}/lib;${JENKINS_HOME}/filesystem/clang-${sanitizer}sanitizer-${compatibility}-${gl}/lib" \
-DCMAKE_CXX_FLAGS="-std=c++11" \
-DBUILD_TESTS=ON \
-DBUILD_GL_TESTS=${windowless_flag} \
-DBUILD_DEPRECATED=${deprecated_build_flag} \
${gl_flags} \
-DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_XEGLAPPLICATION=${es_flag} \
-DWITH_EGLCONTEXT=ON \
-DWITH_GLXCONTEXT=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=${desktop_flag} \
-DWITH_OBJIMPORTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
-DWITH_WAVAUDIOIMPORTER=ON \
-DWITH_DISTANCEFIELDCONVERTER=${desktop_flag} \
-DWITH_FONTCONVERTER=${desktop_flag} \
-DWITH_MAGNUMINFO=${windowless_flag} \
-G Ninja
ninja
ctest --output-on-failure -E GLTest -j5 || true
ninja install
]]>
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.textfinder.TextFinderPublisher plugin="text-finder@1.9">
<regexp>Errors while running CTest</regexp>
<succeedIfFound>false</succeedIfFound>
<unstableIfFound>true</unstableIfFound>
<alsoCheckConsoleOutput>true</alsoCheckConsoleOutput>
</hudson.plugins.textfinder.TextFinderPublisher>
</publishers>
<buildWrappers/>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>true</runSequentially>
<touchStoneCombinationFilter>
<![CDATA[
compatibility == "deprecated" && gl == "desktop" && sanitizer == "address"
]]>
</touchStoneCombinationFilter>
<touchStoneResultCondition>
<name>UNSTABLE</name>
<ordinal>1</ordinal>
<color>YELLOW</color>
<completeBuild>true</completeBuild>
</touchStoneResultCondition>
</executionStrategy>
<childCustomWorkspace>.</childCustomWorkspace>
</matrix-project>
Loading…
Cancel
Save