Changeset c8db44b in rtems-testing


Ignore:
Timestamp:
Feb 4, 2017, 10:58:06 PM (2 years ago)
Author:
Joel Sherrill <joel@…>
Branches:
8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
9da6e08
Parents:
80513ef
git-author:
Joel Sherrill <joel@…> (02/04/17 22:58:06)
git-committer:
Joel Sherrill <joel@…> (02/05/17 01:32:43)
Message:

Update coverity scripts to run against master

Add scripts to test newlib and rtems-tools as well as capture
the dummy Coverity model files. The website complains if you
have not filled in all the holes. Providing dummy values gives
us "completely configured" projects.

Location:
coverity
Files:
5 added
1 deleted
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • coverity/README

    r80513ef rc8db44b  
    33to have an account to view the results of the run. 
    44
     5NOTE: Please edit the script to change the email address. :)
     6
    57Coverity is a closed source static code analyser which can detect a variety
    68of programming errors.
    79
    8   + Instructions: http://scan.coverity.com/self-build/
    9   + Results:      http://scan2.coverity.com:9104/
     10  + https://scan.coverity.com/
    1011
    1112STATUS
    1213======
    13 + This script has a number of hard-coded variables that should probably
     14+ These scripts have a number of hard-coded variables that should probably
    1415  be passed in on the command line.
    1516
     
    1819
    1920+ I do not know how to grab the information on a Coverity issue and
    20   bring it to the community in a way that is nice yet.  I don't care
    21   whether this is automated or not because we don't have many issues.
    22   But when we file PRs on Coverity issues, people need to see the report.
     21  bring it to the community in a way that is nice yet. 
     22
     23+ We need to decide whether to scan BSPs and tests.
    2324
    2425--joel
    25 13 June 2010
     264 February 2017
    2627
  • coverity/do_coverity_rtems

    r80513ef rc8db44b  
    2020#
    2121
    22 RTEMS_BIN=/opt/rtems-4.11/bin
    23 COVERITY=${HOME}/prevent-linux-2.4.6
    24 RTEMS_TARGET=sparc-rtems4.11
    25 RTEMS_BSP=sis
    26 #RTEMS_TARGET=i386-rtems4.11
    27 #RTEMS_BSP=pc386
     22RTEMS_BIN=/home/joel/rtems-work/tools/4.12/bin
     23COVERITY=${HOME}/coverity/cov-analysis-linux64-8.7.0/
    2824
    29 do_mail="yes"
    3025
    3126#
     
    4035  fi
    4136}
     37
     38echo $#
     39test $# -eq 2
     40check_fatal $? "Usage: TARGET BSP"
     41
     42RTEMS_TARGET=$1
     43RTEMS_BSP=$2
     44
     45case ${RTEMS_BSP} in
     46  erc32) SMP="" ;;
     47  leon3) SMP="--enable-smp" ;;
     48  *)  echo "How to run coverity on ${RTEMS_BSP}" ; exit 1
     49esac
    4250
    4351type ${RTEMS_TARGET}-gcc
     
    5664export PATH=${COVERITY}/bin:$PATH
    5765
    58 # Configure Coverity for this target compiler
     66# # Configure Coverity for this target compiler
    5967rm -rf ${COVERITY}/config/coverity_config.xml
    6068rm -rf ${COVERITY}/config/gcc-config-? ${COVERITY}/config/g++-config-?
    6169
    62 cov-configure -co ${RTEMS_BIN}/${RTEMS_TARGET}-gcc
    63 check_fatal $? "could not coverity configure GCC"
    64 cov-configure -co ${RTEMS_BIN}/${RTEMS_TARGET}-g++
    65 check_fatal $? "could not coverity configure g++"
     70cov-configure --gcc
     71check_fatal $? "could not coverity configure gcc"
     72
     73cov-configure --comptype gcc --compiler ${RTEMS_TARGET}-gcc --template
     74check_fatal $? "could not coverity configure gcc"
    6675
    6776# Clean build directory and start over
    6877rm     -rf  b-coverity-${RTEMS_TARGET}
    6978check_fatal $? "Could not remove build directory"
    70 mkdir  -p   b-coverity-${RTEMS_TARGET}/b-${RTEMS_TARGET}
    71 check_fatal $? "Could not make build directory"
    72 cd          b-coverity-${RTEMS_TARGET}/b-${RTEMS_TARGET}
    73 check_fatal $? "Could not cd to build directory"
     79mkdir       b-coverity-${RTEMS_TARGET}
     80check_fatal $? "Could not cd into build directory"
     81cd          b-coverity-${RTEMS_TARGET}
     82check_fatal $? "Could not cd into build directory"
    7483
    7584# Configure RTEMS
    76 $r/configure --target=${RTEMS_TARGET} --enable-multilib \
    77   --disable-networking --disable-itron --disable-tests \
     85$r/configure --target=${RTEMS_TARGET} \
     86  ${SMP} --disable-networking --disable-tests \
    7887  --enable-rtemsbsp=${RTEMS_BSP} >c.log 2>&1
    7988check_fatal $? "could not configure RTEMS"
    8089
    8190# Build RTEMS
    82 cov-build -e emit -o output make -C ${RTEMS_TARGET}/cpukit >b.log 2>&1
     91cov-build --dir cov-int make >b.log 2>&1
    8392check_fatal $? "could not make RTEMS"
    8493
     
    9099
    91100# Did Coverity report something bad?
    92 grep -i cata output/build.raw >/dev/null
    93 if [ $? -ne 1 ] ; then
    94   check_fatal 1 "Catastrophic failures reported by coverity."
    95 fi
     101# grep -i cata cov-int/build-log.txt >/dev/null
     102# if [ $? -ne 1 ] ; then
     103#   check_fatal 1 "Catastrophic failures reported by coverity."
     104# fi
    96105
    97106# Did Coverity report that it had no results?
    98 grep -i "No files were emitted" output/build.raw >/dev/null
     107grep -i "No files were emitted" cov-int/build-log.txt >/dev/null
    99108if [ $? -ne 1 ] ; then
    100109  check_fatal 1 "No output from Coverity.  Something went wrong."
    101110fi
    102111
    103 # Construct the README that is needed in project.tgz
    104 cat <<EOF >README
    105 Joel Sherrill
    106 joel.sherrill@gmail.com
    107 RTEMS
    108 EOF
    109 
    110112# Now create the tar file that Coverity wants
    111 tar czvf project.tgz README emit output
     113tar czvf rtems-coverity.tar.gz cov-int
    112114check_fatal $? "could not make project.tgz"
    113115
    114 # If running inside OAR and RTEMS lab, then you will be able to
    115 # copy the results file to the ftp site and submit it to Coverity.
    116 if [ ${do_mail} = "yes" ] ; then
    117   if [ -d /home/ftp/private/coverity ] ; then
    118     echo "Placing project.tgz on RTEMS ftp site."
    119     cp project.tgz /home/ftp/private/coverity/
    120     echo "Emailing analysis request to Coverity."
    121     do_mail_coverity
    122   else
    123     # There are unfortunately some by hand steps
    124     cat <<EOF
    125 You do not have NFS access to the RTEMS.org ftp site. So you will have
    126 to copy the project.tgz and email Coverity by hand.
    127  
    128 (1) scp */project.tgz joel@www.rtems.org:/home/ftp/private/coverity/
    129 
    130 (2) Send email to Coverity to request a run. (e.g. do_mail_coverity)
    131 EOF
    132   fi
    133 fi
     116curl --form token=ce5hazuV \
     117  --form email=joel.sherrill@gmail.com \
     118  --form file=@rtems-coverity.tar.gz \
     119  --form version="4.11.99.0" \
     120  --form description="Master (${RTEMS_BSP})" \
     121  https://scan.coverity.com/builds?project=RTEMS
    134122
    135123# Ran completed OK
Note: See TracChangeset for help on using the changeset viewer.