nicob87 opened a new pull request #684: WIP: (Work In Progress) DISPATCH-1568: using doctest URL: https://github.com/apache/qpid-dispatch/pull/684 - Demo using the library that Jiri Daněk suggested in the issue, it seems to be a very nice option for several reasons, it is an evolution of catch2, compile time significantly smaller, support nested "subcases" which simplifyes setup and teardown, it is a single header file, and others. see: https://github.com/onqtam/doctest - jira: https://issues.apache.org/jira/browse/DISPATCH-1568 - Commit history will be fixed. a lot of junk for now. - To run the demo, just: ``` [nbrignon@localhost build (nb-doctest)]$ cmake .. ... [nbrignon@localhost build (nb-doctest)]$ make c_unittest ... ``` - and then we can execute the binary directly: ``` [nbrignon@localhost build (nb-doctest)]$ ./tests/c_unittest [doctest] doctest version is "2.3.6" [doctest] run with "--help" for options =============================================================================== [doctest] test cases: 5 | 5 passed | 0 failed | 0 skipped [doctest] assertions: 15 | 15 passed | 0 failed | [doctest] Status: SUCCESS! ``` - or debug it: ``` [nbrignon@localhost build (nb-doctest)]$ gdb ./tests/c_unittest ... (gdb) b safe_snprintf Breakpoint 1 at 0x408330 (gdb) run ... Breakpoint 1, safe_snprintf (str=str@entry=0x7fffffffcd00 " \313\371\367\377\177", size=size@entry=19, format=format@entry=0x4228d2 "something") at /home/nbrignon/qpid-dispatch/src/router_core/terminus.c:89 89 size_t safe_snprintf(char *str, size_t size, const char *format, ...) { ``` - or execute it through ctest: ``` nbrignon@localhost build (nb-doctest)]$ ctest -VV -R c_unittest ... test 1 Start 1: c_unittest 1: Test command: /home/nbrignon/qpid-dispatch/build/tests/c_unittest 1: Test timeout computed to be: 600 1: [doctest] doctest version is "2.3.6" 1: [doctest] run with "--help" for options 1: =============================================================================== 1: [doctest] test cases: 5 | 5 passed | 0 failed | 0 skipped 1: [doctest] assertions: 15 | 15 passed | 0 failed | 1: [doctest] Status: SUCCESS! 1/1 Test #1: c_unittest ....................... Passed 0.01 sec The following tests passed: c_unittest 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 0.01 sec ```
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org