Commit 2f15f2e6 authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch 'ci_coverage' into 'develop'

CI coverage

See merge request !543
parents 3fc1725a 9f7ea21f
Pipeline #2157 passed with stages
in 121 minutes and 42 seconds
......@@ -62,6 +62,7 @@ stages:
- build/compile_commands.json
- build/ctest_report.xml
- build/cppcheck_report.xml
- build/coverage_report.xml
.common-prepare:
extends: .general
......@@ -101,6 +102,7 @@ debian-build:
image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc
dependencies: []
## Ubuntu superbuild
ubuntu-xdk-prepare:
......@@ -218,21 +220,35 @@ windows-8-build:
#------------------------- QA related jobs -------------------------------------
ubuntu-xdk-qa-code-coverage:
extends: .common-build
only:
refs:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
variables:
- $SONAR_OTB_TOKEN
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-qa:18.04
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96"
ctest -V -S CI/main_qa.cmake
-DIMAGE_NAME:string=ubuntu-18.04-llvm-xdk
-DIMAGE_NAME:string=ubuntu-18.04-llvm-qa
-DQA:BOOL=ON
- ./CI/otb_coverage.sh
- saxon-xslt -o build/ctest_report.xml
build/Testing/`head -n 1 build/Testing/TAG`/Test.xml
CI/ctest2junit.xsl
after_script: []
dependencies:
- ubuntu-xdk-prepare
ubuntu-xdk-qa-static-analysis:
extends: .common-build
only:
refs:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
variables:
- $SONAR_OTB_TOKEN
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-qa:18.04
script:
- find Modules -type f -regextype posix-extended -regex '.*\.(h|hxx)$' -exec dirname '{}' \; |
......@@ -254,9 +270,12 @@ ubuntu-xdk-report:
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-qa:18.04
stage: report
only:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
refs:
- merge_requests
- develop
- /^release-[0-9]+\.[0-9]+$/
variables:
- $SONAR_OTB_TOKEN
script:
- sonar-scanner -Dproject.settings=sonar-project.properties
-Dsonar.host.url=https://sonar.orfeo-toolbox.org
......
......@@ -18,27 +18,11 @@
# limitations under the License.
#
include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
set( ENV{LANG} "C" ) # Only ascii output
get_filename_component( OTB_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY )
set( DEBUG "1" )
set( CMAKE_COMMAND "cmake" )
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
set( ci_build_type "Debug" )
set( CTEST_TEST_TIMEOUT 1500)
# retrieve XDK
get_xdk()
set( INSTALL_DIR "${XDK_PATH}" )
# FIX ME this part might platform dependent
set( GDAL_DATA "${XDK_PATH}/share/gdal" )
set( GEOTIFF_CSV "${XDK_PATH}/share/epsg_csv" )
set( PROJ_LIB "${XDK_PATH}/share" )
set( CTEST_ENVIRONMENT "PATH=${XDK_PATH}/lib:${XDK_PATH}/bin:$ENV{PATH}" )
set( ci_do_cookbook -1 )
set( ci_do_doxygen -1 )
include( "${CMAKE_CURRENT_LIST_DIR}/main_ci.cmake" )
include( "${CMAKE_CURRENT_LIST_DIR}/main_superbuild.cmake" )
#!/bin/bash
# usage : call CI/otb_coverage.sh from source dir
OTB_DIR="$(dirname $0)/.."
OTB_DIR="$(readlink -f $OTB_DIR)"
if [ -z "$BUILD_DIR" ]; then
BUILD_DIR=${OTB_DIR}/build
fi
echo Generating gcov reports in $BUILD_DIR ...
cd $BUILD_DIR
find $BUILD_DIR -name "*.gcda" -exec llvm-cov gcov -p '{}' > /dev/null \;
ls *.gcov | grep -E -v '#Modules#[a-zA-Z0-9]+#[a-zA-Z0-9]+#(include|src|app)#' | xargs -L 1 rm
echo Filtered $(ls $BUILD_DIR/*.gcov | wc -l) gcov reports
gcovr -r $OTB_DIR -x -g --object-directory=$BUILD_DIR > $BUILD_DIR/coverage_report.xml
echo Generated $BUILD_DIR/coverage_report.xml with $(grep -c '<class ' $BUILD_DIR/coverage_report.xml) classes
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Configuration options for ubuntu-18.04-llvm-qa
set(site_option
"CMAKE_C_COMPILER:STRING=clang
CMAKE_CXX_COMPILER:STRING=clang++
CMAKE_C_FLAGS:STRING=--coverage
CMAKE_CXX_FLAGS:STRING=--coverage
CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=lld
CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=lld
CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld
")
Data/Input/pointSet.png

128 Bytes | W: | H:

Data/Input/pointSet.png

128 Bytes | W: | H:

Data/Input/pointSet.png
Data/Input/pointSet.png
Data/Input/pointSet.png
Data/Input/pointSet.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -83,5 +83,5 @@ otb_add_test(NAME cdTeKullbackLeiblerProfileChDetTest COMMAND ${OTB_TEST_DRIVER}
${INPUTDATA}/GomaAvant.png
${INPUTDATA}/GomaApres.png
${TEMP}/KullbackLeiblerProfileChDetTest.png
5 51 1 12 24
5 30 1 6 12
)
......@@ -451,7 +451,6 @@ T otb::ogr::Field::GetValue() const
typedef typename boost::mpl::at<internal::FieldType_Map, T>::type Kind;
//const int VALUE = Kind::value;
BOOST_STATIC_ASSERT(!(boost::is_same<Kind, boost::mpl::void_>::value));
assert(m_Definition.GetType() == Kind::value && "OGR field type mismatches the type of requested field value");
typedef typename boost::mpl::at<internal::FieldGetters_Map, Kind>::type GetterType;
// If you experience a static assertion failure in the line below, it means
// the field cannot be extracted into the type requested.
......
......@@ -119,7 +119,7 @@ otb_add_test(NAME cdTvKullbackLeiblerProfileImageFilter COMMAND otbChangeDetecti
${INPUTDATA}/GomaAvant.png
${INPUTDATA}/GomaApres.png
${TEMP}/cdTVKullbackLeiblerProfileImageFilterOutput.tif
5 51)
5 31)
otb_add_test(NAME cdTvKullbackLeiblerDistanceImageFilter COMMAND otbChangeDetectionTestDriver
--compare-image ${EPSILON_10}
......
......@@ -63,10 +63,10 @@ otb_add_test(NAME bfTvCompareOverlapSaveAndClassicalConvolutionWithGaborFilter C
${TEMP}/bfTvCompareConvolutionOutput.tif
${TEMP}/bfTvCompareOSConvolutionoutput.tif
otbCompareOverlapSaveAndClassicalConvolutionWithGaborFilter
${INPUTDATA}/ROI_IKO_PAN_LesHalles_sub.tif
${INPUTDATA}/QB_PAN_ROI_1000_100.tif
${TEMP}/bfTvCompareConvolutionOutput.tif
${TEMP}/bfTvCompareOSConvolutionoutput.tif
64 64 #Radius
32 32 #Radius
0.02 0.025 # a b
-45 # theta
0.0125 0.0125 #u0 v0
......
......@@ -74,13 +74,13 @@ otb_add_test(NAME bfTvMeanShiftSmoothingImageFilterNonOptim COMMAND otbSmoothing
2 10 0.1 10 0
)
otb_add_test(NAME bfTuMeanShiftSmoothingImageFilterROIQBMul4 COMMAND otbSmoothingTestDriver
otb_add_test(NAME bfTuMeanShiftSmoothingImageFilterROIQB COMMAND otbSmoothingTestDriver
otbMeanShiftSmoothingImageFilter
${INPUTDATA}/ROI_QB_MUL_4.tif
${TEMP}/bfMeanShiftSmoothingImageFilterSpatialOutput_ROIQBMul4.tif
${TEMP}/bfMeanShiftSmoothingImageFilterSpectralOutput_ROIQBMul4.tif
${TEMP}/bfMeanShiftSmoothingImageFilterIterationOutput_ROIQBMul4.tif
${TEMP}/bfMeanShiftSmoothingImageFilterLabelOutput_ROIQBMul4.tif
${INPUTDATA}/QB_MUL_ROI_1000_100.tif
${TEMP}/bfMeanShiftSmoothingImageFilterSpatialOutput_ROIQB.tif
${TEMP}/bfMeanShiftSmoothingImageFilterSpectralOutput_ROIQB.tif
${TEMP}/bfMeanShiftSmoothingImageFilterIterationOutput_ROIQB.tif
${TEMP}/bfMeanShiftSmoothingImageFilterLabelOutput_ROIQB.tif
4 50 0.1 100
)
......@@ -133,19 +133,19 @@ otb_add_test(NAME bfTuMeanShiftSmoothingImageFilterQBRoad COMMAND otbSmoothingTe
otb_add_test(NAME bfTuMeanShiftSmoothingImageFilterSpatialStability COMMAND otbSmoothingTestDriver
otbMeanShiftSmoothingImageFilterSpatialStability
${INPUTDATA}/ROI_QB_MUL_4.tif
4 50 0.1 40
100 100 512 512
${INPUTDATA}/QB_MUL_ROI_1000_100.tif
2 50 0.1 10
10 10 80 80
)
otb_add_test(NAME bfTvMeanShiftSmoothingImageFilterThreadingNonOpt COMMAND otbSmoothingTestDriver
--compare-image ${EPSILON_7}
${TEMP}/bfMeanShiftSmoothingImageFilter2SingleThreading_SPOT5.tif
${TEMP}/bfMeanShiftSmoothingImageFilter2MultiThreading_SPOT5.tif
${TEMP}/bfMeanShiftSmoothingImageFilterSingleThread.tif
${TEMP}/bfMeanShiftSmoothingImageFilterMultiThread.tif
otbMeanShiftSmoothingImageFilterThreading
${INPUTDATA}/SPOT5_EXTRACTS/Arcachon/Arcachon_extrait_3852_3319_546_542.tif
${TEMP}/bfMeanShiftSmoothingImageFilter2SingleThreading_SPOT5.tif
${TEMP}/bfMeanShiftSmoothingImageFilter2MultiThreading_SPOT5.tif
4 10 0
${INPUTDATA}/QB_MUL_ROI_1000_100.tif
${TEMP}/bfMeanShiftSmoothingImageFilterSingleThread.tif
${TEMP}/bfMeanShiftSmoothingImageFilterMultiThread.tif
4 50 0
)
......@@ -41,7 +41,7 @@ otb_module_target_label(otbDisparityMapTestDriver)
# Tests Declaration
otb_add_test(NAME dmTvDisparityMapEstimationMethod COMMAND otbDisparityMapTestDriver
--compare-ascii ${NOTOL}
--compare-ascii ${EPSILON_3}
${BASELINE_FILES}/dmDisparityMapEstimationOutput1.txt
${TEMP}/dmDisparityMapEstimationOutput1.txt
otbDisparityMapEstimationMethod
......@@ -49,7 +49,7 @@ otb_add_test(NAME dmTvDisparityMapEstimationMethod COMMAND otbDisparityMapTestDr
${INPUTDATA}/moving.png
${INPUTDATA}/pointSet.png
${TEMP}/dmDisparityMapEstimationOutput1.txt
20 20
10 10
)
#otb_add_test(NAME dmTvDisparityMapToDEMFilter COMMAND otbDisparityMapTestDriver
......
......@@ -69,8 +69,7 @@ int otbDisparityMapEstimationMethod(int itkNotUsed(argc), char* argv[])
typedef itk::MinimumMaximumImageCalculator<ImageType> MinMaxType;
MinMaxType::Pointer mm = MinMaxType::New();
mm->SetImage(pointSetReader->GetOutput());
mm->ComputeMinimum();
mm->ComputeMaximum();
mm->Compute();
std::cout << "min: " << (int) mm->GetMinimum() << " max: " << (int) mm->GetMaximum() << std::endl;
PointSetSourceType::Pointer pointSetSource = PointSetSourceType::New();
......@@ -96,7 +95,7 @@ int otbDisparityMapEstimationMethod(int itkNotUsed(argc), char* argv[])
// For gradient descent
optimizer->SetLearningRate(5.0);
optimizer->SetNumberOfIterations(600);
optimizer->SetNumberOfIterations(100);
DMEstimationType::ParametersType initialParameters(transform->GetNumberOfParameters());
initialParameters[0] = 0.0; // Initial offset in mm along X
initialParameters[1] = 0.0; // Initial offset in mm along Y
......
......@@ -70,12 +70,12 @@ otb_add_test(NAME bfTvConnectedComponentMuParserFunctorTestMask COMMAND otbCCOBI
otb_add_test(NAME obTuMeanShiftStreamingConnectedComponentSegmentationOBIAToVectorDataFilter COMMAND otbCCOBIATestDriver
otbMeanShiftStreamingConnectedComponentSegmentationOBIAToVectorDataFilter
${INPUTDATA}/ROI_QB_MUL_4.tif
${INPUTDATA}/QB_MUL_ROI_1000_100.tif
${TEMP}/obTuMeanShiftStreamingConnectedComponentSegmentationOBIAToVectorDataFilter.shp
9
10
0.001
"distance<10"
6
50
0.1
"distance<20"
20
"SHAPE_Elongation>10"
5)
......
......@@ -34,13 +34,13 @@ otb_module_target_label(otbMeanShiftTestDriver)
otb_add_test(NAME obTuMeanShiftConnectedComponentSegmentationFilter COMMAND otbMeanShiftTestDriver
otbMeanShiftConnectedComponentSegmentationFilter
${INPUTDATA}/ROI_QB_MUL_4.tif
${TEMP}/obTuMeanShiftConnectedComponentSegmentationImage.png
9
9
0.01
"distance<0.2"
50)
${INPUTDATA}/QB_MUL_ROI_1000_100.tif
${TEMP}/obTuMeanShiftConnectedComponentSegmentationImage.tif
6
50
0.1
"distance<20"
5)
otb_add_test(NAME obTuMeanShiftSegmentationFilterPruning COMMAND otbMeanShiftTestDriver
otbMeanShiftSegmentationFilter
......
sonar.projectKey=orfeotoolbox-otb
sonar.projectName=Orfeo Toolbox
sonar.projectDescription="Orfeo ToolBox is an open-source project for state-of-the-art remote sensing"
sonar.links.homepage="https://gitlab.orfeo-toolbox.org/sdinot/otb"
sonar.links.scm="https://gitlab.orfeo-toolbox.org/sdinot/otb.git"
sonar.links.ci="https://gitlab.orfeo-toolbox.org/sdinot/otb/pipelines"
sonar.links.homepage="https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb"
sonar.links.scm="https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git"
sonar.links.ci="https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/pipelines"
sonar.sourceEncoding=UTF-8
sonar.language=c++
sonar.projectBaseDir=.
sonar.sources=Modules
sonar.cxx.includeDirectories=Modules
sonar.exclusions="Modules/ThirdParty/**"
sonar.coverage.exclusions="Modules/*/*/test/*.*"
sonar.cxx.suffixes.sources=.cpp,.cxx,.txx,.cc,.c
sonar.cxx.suffixes.headers=.hxx,.h
# Commented because the relative paths are not analyzed correctly
#sonar.cxx.jsonCompilationDatabase=build/compile_commands.json
sonar.cxx.compiler.parser=GCC
sonar.cxx.xunit.reportPath=build/ctest_report.xml
# Not provided yet
#sonar.cxx.coverage.reportPath=build/coverage_report.xml
sonar.cxx.coverage.reportPath=build/coverage_report.xml
sonar.cxx.cppcheck.reportPath=build/cppcheck_report.xml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment