Home | History | Annotate | only in /external/parameter-framework/upstream/tools/coverage
Up to higher level directory
NameDateSize
aplog2coverage.sh22-Oct-20204.2K
coverage.py22-Oct-202034.9K
coverage.xsl22-Oct-202010.5K
README.md22-Oct-20201.9K

README.md

      1 # Domain coverage report
      2 
      3 ## Introduction
      4 
      5 During the PFW's life cycle, criteria states are changed and configurations are
      6 applied.
      7 
      8 This report gives the coverage for :
      9 
     10 - Criterion: detect easily which criterion state aren't used.
     11 - Configuration: detect configuration that are never applied.
     12 - Configuration rule: part of the rules that are useless and could be removed.
     13 - Total average coverage
     14 
     15 Two things are needed to generate a coverage report:
     16 
     17 1. The Settings file
     18 2. parameter-framework logs
     19 
     20 ## How to get the Settings file
     21 
     22 Usually, you have this file at hand.  But if getting the Settings file is
     23 painful, you may use remote-process to print it:
     24 
     25     remote-process <host> <port> getDomainsWithSettingsXML > domains.xml
     26 
     27 ## How to get PFW logs
     28 
     29 You must get the logs from the start of the parameter-framework.
     30 
     31 On Android, you should stop the process instantiating the parameter-framework,
     32 clear the logs, start the process and get the logs using logcat.  E.g:
     33 
     34     $ adb shell stop your_process
     35     $ adb logcat -c
     36     $ adb logcat > coverage.log &
     37     $ adb shell start your_process
     38     ... do your testing ...
     39     kill the background logcat started above
     40 
     41 ## How to generate the report
     42 
     43 Then execute :
     44 
     45     $ aplog2coverage.sh -d domains.xml -e<some_regex> coverage.log -o coverageReport.html
     46 
     47 You may pass several log files.
     48 
     49 The regex (-e argument) is used to match relevant log lines: If you have
     50 several PFW instances running, you need to have a way to tell which instance is
     51 logging each line.  Besides, if accelerates the parsing by eliminating
     52 irrelevant log lines.
     53 
     54 You may pass the optional `-f` argument to ignore some parse errors.
     55 
     56 ### Limitations
     57 
     58 - Having more than one dot (".") in log paths is not supported (see the sort
     59   implementation (sort -rn -k2 -t.) in aplog2coverage.sh).
     60 - A PFW start log line must be at the head of the oldest log: no
     61   applyconfiguration or set criterion log should be found before the PFW start.
     62