[PATCH] tests: fix modules-test 'duplicate test case' error

Cole Robinson posted 1 patch 4 years, 5 months ago
Test asan passed
Test checkpatch passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/d64c9aa098cc6e5c0b638438c4959eddfa7e24e2.1573679311.git.crobinso@redhat.com
Maintainers: Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>
tests/modules-test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] tests: fix modules-test 'duplicate test case' error
Posted by Cole Robinson 4 years, 5 months ago
./configure --enable-sdl --audio-drv-list=sdl --enable-modules

Will generate two identical test names: /$arch/module/load/sdl
Which generates an error like:

(tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl

Add the subsystem prefix in the name as well, so instead we get:

/$arch/module/load/audio-sdl
/$arch/module/load/ui-sdl

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 tests/modules-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/modules-test.c b/tests/modules-test.c
index d1a6ace218..88217686e1 100644
--- a/tests/modules-test.c
+++ b/tests/modules-test.c
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
     g_test_init(&argc, &argv, NULL);
 
     for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
-        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
+        char *testname = g_strdup_printf("/module/load/%s%s",
+                                         modules[i], modules[i + 1]);
         qtest_add_data_func(testname, modules + i, test_modules_load);
         g_free(testname);
     }
-- 
2.23.0


Re: [PATCH] tests: fix modules-test 'duplicate test case' error
Posted by Marc-André Lureau 4 years, 5 months ago
On Thu, Nov 14, 2019 at 1:09 AM Cole Robinson <crobinso@redhat.com> wrote:
>
> ./configure --enable-sdl --audio-drv-list=sdl --enable-modules
>
> Will generate two identical test names: /$arch/module/load/sdl
> Which generates an error like:
>
> (tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl
>
> Add the subsystem prefix in the name as well, so instead we get:
>
> /$arch/module/load/audio-sdl
> /$arch/module/load/ui-sdl
>
> Signed-off-by: Cole Robinson <crobinso@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  tests/modules-test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index d1a6ace218..88217686e1 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -64,7 +64,8 @@ int main(int argc, char *argv[])
>      g_test_init(&argc, &argv, NULL);
>
>      for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
> -        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
> +        char *testname = g_strdup_printf("/module/load/%s%s",
> +                                         modules[i], modules[i + 1]);
>          qtest_add_data_func(testname, modules + i, test_modules_load);
>          g_free(testname);
>      }
> --
> 2.23.0
>


Re: [PATCH] tests: fix modules-test 'duplicate test case' error
Posted by Philippe Mathieu-Daudé 4 years, 5 months ago
On 11/13/19 10:09 PM, Cole Robinson wrote:
> ./configure --enable-sdl --audio-drv-list=sdl --enable-modules
> 
> Will generate two identical test names: /$arch/module/load/sdl
> Which generates an error like:
> 
> (tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl
> 
> Add the subsystem prefix in the name as well, so instead we get:
> 
> /$arch/module/load/audio-sdl
> /$arch/module/load/ui-sdl
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>   tests/modules-test.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index d1a6ace218..88217686e1 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -64,7 +64,8 @@ int main(int argc, char *argv[])
>       g_test_init(&argc, &argv, NULL);
>   
>       for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
> -        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
> +        char *testname = g_strdup_printf("/module/load/%s%s",
> +                                         modules[i], modules[i + 1]);
>           qtest_add_data_func(testname, modules + i, test_modules_load);
>           g_free(testname);
>       }
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


Re: [PATCH] tests: fix modules-test 'duplicate test case' error
Posted by Thomas Huth 4 years, 5 months ago
On 13/11/2019 22.09, Cole Robinson wrote:
> ./configure --enable-sdl --audio-drv-list=sdl --enable-modules
> 
> Will generate two identical test names: /$arch/module/load/sdl
> Which generates an error like:
> 
> (tests/modules-test:23814): GLib-ERROR **: 18:23:06.359: duplicate test case path: /aarch64//module/load/sdl
> 
> Add the subsystem prefix in the name as well, so instead we get:
> 
> /$arch/module/load/audio-sdl
> /$arch/module/load/ui-sdl
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  tests/modules-test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/modules-test.c b/tests/modules-test.c
> index d1a6ace218..88217686e1 100644
> --- a/tests/modules-test.c
> +++ b/tests/modules-test.c
> @@ -64,7 +64,8 @@ int main(int argc, char *argv[])
>      g_test_init(&argc, &argv, NULL);
>  
>      for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
> -        char *testname = g_strdup_printf("/module/load/%s", modules[i + 1]);
> +        char *testname = g_strdup_printf("/module/load/%s%s",
> +                                         modules[i], modules[i + 1]);
>          qtest_add_data_func(testname, modules + i, test_modules_load);
>          g_free(testname);
>      }
> 

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