diff mbox series

[v6,02/29] tests: Sort .gitignore

Message ID 20170901180340.30009-3-eblake@redhat.com
State New
Headers show
Series Preliminary libqtest cleanups | expand

Commit Message

Eric Blake Sept. 1, 2017, 6:03 p.m. UTC
It doesn't matter if things are unsorted, but finding stuff in a list
is easier when it is sorted.  (Sorted under LC_ALL=C rules, rather than
en_US.UTF-8).

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/.gitignore | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

Comments

Thomas Huth Sept. 5, 2017, 7:20 a.m. UTC | #1
On 01.09.2017 20:03, Eric Blake wrote:
> It doesn't matter if things are unsorted, but finding stuff in a list
> is easier when it is sorted.  (Sorted under LC_ALL=C rules, rather than
> en_US.UTF-8).
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  tests/.gitignore | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>

BTW, did you note the patch "build-sys: generate tests/.gitignore" from
Marc-André ? Maybe the list can be generated automatically, too...

> diff --git a/tests/.gitignore b/tests/.gitignore
> index 64ecd6683b..8d35a58751 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -1,25 +1,27 @@
> +*-test

... but looking at this wildcard, I wonder if we just named most of our
tests in a bad way. If we name the files something-test instead of
test-something, we maybe do not need the automatic generation from
Marc-André (which is kind of ugly because it writes to the source
directory - and this should not happen when doing out of tree builds).

So what do you think about renaming our tests, so that the above
wildcard applies instead?

 Thomas

>  atomic_add-bench
>  benchmark-crypto-cipher
>  benchmark-crypto-hash
>  benchmark-crypto-hmac
>  check-qdict
> -check-qnum
>  check-qjson
>  check-qlist
>  check-qnull
> -check-qstring
> +check-qnum
>  check-qom-interface
>  check-qom-proplist
> -multiboot/test.out
> +check-qstring
>  multiboot/*.elf
> +multiboot/test.out
> +qapi-schema/*.test.*
>  qht-bench
>  rcutorture
>  test-aio
>  test-aio-multithread
>  test-arm-mptimer
>  test-base64
> -test-bitops
>  test-bitcnt
> +test-bitops
>  test-blockjob
>  test-blockjob-txn
>  test-bufferiszero
> @@ -35,18 +37,19 @@ test-crypto-ivgen
>  test-crypto-pbkdf
>  test-crypto-secret
>  test-crypto-tlscredsx509
> -test-crypto-tlscredsx509-work/
>  test-crypto-tlscredsx509-certs/
> +test-crypto-tlscredsx509-work/
>  test-crypto-tlssession
> -test-crypto-tlssession-work/
>  test-crypto-tlssession-client/
>  test-crypto-tlssession-server/
> +test-crypto-tlssession-work/
>  test-crypto-xts
>  test-cutils
> +test-filter-mirror
> +test-filter-redirector
>  test-hbitmap
>  test-hmp
>  test-int128
> -test-iov
>  test-io-channel-buffer
>  test-io-channel-command
>  test-io-channel-command.fifo
> @@ -55,27 +58,29 @@ test-io-channel-file.txt
>  test-io-channel-socket
>  test-io-channel-tls
>  test-io-task
> +test-iov
>  test-keyval
>  test-logging
>  test-mul64
> +test-netfilter
>  test-opts-visitor
>  test-qapi-event.[ch]
>  test-qapi-types.[ch]
>  test-qapi-util
>  test-qapi-visit.[ch]
>  test-qdev-global-props
> -test-qemu-opts
>  test-qdist
> +test-qemu-opts
>  test-qga
>  test-qht
>  test-qht-par
>  test-qmp-commands
>  test-qmp-commands.h
>  test-qmp-event
> -test-qobject-input-strict
> -test-qobject-input-visitor
>  test-qmp-introspect.[ch]
>  test-qmp-marshal.c
> +test-qobject-input-strict
> +test-qobject-input-visitor
>  test-qobject-output-visitor
>  test-rcu-list
>  test-replication
> @@ -92,8 +97,3 @@ test-write-threshold
>  test-x86-cpuid
>  test-x86-cpuid-compat
>  test-xbzrle
> -test-netfilter
> -test-filter-mirror
> -test-filter-redirector
> -*-test
> -qapi-schema/*.test.*
>
Markus Armbruster Sept. 5, 2017, 9:53 a.m. UTC | #2
Thomas Huth <thuth@redhat.com> writes:

> On 01.09.2017 20:03, Eric Blake wrote:
>> It doesn't matter if things are unsorted, but finding stuff in a list
>> is easier when it is sorted.  (Sorted under LC_ALL=C rules, rather than
>> en_US.UTF-8).
>> 
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>  tests/.gitignore | 30 +++++++++++++++---------------
>>  1 file changed, 15 insertions(+), 15 deletions(-)
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
> BTW, did you note the patch "build-sys: generate tests/.gitignore" from
> Marc-André ? Maybe the list can be generated automatically, too...
>
>> diff --git a/tests/.gitignore b/tests/.gitignore
>> index 64ecd6683b..8d35a58751 100644
>> --- a/tests/.gitignore
>> +++ b/tests/.gitignore
>> @@ -1,25 +1,27 @@
>> +*-test
>
> ... but looking at this wildcard, I wonder if we just named most of our
> tests in a bad way. If we name the files something-test instead of
> test-something, we maybe do not need the automatic generation from
> Marc-André (which is kind of ugly because it writes to the source
> directory - and this should not happen when doing out of tree builds).
>
> So what do you think about renaming our tests, so that the above
> wildcard applies instead?

Apropos naming tests: there's an (unspoken) convention to name unit
tests check-FOO or test-FOO and tests using libqtest FOO-test, but it's
not really honored anymore, probably because people creating tests
didn't know about it.
Thomas Huth Sept. 5, 2017, 9:58 a.m. UTC | #3
On 05.09.2017 11:53, Markus Armbruster wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
>> On 01.09.2017 20:03, Eric Blake wrote:
>>> It doesn't matter if things are unsorted, but finding stuff in a list
>>> is easier when it is sorted.  (Sorted under LC_ALL=C rules, rather than
>>> en_US.UTF-8).
>>>
>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>> ---
>>>  tests/.gitignore | 30 +++++++++++++++---------------
>>>  1 file changed, 15 insertions(+), 15 deletions(-)
>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>
>> BTW, did you note the patch "build-sys: generate tests/.gitignore" from
>> Marc-André ? Maybe the list can be generated automatically, too...
>>
>>> diff --git a/tests/.gitignore b/tests/.gitignore
>>> index 64ecd6683b..8d35a58751 100644
>>> --- a/tests/.gitignore
>>> +++ b/tests/.gitignore
>>> @@ -1,25 +1,27 @@
>>> +*-test
>>
>> ... but looking at this wildcard, I wonder if we just named most of our
>> tests in a bad way. If we name the files something-test instead of
>> test-something, we maybe do not need the automatic generation from
>> Marc-André (which is kind of ugly because it writes to the source
>> directory - and this should not happen when doing out of tree builds).
>>
>> So what do you think about renaming our tests, so that the above
>> wildcard applies instead?
> 
> Apropos naming tests: there's an (unspoken) convention to name unit
> tests check-FOO or test-FOO and tests using libqtest FOO-test, but it's
> not really honored anymore, probably because people creating tests
> didn't know about it.

Maybe it would help to have an entry for libqtest in MAINTAINERS with a
wildcard for tests/*-test.c ? Then we would have at least some kind of
documentation for this... (BTW: Any volunteers here for such a
maintainer job? ;-))

 Thomas
Daniel P. Berrangé Sept. 5, 2017, 10:10 a.m. UTC | #4
On Tue, Sep 05, 2017 at 11:53:22AM +0200, Markus Armbruster wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
> > On 01.09.2017 20:03, Eric Blake wrote:
> >> It doesn't matter if things are unsorted, but finding stuff in a list
> >> is easier when it is sorted.  (Sorted under LC_ALL=C rules, rather than
> >> en_US.UTF-8).
> >> 
> >> Signed-off-by: Eric Blake <eblake@redhat.com>
> >> ---
> >>  tests/.gitignore | 30 +++++++++++++++---------------
> >>  1 file changed, 15 insertions(+), 15 deletions(-)
> >
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> >
> > BTW, did you note the patch "build-sys: generate tests/.gitignore" from
> > Marc-André ? Maybe the list can be generated automatically, too...
> >
> >> diff --git a/tests/.gitignore b/tests/.gitignore
> >> index 64ecd6683b..8d35a58751 100644
> >> --- a/tests/.gitignore
> >> +++ b/tests/.gitignore
> >> @@ -1,25 +1,27 @@
> >> +*-test
> >
> > ... but looking at this wildcard, I wonder if we just named most of our
> > tests in a bad way. If we name the files something-test instead of
> > test-something, we maybe do not need the automatic generation from
> > Marc-André (which is kind of ugly because it writes to the source
> > directory - and this should not happen when doing out of tree builds).
> >
> > So what do you think about renaming our tests, so that the above
> > wildcard applies instead?
> 
> Apropos naming tests: there's an (unspoken) convention to name unit
> tests check-FOO or test-FOO and tests using libqtest FOO-test, but it's
> not really honored anymore, probably because people creating tests
> didn't know about it.

$ ls *test.c | wc -l
67
$ ls test*.c | wc -l
73
$ ls check*.c | wc -l
8

Fairly even split between 'test' as a prefix vs suffix. 'check' as a
prefix should clearly be killed as a minority pattern. Any appetite
for standardizing naming of everything else ?

A further idea might be to actually have separate sub-directories for
unit tests vs qtests. eg go for

  tests
    +- unit
    +- qtest
    +- iotests

Regards,
Daniel
Thomas Huth Sept. 5, 2017, 10:44 a.m. UTC | #5
On 05.09.2017 12:10, Daniel P. Berrange wrote:
> On Tue, Sep 05, 2017 at 11:53:22AM +0200, Markus Armbruster wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>>
>>> On 01.09.2017 20:03, Eric Blake wrote:
>>>> It doesn't matter if things are unsorted, but finding stuff in a list
>>>> is easier when it is sorted.  (Sorted under LC_ALL=C rules, rather than
>>>> en_US.UTF-8).
>>>>
>>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>>> ---
>>>>  tests/.gitignore | 30 +++++++++++++++---------------
>>>>  1 file changed, 15 insertions(+), 15 deletions(-)
>>>
>>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>>
>>> BTW, did you note the patch "build-sys: generate tests/.gitignore" from
>>> Marc-André ? Maybe the list can be generated automatically, too...
>>>
>>>> diff --git a/tests/.gitignore b/tests/.gitignore
>>>> index 64ecd6683b..8d35a58751 100644
>>>> --- a/tests/.gitignore
>>>> +++ b/tests/.gitignore
>>>> @@ -1,25 +1,27 @@
>>>> +*-test
>>>
>>> ... but looking at this wildcard, I wonder if we just named most of our
>>> tests in a bad way. If we name the files something-test instead of
>>> test-something, we maybe do not need the automatic generation from
>>> Marc-André (which is kind of ugly because it writes to the source
>>> directory - and this should not happen when doing out of tree builds).
>>>
>>> So what do you think about renaming our tests, so that the above
>>> wildcard applies instead?
>>
>> Apropos naming tests: there's an (unspoken) convention to name unit
>> tests check-FOO or test-FOO and tests using libqtest FOO-test, but it's
>> not really honored anymore, probably because people creating tests
>> didn't know about it.
> 
> $ ls *test.c | wc -l
> 67
> $ ls test*.c | wc -l
> 73
> $ ls check*.c | wc -l
> 8
> 
> Fairly even split between 'test' as a prefix vs suffix. 'check' as a
> prefix should clearly be killed as a minority pattern. Any appetite
> for standardizing naming of everything else ?
> 
> A further idea might be to actually have separate sub-directories for
> unit tests vs qtests. eg go for
> 
>   tests
>     +- unit
>     +- qtest
>     +- iotests

That sounds like a good idea to me, too.

 Thomas
Eric Blake Sept. 5, 2017, 2:22 p.m. UTC | #6
On 09/05/2017 05:10 AM, Daniel P. Berrange wrote:

> Fairly even split between 'test' as a prefix vs suffix. 'check' as a
> prefix should clearly be killed as a minority pattern. Any appetite
> for standardizing naming of everything else ?
> 
> A further idea might be to actually have separate sub-directories for
> unit tests vs qtests. eg go for
> 
>   tests
>     +- unit
>     +- qtest
>     +- iotests

I like the idea, but don't know if I want to be the one tackling it...
diff mbox series

Patch

diff --git a/tests/.gitignore b/tests/.gitignore
index 64ecd6683b..8d35a58751 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,25 +1,27 @@ 
+*-test
 atomic_add-bench
 benchmark-crypto-cipher
 benchmark-crypto-hash
 benchmark-crypto-hmac
 check-qdict
-check-qnum
 check-qjson
 check-qlist
 check-qnull
-check-qstring
+check-qnum
 check-qom-interface
 check-qom-proplist
-multiboot/test.out
+check-qstring
 multiboot/*.elf
+multiboot/test.out
+qapi-schema/*.test.*
 qht-bench
 rcutorture
 test-aio
 test-aio-multithread
 test-arm-mptimer
 test-base64
-test-bitops
 test-bitcnt
+test-bitops
 test-blockjob
 test-blockjob-txn
 test-bufferiszero
@@ -35,18 +37,19 @@  test-crypto-ivgen
 test-crypto-pbkdf
 test-crypto-secret
 test-crypto-tlscredsx509
-test-crypto-tlscredsx509-work/
 test-crypto-tlscredsx509-certs/
+test-crypto-tlscredsx509-work/
 test-crypto-tlssession
-test-crypto-tlssession-work/
 test-crypto-tlssession-client/
 test-crypto-tlssession-server/
+test-crypto-tlssession-work/
 test-crypto-xts
 test-cutils
+test-filter-mirror
+test-filter-redirector
 test-hbitmap
 test-hmp
 test-int128
-test-iov
 test-io-channel-buffer
 test-io-channel-command
 test-io-channel-command.fifo
@@ -55,27 +58,29 @@  test-io-channel-file.txt
 test-io-channel-socket
 test-io-channel-tls
 test-io-task
+test-iov
 test-keyval
 test-logging
 test-mul64
+test-netfilter
 test-opts-visitor
 test-qapi-event.[ch]
 test-qapi-types.[ch]
 test-qapi-util
 test-qapi-visit.[ch]
 test-qdev-global-props
-test-qemu-opts
 test-qdist
+test-qemu-opts
 test-qga
 test-qht
 test-qht-par
 test-qmp-commands
 test-qmp-commands.h
 test-qmp-event
-test-qobject-input-strict
-test-qobject-input-visitor
 test-qmp-introspect.[ch]
 test-qmp-marshal.c
+test-qobject-input-strict
+test-qobject-input-visitor
 test-qobject-output-visitor
 test-rcu-list
 test-replication
@@ -92,8 +97,3 @@  test-write-threshold
 test-x86-cpuid
 test-x86-cpuid-compat
 test-xbzrle
-test-netfilter
-test-filter-mirror
-test-filter-redirector
-*-test
-qapi-schema/*.test.*