File indexing completed on 2024-04-21 14:47:30

0001 #!/bin/bash
0002 
0003 if [ $# -ne 2 ] ; then
0004   echo Usage: compile_for_coverity_check.sh email project_token
0005   echo
0006   echo email - Email address
0007   echo project_token - The project token in Coverity Scan service
0008   echo
0009   exit 1
0010 fi
0011 
0012 # Generate the coverity file
0013 rm -rf cov-int
0014 mkdir cov-int
0015 cmake -Bcov-int -H.. -DCCACHE_SUPPORT=OFF -DUNITY_BUILD=OFF -DCMAKE_BUILD_TYPE=Debug
0016 cov-build --dir cov-int/ make -j4 -C cov-int
0017 if [ $? != 0 ]; then
0018   echo -e "FATAL: Coverity Scan compilation failed"
0019   exit 1
0020 fi
0021 nohup find cov-int -type f -print -exec strip --strip-all {} \;
0022 tar -cf - cov-int/ | xz -9 -c - > kstars.tar.xz
0023 # Upload the analysis result to Coverity Scan service
0024 curl --form token=$2 \
0025   --form email=$1 \
0026   --form file=@kstars.tar.xz \
0027   --form version="$(date -d now +%F\ %T\ )(git: $(git reflog -n 1 | cut -d ' ' -f 1))" \
0028   --form description="Jenkins CI Upload" \
0029   https://scan.coverity.com/builds?project=kstars_kde
0030