Coverage Analysis on rtems 4.10 of switch case structures

Juanma Mail List greenlean.maillist at gmail.com
Wed Apr 29 08:46:35 UTC 2015


Hello,

I am doing a coverage analysis for a software code which is based on 
RTEMS 4.10 and runs on a sparc-leon3 platform from Gaisler. I have 
problem with the coverage of switch-case structures.

The software mostly processes the commands that are send to it, and do 
the actions associated to the them. To do the coverage, I have added 
some wrappers and compiled the software as a static library.

And finally a set of test application do the call to the library and 
check the coverage.

My framework uses:

     - TSIM/LEON3 SPARC simulator, version 2.0.19 (professional version).
     - covoar tool and leon3 simulation script  from  rtems-testing tools.
     - sparc-rtems-gcov, lcov and genhtml.

I am not able to cover the switch-case structures. The coverage shows 
that the execution always hit the first case of the switch-case.

Does anyone seen this behavior before?

Many thanks, Juanma.

*$ *sparc-rtems-gcc -v
         Reading specs from /opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/specs
         Target: sparc-rtems
         Configured with: ../../gcc/configure --target=sparc-rtems 
--with-gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads 
--enable-languages=c,c++ --disable-nls --prefix=/opt/rtems-4.10 
--enable-version-specific-runtime-libs --with-system-zlib 
--disable-libstdcxx-pch --disable-win32-registry --without-included-gettext
         Thread model: rtems
         gcc version 4.4.6 (GCC)


*$* sparc-rtems-gcov -v
     gcov (GCC) 4.4.6
     Copyright (C) 2010 Free Software Foundation, Inc.
     This is free software; see the source for copying conditions.
     There is NO warranty; not even for MERCHANTABILITY or
     FITNESS FOR A PARTICULAR PURPOSE.

The tests are compiled wth the flags

         CCFLAGS =  -fprofile-arcs -ftest-coverage
         LDFLAGS = -lgcov -coverage


My coverage script:

./leon3 -c -l 120 simpletest.exe
echo "Cleaning counters and create intial..."
lcov --zerocounters --directory "$SOURCE_DIR" > log/gcov.log 2>&1
lcov --capture --initial --directory "$SOURCE_DIR" --output-file 
"$OUTPUT_DIR/coverage.info" --gcov-tool "$GCOV" >> log/gcov.log 2>&1

covoar -v -C config $TESTSUITE >> log/gcov.log 2>&1
lcov --no-checksum -d $SOURCE_DIR  --capture --output-file 
"$OUTPUT_DIR/coverage.info" --gcov-tool $GCOV --config-file 
../rtemsNOMAD/sfs.lcovrc >> log/gcov.log 2>&1

echo "Generating report $OUTPUT_DIR/$REPORTDIR"
genhtml --highlight --legend --output-directory 
"$OUTPUT_DIR"/"$REPORTDIR"  coverage.info --config-file 
../rtemsNOMAD/sfs.lcovrc >> log/gcov.log 2>&1



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20150429/033b4773/attachment-0001.html>


More information about the users mailing list