[riot-notifications] [RIOT-OS/RIOT] tests/gnrc_udp: reimplement using sys/optparse. (#11400)

Juan I Carrano notifications at github.com
Mon Apr 15 16:29:21 CEST 2019


### Contribution description

Some time ago I wrote #9538 but it was lacking an example of how it can be used. Now, inspired by #11357 , I present the "optparse version" of  tests/gnrc_udp.

For more information, see #9538

### Testing procedure1

The module is tested in the original PR. The goal of this is just to show how code looks like when it uses sys/optparse.

### Issues/PRs references

Depends on #9538.

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11400

-- Commit Summary --

  * sys/optparse: Add command line parser.
  * sys/optparse: Style fixes.
  * sys/optparse: Add makefile
  * sys/optparse: Add const qualifiers.
  * sys/optparse: fix small bug
  * tests/optparse: Add unit testing
  * sys/optparse: Enhance doxygen output.
  * sys/optparse: tidy up do_action.
  * sys/optparse: docs: add suggested usage for OPTPARSE_STR.
  * sys/optparse: remove double support.
  * sys/optparse: change type of action member to enum.
  * sys/optparse: Make help string const.
  * sys/optparse: extensive refactoring.
  * fixups! marginal code size improvements.
  * fixup! fix validation assertion.
  * unittests/tests-optparse: test  number formatting errors.
  * fixup! fix bug in find_arg_rule (read flags with &)
  * sys/optparse: Change error reporting.
  * tests/gnrc_udp: convert to optparse.
  * fixup! remove port parser.

-- File Changes --

    M sys/Makefile (3)
    A sys/include/optparse.h (435)
    A sys/optparse/Makefile (1)
    A sys/optparse/optparse.c (602)
    M tests/gnrc_udp/Makefile (3)
    M tests/gnrc_udp/main.c (10)
    M tests/gnrc_udp/udp.c (214)
    A tests/unittests/tests-optparse/Makefile (1)
    A tests/unittests/tests-optparse/Makefile.include (1)
    A tests/unittests/tests-optparse/tests-optparse.c (318)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11400.patch
https://github.com/RIOT-OS/RIOT/pull/11400.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190415/d08ac786/attachment-0001.html>


More information about the notifications mailing list