Skip to content
Snippets Groups Projects
Commit 6ecac658 authored by Levon Sargsyan's avatar Levon Sargsyan
Browse files

Add downlading lcov if directory not present

parent db77a2d3
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#!/bin/bash
qtbranch_str=$1
qtbanch=$2
set -e
cwd=`pwd`
if [ -z $QT_BIN_DIR ]; then
echo "set \$QT_BIN_DIR where qmake is located"
if [ "$qtbanch" == "" ]; then
me=`basename "$0"`
echo "usage: ./$me -branch <qt branch>"
exit 1
fi
if [ -z $LCOV_DIR ]; then
echo "set \$LCOV_DIR to point to lcov binary"
if [ -z $QT_BIN_DIR ]; then
echo "set \$QT_BIN_DIR where qmake is located"
exit 1
fi
......@@ -21,11 +25,27 @@ fi
#checkout qttools if needed
#cofigure and make
mkdir -p $COV_WORKDIR
if [ -z $LCOV_DIR ]; then
mkdir -p $COV_WORKDIR/lcov
cd $COV_WORKDIR/lcov
wget -c https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-1.14.tar.gz
tar xzf lcov-1.14.tar.gz
#echo "set \$LCOV_DIR to point to lcov binary"
#exit 1
export LCOV_DIR=$COV_WORKDIR/lcov/lcov-1.14
echo "Using lcov: $COV_WORKDIR/lcov/lcov-1.14/bin "
cd - &> /dev/null
fi
#exit 1
cd $COV_WORKDIR
if [ ! -d qttools ]; then
#todo replace with code.qt.io
git clone https://github.com/qt/qttools
cd qttools
git checkout "$qtbranch"
$QT_BIN_DIR/qmake
cd src/qdoc
$QT_BIN_DIR/qmake
......@@ -34,8 +54,9 @@ if [ ! -d qttools ]; then
make -j8
cp $QT_BIN_DIR/qdoc $QT_BIN_DIR/qdoc_real
fi
cd $COV_WORKDIR
cd $COV_WORKDIR
#exit
#replace with wrapper
rm $QT_BIN_DIR/qdoc -f
ln -s $cwd/qdoc_cov_wrapper.sh $QT_BIN_DIR/qdoc
......@@ -50,12 +71,8 @@ make -j8
#run tests
#TODO automate
./config/tst_config
cd generatedoutput
./tst_generatedOutput
#./generatedoutput/tst_generatedOutput
cd -
./generatedoutput/tst_generatedOutput
./utilities/tst_utilities
#finilize
mkdir -p $COV_WORKDIR/HTML
......@@ -63,3 +80,4 @@ cd $COV_WORKDIR/HTML
other_args=`cat $COV_WORKDIR/merge_helper`
$LCOV_DIR/bin/lcov --exclude "/usr/*" --exclude "/usr/*" --exclude "*/qtdeclarative/*" --exclude "*/qtbase/*" --exclude "*/qdoc/parser/*" -o final.OUT $other_args
$LCOV_DIR/bin/genhtml --demangle-cpp final.OUT --ignore-errors source
echo "Result are here: $COV_WORKDIR/HTML/index.html "
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