Improve coverage analysis toolset

Chris Johns chrisj at rtems.org
Mon Apr 2 22:28:20 UTC 2018


On 03/04/2018 02:10, Cillian O'Donnell wrote:
> Sure if you want to crack at it.
> 
> If you pull the ini-update branch again, I've included the other files you'll need.
> 
> Now if you try and run rtems-test with coverage you will get
> 
> cpod at cpod ~ $ $HOME/development/rtems/test/rtems-tools/tester/rtems-test
> --rtems-tools=$HOME/development/rtems/5 --log=coverage-analysis.log
> --rtems-bsp=leon3_qemu --coverage --rtems-builddir=$HOME/development/rtems/leon3
> sparc-rtems5/c/leon3/testsuites/samples
> RTEMS Testing - Tester, 5 (80a1e6d9607e)
> Traceback (most recent call last):
>   File "/home/cpod/development/rtems/test/rtems-tools/tester/rtems-test", line
> 40, in <module>
>     rt.test.run()
>   File "/home/cpod/development/rtems/test/rtems-tools/tester/rt/test.py", line
> 310, in run
>     coverage = coverage_get_obj(opts, path_to_builddir[1])
>   File "/home/cpod/development/rtems/test/rtems-tools/tester/rt/test.py", line
> 230, in coverage_get_obj
>     coverage_obj = coverage.coverage_run(opts.defaults, path_to_builddir)
>   File "/home/cpod/development/rtems/test/rtems-tools/tester/rt/coverage.py",
> line 329, in __init__
>     self.config_map = self.macros.macros['coverage']

I would not access the 'macros' dictionary directly like this. It circumvents
the map support. There is '__getitem__' support on the class which is better but
still raises an exception on an index error. You can ask if a key is present and
the 'get()' interface returns 'None' if not found.

> KeyError: 'coverage'

Can we please create new threads for new topics?

Thanks
Chris


More information about the devel mailing list