On Wed, Dec 03, 2014 at 09:28:28PM +0100, Lukas Slebodnik wrote:
On (03/12/14 20:00), Jakub Hrozek wrote:
>On Wed, Dec 03, 2014 at 06:37:35PM +0100, Lukas Slebodnik wrote:
>> On (03/12/14 18:12), Jakub Hrozek wrote:
>> >test_child was declared to be build always but only actually built when
>> >cmocka was available, which is not the case on all platforms.
>> >
>> >We can either 1) move the test_child outside the HAVE_CMOCKA or 2) only
>> >append test_child to check_PROGRAMS when cmocka is available which is what
>> >the attached patch does.
>> >
>> >I'm fine with either option. Thanks for opinions/review.
>>
>> >From 67db9748960fbaf6deac4c01084bc23bc1321723 Mon Sep 17 00:00:00 2001
>> >From: Jakub Hrozek <jhrozek(a)redhat.com>
>> >Date: Wed, 3 Dec 2014 17:00:25 +0100
>> >Subject: [PATCH] TESTS: Build test_child even without cmocka
>> >
>> >---
>> > Makefile.am | 5 ++++-
>> > 1 file changed, 4 insertions(+), 1 deletion(-)
>> >
>> >diff --git a/Makefile.am b/Makefile.am
>> >index
7a36543061789bbd370fcbb118b66edeb8025e89..6d754f062245cc073c945218f6755dab1c59c543 100644
>> >--- a/Makefile.am
>> >+++ b/Makefile.am
>> >@@ -236,10 +236,13 @@ endif # HAVE_CMOCKA
>> > check_PROGRAMS = \
>> > stress-tests \
>> > krb5-child-test \
>> >- test-child \
>>
>> test-child is simple program without external dependencies.
>> It does not depend on libcmocka therefore should not be in block HAVE_CMOCKA.
>
>But currently it's only built to supplement a cmocka program, so
>building it would be useless.
>
I am not strictly against this micro optimisation.
>>
>> On the other hand, I am not strictly against. If you decide to do such change
>> then please also change the name of this binary. This binary isn't test.
>> It is executable file which is used by another test.
>
>it's a child program used by the test_child_common.c unit and actually
>depends on it via environment variables. Can you suggest a better name?
>I generally suck at naming things and tbh don't consider the name too
>important to spend much time on.
The name was confusing for me. I wanted to execute child test to fix a valgrind
issue. And my 1st attempt was wong.
sh$ ./test-child
(Wed Dec 3 21:18:14:367425 2014) [sssd] [main] (0x0400): test_child completed
successfully
the 2nd attept works.
sh$ ./test_child_common
[==========] Running 2 test(s).
[ RUN ] test_exec_child
[ OK ] test_exec_child
[ RUN ] test_exec_child_extra_args
[ OK ] test_exec_child_extra_args
[==========] 2 test(s) run.
[ PASSED ] 2 test(s).
0 FAILED TEST(S)
We have {ldap,krb5,selinux}-child.
IMHO the better name would be simple-child or dummy-child (maybe example-child)
Well, I tried to also couple the tests via name...but as I said, I'm not
the best when it comes to naming anything (I hope my wife will be the
one who names our kids ;-))
See additional patch that renames the patch to dummy-child. Too bad we
haven't named the test 'properly' before pushing it, but..oh well.
BTW confusion can be caused by the fact that we are not uniform with name
of tests.
Some tests have suffix "-tests" sydb-tests, dyndns-tests ...
and others have prefix "test[-_]": test-find-uid, test-authtok,
test_sss_idmap,
test_search_bases ...
We can agree on a naming scheme for new tests (I've been using
test-$module myself) but please don't spend any time on renaming old
tests. That's just busywork.