All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks
@ 2019-03-01 16:16 Thomas Huth
  2019-03-01 17:57 ` John Snow
  2019-03-06  9:12 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Huth @ 2019-03-01 16:16 UTC (permalink / raw)
  To: qemu-devel, Laurent Vivier
  Cc: qemu-trivial, Paolo Bonzini, Corey Minyard, John Snow

These checks at the beginning of some of the tests are mostly useless:
We only run the tests on x86 anyway, and g_test_message() does not
print anything unless you call g_test_init() first.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/fdc-test.c      | 7 -------
 tests/ide-test.c      | 7 -------
 tests/ipmi-bt-test.c  | 7 -------
 tests/ipmi-kcs-test.c | 7 -------
 4 files changed, 28 deletions(-)

diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 88f1abf..31cd329 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -548,16 +548,9 @@ static void fuzz_registers(void)
 
 int main(int argc, char **argv)
 {
-    const char *arch = qtest_get_arch();
     int fd;
     int ret;
 
-    /* Check architecture */
-    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
-        g_test_message("Skipping test for non-x86\n");
-        return 0;
-    }
-
     /* Create a temporary raw image */
     fd = mkstemp(test_image);
     g_assert(fd >= 0);
diff --git a/tests/ide-test.c b/tests/ide-test.c
index f0280e6..300d64e 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -1009,16 +1009,9 @@ static void test_cdrom_dma(void)
 
 int main(int argc, char **argv)
 {
-    const char *arch = qtest_get_arch();
     int fd;
     int ret;
 
-    /* Check architecture */
-    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
-        g_test_message("Skipping test for non-x86\n");
-        return 0;
-    }
-
     /* Create temporary blkdebug instructions */
     fd = mkstemp(debug_path);
     g_assert(fd >= 0);
diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
index f4a81b5..fc4c83b 100644
--- a/tests/ipmi-bt-test.c
+++ b/tests/ipmi-bt-test.c
@@ -400,15 +400,8 @@ static void open_socket(void)
 
 int main(int argc, char **argv)
 {
-    const char *arch = qtest_get_arch();
     int ret;
 
-    /* Check architecture */
-    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
-        g_test_message("Skipping test for non-x86\n");
-        return 0;
-    }
-
     open_socket();
 
     /* Run the tests */
diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
index 178ffc1..a2354c1 100644
--- a/tests/ipmi-kcs-test.c
+++ b/tests/ipmi-kcs-test.c
@@ -263,16 +263,9 @@ static void test_enable_irq(void)
 
 int main(int argc, char **argv)
 {
-    const char *arch = qtest_get_arch();
     char *cmdline;
     int ret;
 
-    /* Check architecture */
-    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
-        g_test_message("Skipping test for non-x86\n");
-        return 0;
-    }
-
     /* Run the tests */
     g_test_init(&argc, &argv, NULL);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks
  2019-03-01 16:16 [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks Thomas Huth
@ 2019-03-01 17:57 ` John Snow
  2019-03-01 18:39   ` Corey Minyard
  2019-03-03 14:15   ` Thomas Huth
  2019-03-06  9:12 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
  1 sibling, 2 replies; 6+ messages in thread
From: John Snow @ 2019-03-01 17:57 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Laurent Vivier
  Cc: qemu-trivial, Paolo Bonzini, Corey Minyard



On 3/1/19 11:16 AM, Thomas Huth wrote:
> These checks at the beginning of some of the tests are mostly useless:
> We only run the tests on x86 anyway, and g_test_message() does not
> print anything unless you call g_test_init() first.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/fdc-test.c      | 7 -------
>  tests/ide-test.c      | 7 -------
>  tests/ipmi-bt-test.c  | 7 -------
>  tests/ipmi-kcs-test.c | 7 -------
>  4 files changed, 28 deletions(-)
> 
> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
> index 88f1abf..31cd329 100644
> --- a/tests/fdc-test.c
> +++ b/tests/fdc-test.c
> @@ -548,16 +548,9 @@ static void fuzz_registers(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      int fd;
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      /* Create a temporary raw image */
>      fd = mkstemp(test_image);
>      g_assert(fd >= 0);
> diff --git a/tests/ide-test.c b/tests/ide-test.c
> index f0280e6..300d64e 100644
> --- a/tests/ide-test.c
> +++ b/tests/ide-test.c
> @@ -1009,16 +1009,9 @@ static void test_cdrom_dma(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      int fd;
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      /* Create temporary blkdebug instructions */
>      fd = mkstemp(debug_path);
>      g_assert(fd >= 0);
> diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
> index f4a81b5..fc4c83b 100644
> --- a/tests/ipmi-bt-test.c
> +++ b/tests/ipmi-bt-test.c
> @@ -400,15 +400,8 @@ static void open_socket(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      open_socket();
>  
>      /* Run the tests */
> diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
> index 178ffc1..a2354c1 100644
> --- a/tests/ipmi-kcs-test.c
> +++ b/tests/ipmi-kcs-test.c
> @@ -263,16 +263,9 @@ static void test_enable_irq(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      char *cmdline;
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      /* Run the tests */
>      g_test_init(&argc, &argv, NULL);
>  
> 

Hm, if you insist. I have no strong feelings... Do we plan to split
tests out by architecture eventually? Clearly x86 only tests don't
really need to each individually check the arch, but I'm not sure what
the vision is.

Either way, since I have no horse in the race:

Acked-by: John Snow <jsnow@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks
  2019-03-01 17:57 ` John Snow
@ 2019-03-01 18:39   ` Corey Minyard
  2019-03-03 14:15   ` Thomas Huth
  1 sibling, 0 replies; 6+ messages in thread
From: Corey Minyard @ 2019-03-01 18:39 UTC (permalink / raw)
  To: John Snow
  Cc: Thomas Huth, qemu-devel, Laurent Vivier, qemu-trivial, Paolo Bonzini

On Fri, Mar 01, 2019 at 12:57:19PM -0500, John Snow wrote:
> 
> 
> On 3/1/19 11:16 AM, Thomas Huth wrote:
> > These checks at the beginning of some of the tests are mostly useless:
> > We only run the tests on x86 anyway, and g_test_message() does not
> > print anything unless you call g_test_init() first.
> > 
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> >  tests/fdc-test.c      | 7 -------
> >  tests/ide-test.c      | 7 -------
> >  tests/ipmi-bt-test.c  | 7 -------
> >  tests/ipmi-kcs-test.c | 7 -------
> >  4 files changed, 28 deletions(-)
> > 
> > diff --git a/tests/fdc-test.c b/tests/fdc-test.c
> > index 88f1abf..31cd329 100644
> > --- a/tests/fdc-test.c
> > +++ b/tests/fdc-test.c
> > @@ -548,16 +548,9 @@ static void fuzz_registers(void)
> >  
> >  int main(int argc, char **argv)
> >  {
> > -    const char *arch = qtest_get_arch();
> >      int fd;
> >      int ret;
> >  
> > -    /* Check architecture */
> > -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> > -        g_test_message("Skipping test for non-x86\n");
> > -        return 0;
> > -    }
> > -
> >      /* Create a temporary raw image */
> >      fd = mkstemp(test_image);
> >      g_assert(fd >= 0);
> > diff --git a/tests/ide-test.c b/tests/ide-test.c
> > index f0280e6..300d64e 100644
> > --- a/tests/ide-test.c
> > +++ b/tests/ide-test.c
> > @@ -1009,16 +1009,9 @@ static void test_cdrom_dma(void)
> >  
> >  int main(int argc, char **argv)
> >  {
> > -    const char *arch = qtest_get_arch();
> >      int fd;
> >      int ret;
> >  
> > -    /* Check architecture */
> > -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> > -        g_test_message("Skipping test for non-x86\n");
> > -        return 0;
> > -    }
> > -
> >      /* Create temporary blkdebug instructions */
> >      fd = mkstemp(debug_path);
> >      g_assert(fd >= 0);
> > diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
> > index f4a81b5..fc4c83b 100644
> > --- a/tests/ipmi-bt-test.c
> > +++ b/tests/ipmi-bt-test.c
> > @@ -400,15 +400,8 @@ static void open_socket(void)
> >  
> >  int main(int argc, char **argv)
> >  {
> > -    const char *arch = qtest_get_arch();
> >      int ret;
> >  
> > -    /* Check architecture */
> > -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> > -        g_test_message("Skipping test for non-x86\n");
> > -        return 0;
> > -    }
> > -
> >      open_socket();
> >  
> >      /* Run the tests */
> > diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
> > index 178ffc1..a2354c1 100644
> > --- a/tests/ipmi-kcs-test.c
> > +++ b/tests/ipmi-kcs-test.c
> > @@ -263,16 +263,9 @@ static void test_enable_irq(void)
> >  
> >  int main(int argc, char **argv)
> >  {
> > -    const char *arch = qtest_get_arch();
> >      char *cmdline;
> >      int ret;
> >  
> > -    /* Check architecture */
> > -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> > -        g_test_message("Skipping test for non-x86\n");
> > -        return 0;
> > -    }
> > -
> >      /* Run the tests */
> >      g_test_init(&argc, &argv, NULL);
> >  
> > 
> 
> Hm, if you insist. I have no strong feelings... Do we plan to split
> tests out by architecture eventually? Clearly x86 only tests don't
> really need to each individually check the arch, but I'm not sure what
> the vision is.

Hmm, I don't have strong feelings, either, but I assume that you
would want to leave the door open for testing on arches besides
x86.  The IPMI device is used by at least powerpc, and probably
in some upcoming ARM64 systems.

But in that case you would want to remove these checks, anyway, and
find some other way to know if you want to run the test.  So...

Acked-by: Corey Minyard <cminyard@mvista.com>

> 
> Either way, since I have no horse in the race:
> 
> Acked-by: John Snow <jsnow@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks
  2019-03-01 17:57 ` John Snow
  2019-03-01 18:39   ` Corey Minyard
@ 2019-03-03 14:15   ` Thomas Huth
  2019-03-04 18:13     ` John Snow
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2019-03-03 14:15 UTC (permalink / raw)
  To: John Snow, qemu-devel, Laurent Vivier
  Cc: qemu-trivial, Paolo Bonzini, Corey Minyard

On 01/03/2019 18.57, John Snow wrote:
> 
> 
> On 3/1/19 11:16 AM, Thomas Huth wrote:
>> These checks at the beginning of some of the tests are mostly useless:
>> We only run the tests on x86 anyway, and g_test_message() does not
>> print anything unless you call g_test_init() first.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  tests/fdc-test.c      | 7 -------
>>  tests/ide-test.c      | 7 -------
>>  tests/ipmi-bt-test.c  | 7 -------
>>  tests/ipmi-kcs-test.c | 7 -------
>>  4 files changed, 28 deletions(-)
>>
>> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
>> index 88f1abf..31cd329 100644
>> --- a/tests/fdc-test.c
>> +++ b/tests/fdc-test.c
>> @@ -548,16 +548,9 @@ static void fuzz_registers(void)
>>  
>>  int main(int argc, char **argv)
>>  {
>> -    const char *arch = qtest_get_arch();
>>      int fd;
>>      int ret;
>>  
>> -    /* Check architecture */
>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>> -        g_test_message("Skipping test for non-x86\n");
>> -        return 0;
>> -    }
>> -
>>      /* Create a temporary raw image */
>>      fd = mkstemp(test_image);
>>      g_assert(fd >= 0);
>> diff --git a/tests/ide-test.c b/tests/ide-test.c
>> index f0280e6..300d64e 100644
>> --- a/tests/ide-test.c
>> +++ b/tests/ide-test.c
>> @@ -1009,16 +1009,9 @@ static void test_cdrom_dma(void)
>>  
>>  int main(int argc, char **argv)
>>  {
>> -    const char *arch = qtest_get_arch();
>>      int fd;
>>      int ret;
>>  
>> -    /* Check architecture */
>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>> -        g_test_message("Skipping test for non-x86\n");
>> -        return 0;
>> -    }
>> -
>>      /* Create temporary blkdebug instructions */
>>      fd = mkstemp(debug_path);
>>      g_assert(fd >= 0);
>> diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
>> index f4a81b5..fc4c83b 100644
>> --- a/tests/ipmi-bt-test.c
>> +++ b/tests/ipmi-bt-test.c
>> @@ -400,15 +400,8 @@ static void open_socket(void)
>>  
>>  int main(int argc, char **argv)
>>  {
>> -    const char *arch = qtest_get_arch();
>>      int ret;
>>  
>> -    /* Check architecture */
>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>> -        g_test_message("Skipping test for non-x86\n");
>> -        return 0;
>> -    }
>> -
>>      open_socket();
>>  
>>      /* Run the tests */
>> diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
>> index 178ffc1..a2354c1 100644
>> --- a/tests/ipmi-kcs-test.c
>> +++ b/tests/ipmi-kcs-test.c
>> @@ -263,16 +263,9 @@ static void test_enable_irq(void)
>>  
>>  int main(int argc, char **argv)
>>  {
>> -    const char *arch = qtest_get_arch();
>>      char *cmdline;
>>      int ret;
>>  
>> -    /* Check architecture */
>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>> -        g_test_message("Skipping test for non-x86\n");
>> -        return 0;
>> -    }
>> -
>>      /* Run the tests */
>>      g_test_init(&argc, &argv, NULL);
>>  
>>
> 
> Hm, if you insist. I have no strong feelings... Do we plan to split
> tests out by architecture eventually? Clearly x86 only tests don't
> really need to each individually check the arch, but I'm not sure what
> the vision is.

We could also fix the g_test_message() output by moving it after the
g_test_init() ... I don't mind too much which way we go, but at least
the current state is bad.

Looking at other tests, we seem to be pretty inconsistent in checking
the architecture at the beginning. For example q35-test.c,
pvpanic-test.c and test-x86-cpuid.c do not check for x86, while
rtas-test.c has a check for ppc64...

> Either way, since I have no horse in the race:
> 
> Acked-by: John Snow <jsnow@redhat.com>

Thanks!

 Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks
  2019-03-03 14:15   ` Thomas Huth
@ 2019-03-04 18:13     ` John Snow
  0 siblings, 0 replies; 6+ messages in thread
From: John Snow @ 2019-03-04 18:13 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Laurent Vivier
  Cc: qemu-trivial, Paolo Bonzini, Corey Minyard



On 3/3/19 9:15 AM, Thomas Huth wrote:
> On 01/03/2019 18.57, John Snow wrote:
>>
>>
>> On 3/1/19 11:16 AM, Thomas Huth wrote:
>>> These checks at the beginning of some of the tests are mostly useless:
>>> We only run the tests on x86 anyway, and g_test_message() does not
>>> print anything unless you call g_test_init() first.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>  tests/fdc-test.c      | 7 -------
>>>  tests/ide-test.c      | 7 -------
>>>  tests/ipmi-bt-test.c  | 7 -------
>>>  tests/ipmi-kcs-test.c | 7 -------
>>>  4 files changed, 28 deletions(-)
>>>
>>> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
>>> index 88f1abf..31cd329 100644
>>> --- a/tests/fdc-test.c
>>> +++ b/tests/fdc-test.c
>>> @@ -548,16 +548,9 @@ static void fuzz_registers(void)
>>>  
>>>  int main(int argc, char **argv)
>>>  {
>>> -    const char *arch = qtest_get_arch();
>>>      int fd;
>>>      int ret;
>>>  
>>> -    /* Check architecture */
>>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>>> -        g_test_message("Skipping test for non-x86\n");
>>> -        return 0;
>>> -    }
>>> -
>>>      /* Create a temporary raw image */
>>>      fd = mkstemp(test_image);
>>>      g_assert(fd >= 0);
>>> diff --git a/tests/ide-test.c b/tests/ide-test.c
>>> index f0280e6..300d64e 100644
>>> --- a/tests/ide-test.c
>>> +++ b/tests/ide-test.c
>>> @@ -1009,16 +1009,9 @@ static void test_cdrom_dma(void)
>>>  
>>>  int main(int argc, char **argv)
>>>  {
>>> -    const char *arch = qtest_get_arch();
>>>      int fd;
>>>      int ret;
>>>  
>>> -    /* Check architecture */
>>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>>> -        g_test_message("Skipping test for non-x86\n");
>>> -        return 0;
>>> -    }
>>> -
>>>      /* Create temporary blkdebug instructions */
>>>      fd = mkstemp(debug_path);
>>>      g_assert(fd >= 0);
>>> diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
>>> index f4a81b5..fc4c83b 100644
>>> --- a/tests/ipmi-bt-test.c
>>> +++ b/tests/ipmi-bt-test.c
>>> @@ -400,15 +400,8 @@ static void open_socket(void)
>>>  
>>>  int main(int argc, char **argv)
>>>  {
>>> -    const char *arch = qtest_get_arch();
>>>      int ret;
>>>  
>>> -    /* Check architecture */
>>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>>> -        g_test_message("Skipping test for non-x86\n");
>>> -        return 0;
>>> -    }
>>> -
>>>      open_socket();
>>>  
>>>      /* Run the tests */
>>> diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
>>> index 178ffc1..a2354c1 100644
>>> --- a/tests/ipmi-kcs-test.c
>>> +++ b/tests/ipmi-kcs-test.c
>>> @@ -263,16 +263,9 @@ static void test_enable_irq(void)
>>>  
>>>  int main(int argc, char **argv)
>>>  {
>>> -    const char *arch = qtest_get_arch();
>>>      char *cmdline;
>>>      int ret;
>>>  
>>> -    /* Check architecture */
>>> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
>>> -        g_test_message("Skipping test for non-x86\n");
>>> -        return 0;
>>> -    }
>>> -
>>>      /* Run the tests */
>>>      g_test_init(&argc, &argv, NULL);
>>>  
>>>
>>
>> Hm, if you insist. I have no strong feelings... Do we plan to split
>> tests out by architecture eventually? Clearly x86 only tests don't
>> really need to each individually check the arch, but I'm not sure what
>> the vision is.
> 
> We could also fix the g_test_message() output by moving it after the
> g_test_init() ... I don't mind too much which way we go, but at least
> the current state is bad.
> 
> Looking at other tests, we seem to be pretty inconsistent in checking
> the architecture at the beginning. For example q35-test.c,
> pvpanic-test.c and test-x86-cpuid.c do not check for x86, while
> rtas-test.c has a check for ppc64...
> 
>> Either way, since I have no horse in the race:
>>
>> Acked-by: John Snow <jsnow@redhat.com>
> 
> Thanks!
> 
>  Thomas
> 

In that case, might as well be consistent first and we can refactor our
test suite when we have a reason to want to do that.

Thanks for the explanation!

--js

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] tests: Remove (mostly) useless architecture checks
  2019-03-01 16:16 [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks Thomas Huth
  2019-03-01 17:57 ` John Snow
@ 2019-03-06  9:12 ` Laurent Vivier
  1 sibling, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2019-03-06  9:12 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Laurent Vivier
  Cc: qemu-trivial, Paolo Bonzini, John Snow, Corey Minyard

On 01/03/2019 17:16, Thomas Huth wrote:
> These checks at the beginning of some of the tests are mostly useless:
> We only run the tests on x86 anyway, and g_test_message() does not
> print anything unless you call g_test_init() first.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/fdc-test.c      | 7 -------
>  tests/ide-test.c      | 7 -------
>  tests/ipmi-bt-test.c  | 7 -------
>  tests/ipmi-kcs-test.c | 7 -------
>  4 files changed, 28 deletions(-)
> 
> diff --git a/tests/fdc-test.c b/tests/fdc-test.c
> index 88f1abf..31cd329 100644
> --- a/tests/fdc-test.c
> +++ b/tests/fdc-test.c
> @@ -548,16 +548,9 @@ static void fuzz_registers(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      int fd;
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      /* Create a temporary raw image */
>      fd = mkstemp(test_image);
>      g_assert(fd >= 0);
> diff --git a/tests/ide-test.c b/tests/ide-test.c
> index f0280e6..300d64e 100644
> --- a/tests/ide-test.c
> +++ b/tests/ide-test.c
> @@ -1009,16 +1009,9 @@ static void test_cdrom_dma(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      int fd;
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      /* Create temporary blkdebug instructions */
>      fd = mkstemp(debug_path);
>      g_assert(fd >= 0);
> diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
> index f4a81b5..fc4c83b 100644
> --- a/tests/ipmi-bt-test.c
> +++ b/tests/ipmi-bt-test.c
> @@ -400,15 +400,8 @@ static void open_socket(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      open_socket();
>  
>      /* Run the tests */
> diff --git a/tests/ipmi-kcs-test.c b/tests/ipmi-kcs-test.c
> index 178ffc1..a2354c1 100644
> --- a/tests/ipmi-kcs-test.c
> +++ b/tests/ipmi-kcs-test.c
> @@ -263,16 +263,9 @@ static void test_enable_irq(void)
>  
>  int main(int argc, char **argv)
>  {
> -    const char *arch = qtest_get_arch();
>      char *cmdline;
>      int ret;
>  
> -    /* Check architecture */
> -    if (strcmp(arch, "i386") && strcmp(arch, "x86_64")) {
> -        g_test_message("Skipping test for non-x86\n");
> -        return 0;
> -    }
> -
>      /* Run the tests */
>      g_test_init(&argc, &argv, NULL);
>  
> 

Applied to my trivial-patches branch.

Thanks,
Laurent

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-06  9:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 16:16 [Qemu-devel] [PATCH] tests: Remove (mostly) useless architecture checks Thomas Huth
2019-03-01 17:57 ` John Snow
2019-03-01 18:39   ` Corey Minyard
2019-03-03 14:15   ` Thomas Huth
2019-03-04 18:13     ` John Snow
2019-03-06  9:12 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.