huojianchaoyy opened a new pull request, #4039:
URL: https://github.com/apache/nuttx-apps/pull/4039

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   ## Summary
   - **system/gcov: fix the indentation of the option switch**: the case labels 
of the `getopt()` switch were not indented inside its braces, which nxstyle 
reports as "Bad alignment" for every line of the switch. No functional change.
   - **system/gcov: return after a reset**: `gcov -r` reset the counters while 
it parsed the options and then went on to dump them. With no `-d` option there 
is no `GCOV_PREFIX`, so every reset was followed by a failed dump. `-r` now 
only resets, says so, and returns. The help text of `-d` and `-h` is shorter.
   
   ## Impact
   Only the `gcov` command changes: `gcov -r` no longer dumps, and the help 
text is different. No API or Kconfig change.
   
   ## Testing
   Host: Ubuntu 22.04 x86_64, GCC 13.4.0, CMake 3.23 + Ninja. Target: `sim:nsh` 
with `CONFIG_COVERAGE_MINI=y CONFIG_SYSTEM_GCOV=y`, nuttx master dc9481383ed, 
nuttx-apps master 0949c4c9d.
   
   `./tools/checkpatch.sh -c -u -m -g HEAD~2..HEAD` passes.
   
   Before:
   ```
   nsh> gcov -r
   No path prefix specified
   open (null) failed! ret: -1
   Gcov dump failed
   nsh> gcov -h
   
   Usage: gcov [-d path] [-t strip] [-r] [-h]
   
   Where:
     -d dump the coverage, path is the path to the coverage file, the default 
output is to stdout
     -t strip the path prefix number
     -r reset the coverage
     -h show this text and exits.
   ```
   After:
   ```
   nsh> gcov -r
   reset done
   nsh> gcov -h
   
   Usage: gcov [-d path] [-t strip] [-r] [-h]
   
   Where:
     -d dump coverage data to path (e.g. /dev/console)
     -t strip the path prefix number
     -r reset the coverage
     -h show this help
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to