* [Qemu-devel] [PATCH] tests: adjust gcov variables for directory movement
@ 2013-01-15 8:49 Paolo Bonzini
2013-01-17 20:43 ` Blue Swirl
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2013-01-15 8:49 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl
I had missed the introduction of the gcov-files-* variables.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Blue, can you look at introducing a common variable for the coroutine
backend? Like
coroutine-backend-y = gthread
coroutine-backend-$(CONFIG_SIGALTSTACK_COROUTINE) = sigaltstack
coroutine-backend-$(CONFIG_UCONTEXT_COROUTINE) = ucontext
coroutine-backend-$(CONFIG_WIN32) = win32
and using it in both Makefile.objs and tests/Makefile.
Another alternative is to use $(filter) to pick the one file that
is actually part of $(block-obj-y). Thanks!
tests/Makefile | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
index d97a571..90ad126 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,17 +1,17 @@
export SRC_PATH
check-unit-y = tests/check-qdict$(EXESUF)
-gcov-files-check-qdict-y = qdict.c
+gcov-files-check-qdict-y = qobject/qdict.c
check-unit-y += tests/check-qfloat$(EXESUF)
-gcov-files-check-qfloat-y = qfloat.c
+gcov-files-check-qfloat-y = qobject/qfloat.c
check-unit-y += tests/check-qint$(EXESUF)
-gcov-files-check-qint-y = qint.c
+gcov-files-check-qint-y = qobject/qint.c
check-unit-y += tests/check-qstring$(EXESUF)
-gcov-files-check-qstring-y = qstring.c
+gcov-files-check-qstring-y = qobject/qstring.c
check-unit-y += tests/check-qlist$(EXESUF)
-gcov-files-check-qlist-y = qlist.c
+gcov-files-check-qlist-y = qobject/qlist.c
check-unit-y += tests/check-qjson$(EXESUF)
-gcov-files-check-qjson-y = qjson.c
+gcov-files-check-qjson-y = qobject/qjson.c
check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
@@ -39,7 +39,7 @@ endif
endif
check-unit-y += tests/test-visitor-serialization$(EXESUF)
check-unit-y += tests/test-iov$(EXESUF)
-gcov-files-test-iov-y = iov.c
+gcov-files-test-iov-y = util/iov.c
check-unit-y += tests/test-aio$(EXESUF)
gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
--
1.8.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: adjust gcov variables for directory movement
2013-01-15 8:49 [Qemu-devel] [PATCH] tests: adjust gcov variables for directory movement Paolo Bonzini
@ 2013-01-17 20:43 ` Blue Swirl
2013-01-18 8:52 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2013-01-17 20:43 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Tue, Jan 15, 2013 at 8:49 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> I had missed the introduction of the gcov-files-* variables.
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Blue, can you look at introducing a common variable for the coroutine
> backend? Like
>
> coroutine-backend-y = gthread
> coroutine-backend-$(CONFIG_SIGALTSTACK_COROUTINE) = sigaltstack
> coroutine-backend-$(CONFIG_UCONTEXT_COROUTINE) = ucontext
> coroutine-backend-$(CONFIG_WIN32) = win32
>
> and using it in both Makefile.objs and tests/Makefile.
> Another alternative is to use $(filter) to pick the one file that
> is actually part of $(block-obj-y). Thanks!
OK. Related to this, perhaps it would be better to rearrange the test
directory so that in most cases there is 1:1 relation with a test and
the code that it tests, for example qobject/qdict.c would be tested by
tests/qobject/qdict.c. This would simplify the Makefile a lot.
Then we could also add a dummy test for each source file mechanically
to see how low the test coverage really is and to encourage writing
more of them.
>
> tests/Makefile | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/tests/Makefile b/tests/Makefile
> index d97a571..90ad126 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -1,17 +1,17 @@
> export SRC_PATH
>
> check-unit-y = tests/check-qdict$(EXESUF)
> -gcov-files-check-qdict-y = qdict.c
> +gcov-files-check-qdict-y = qobject/qdict.c
> check-unit-y += tests/check-qfloat$(EXESUF)
> -gcov-files-check-qfloat-y = qfloat.c
> +gcov-files-check-qfloat-y = qobject/qfloat.c
> check-unit-y += tests/check-qint$(EXESUF)
> -gcov-files-check-qint-y = qint.c
> +gcov-files-check-qint-y = qobject/qint.c
> check-unit-y += tests/check-qstring$(EXESUF)
> -gcov-files-check-qstring-y = qstring.c
> +gcov-files-check-qstring-y = qobject/qstring.c
> check-unit-y += tests/check-qlist$(EXESUF)
> -gcov-files-check-qlist-y = qlist.c
> +gcov-files-check-qlist-y = qobject/qlist.c
> check-unit-y += tests/check-qjson$(EXESUF)
> -gcov-files-check-qjson-y = qjson.c
> +gcov-files-check-qjson-y = qobject/qjson.c
> check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
> gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c
> check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
> @@ -39,7 +39,7 @@ endif
> endif
> check-unit-y += tests/test-visitor-serialization$(EXESUF)
> check-unit-y += tests/test-iov$(EXESUF)
> -gcov-files-test-iov-y = iov.c
> +gcov-files-test-iov-y = util/iov.c
> check-unit-y += tests/test-aio$(EXESUF)
> gcov-files-test-aio-$(CONFIG_WIN32) = aio-win32.c
> gcov-files-test-aio-$(CONFIG_POSIX) = aio-posix.c
> --
> 1.8.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: adjust gcov variables for directory movement
2013-01-17 20:43 ` Blue Swirl
@ 2013-01-18 8:52 ` Paolo Bonzini
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2013-01-18 8:52 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
Il 17/01/2013 21:43, Blue Swirl ha scritto:
>> > Blue, can you look at introducing a common variable for the coroutine
>> > backend? Like
>> >
>> > coroutine-backend-y = gthread
>> > coroutine-backend-$(CONFIG_SIGALTSTACK_COROUTINE) = sigaltstack
>> > coroutine-backend-$(CONFIG_UCONTEXT_COROUTINE) = ucontext
>> > coroutine-backend-$(CONFIG_WIN32) = win32
>> >
>> > and using it in both Makefile.objs and tests/Makefile.
>> > Another alternative is to use $(filter) to pick the one file that
>> > is actually part of $(block-obj-y). Thanks!
> OK. Related to this, perhaps it would be better to rearrange the test
> directory so that in most cases there is 1:1 relation with a test and
> the code that it tests, for example qobject/qdict.c would be tested by
> tests/qobject/qdict.c. This would simplify the Makefile a lot.
I'd prefer tests/qobject/check-qdict.c, but that's the idea yes.
> Then we could also add a dummy test for each source file mechanically
> to see how low the test coverage really is and to encourage writing
> more of them.
True, one of the points of introducing libqemuutil.a is to easily
identify code that can be unit tested and headers where gtk-doc comments
can be added.
Of course there can be other unit tests (e.g. main loop, coroutines,
QOM, etc.) but that's the low-hanging fruit.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-18 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 8:49 [Qemu-devel] [PATCH] tests: adjust gcov variables for directory movement Paolo Bonzini
2013-01-17 20:43 ` Blue Swirl
2013-01-18 8:52 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).