Re: [PATCH 0/6] Add a unit-testing framework to Busybox
On Thu, Jun 26, 2014 at 3:14 PM, Bartosz Gołaszewski bartekg...@gmail.com wrote: 2014-06-26 14:12 GMT+02:00 Rich Felker dal...@libc.org: On Thu, Jun 26, 2014 at 12:35:53PM +0200, Denys Vlasenko wrote: Global data is initialized to zero at program load time. And even if you need a non-zero initial value, static initialization is usually suitable; there's no need for code for this kind of thing. Rich I wasn't sure of that, thanks. If we only use the INIT_LAST macro, I propose to rename it to INIT_FUNC and not use the priority argument for constructor attribute. Please see the patch in attachment. Applied. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 0/6] Add a unit-testing framework to Busybox
2014-06-22 16:31 GMT+02:00 Denys Vlasenko vda.li...@googlemail.com: Applied all patches with some editing. Thanks a lot! Hi Denys, I see, that you removed the INIT_FIRST macro from my implementation. Are you sure llist_t *tests will always be initialized before calling the test registering functions? Bartosz Gołaszewski ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 0/6] Add a unit-testing framework to Busybox
On Thu, Jun 26, 2014 at 12:00 PM, Bartosz Gołaszewski bartekg...@gmail.com wrote: 2014-06-22 16:31 GMT+02:00 Denys Vlasenko vda.li...@googlemail.com: Applied all patches with some editing. Thanks a lot! Hi Denys, I see, that you removed the INIT_FIRST macro from my implementation. Are you sure llist_t *tests will always be initialized before calling the test registering functions? Global data is initialized to zero at program load time. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 0/6] Add a unit-testing framework to Busybox
On Thu, Jun 26, 2014 at 12:35:53PM +0200, Denys Vlasenko wrote: On Thu, Jun 26, 2014 at 12:00 PM, Bartosz Gołaszewski bartekg...@gmail.com wrote: 2014-06-22 16:31 GMT+02:00 Denys Vlasenko vda.li...@googlemail.com: Applied all patches with some editing. Thanks a lot! Hi Denys, I see, that you removed the INIT_FIRST macro from my implementation. Are you sure llist_t *tests will always be initialized before calling the test registering functions? Global data is initialized to zero at program load time. And even if you need a non-zero initial value, static initialization is usually suitable; there's no need for code for this kind of thing. Rich ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 0/6] Add a unit-testing framework to Busybox
2014-06-26 14:12 GMT+02:00 Rich Felker dal...@libc.org: On Thu, Jun 26, 2014 at 12:35:53PM +0200, Denys Vlasenko wrote: Global data is initialized to zero at program load time. And even if you need a non-zero initial value, static initialization is usually suitable; there's no need for code for this kind of thing. Rich I wasn't sure of that, thanks. If we only use the INIT_LAST macro, I propose to rename it to INIT_FUNC and not use the priority argument for constructor attribute. Please see the patch in attachment. Bartosz Gołaszewski 0001-Rename-INIT_LAST-to-INIT_FUNC-to-avoid-confusion.patch Description: Binary data ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 0/6] Add a unit-testing framework to Busybox
2014-04-16 1:06 GMT+02:00 Bartosz Golaszewski bartekg...@gmail.com: This set of patches proposes to add a simple unit-testing framework to Busybox. First four patches implement the actual framework and document it, while last two add some example test cases. Bartosz Golaszewski (6): unit-tests: add some helper macros for unit-test framework implementation unit-tests: implement the unit-testing framework unit-tests: add basic documentation on writing the unit test cases unit-tests: modify the Makefile 'test' target to run unit-tests too unit-tests: add two example test cases unit-tests: modify the existing strrstr test code to use the unit-test framework Hi Denys, Could you please comment on these patches? Can they be merged with busybox? -- Best regards, Bartosz Golaszewski ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: [PATCH 0/6] Add a unit-testing framework to Busybox
2014-04-16 1:06 GMT+02:00 Bartosz Golaszewski bartekg...@gmail.com: This set of patches proposes to add a simple unit-testing framework to Busybox. First four patches implement the actual framework and document it, while last two add some example test cases. Bartosz Golaszewski (6): unit-tests: add some helper macros for unit-test framework implementation unit-tests: implement the unit-testing framework unit-tests: add basic documentation on writing the unit test cases unit-tests: modify the Makefile 'test' target to run unit-tests too unit-tests: add two example test cases unit-tests: modify the existing strrstr test code to use the unit-test framework Any comments/reviews? Best regards, Bartosz Gołaszewski ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
[PATCH 0/6] Add a unit-testing framework to Busybox
This set of patches proposes to add a simple unit-testing framework to Busybox. First four patches implement the actual framework and document it, while last two add some example test cases. Bartosz Golaszewski (6): unit-tests: add some helper macros for unit-test framework implementation unit-tests: implement the unit-testing framework unit-tests: add basic documentation on writing the unit test cases unit-tests: modify the Makefile 'test' target to run unit-tests too unit-tests: add two example test cases unit-tests: modify the existing strrstr test code to use the unit-test framework Config.in | 8 +++ Makefile.custom | 4 ++ docs/unit-tests.txt | 52 ++ include/bbunit.h| 153 +++ include/platform.h | 3 + libbb/bbunit.c | 154 libbb/obscure.c | 40 ++ libbb/strrstr.c | 21 +++ 8 files changed, 423 insertions(+), 12 deletions(-) create mode 100644 docs/unit-tests.txt create mode 100644 include/bbunit.h create mode 100644 libbb/bbunit.c -- 1.8.4.5 ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox