[PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32

Bin Meng posted 51 patches 3 years, 5 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Greg Kurz <groug@kaod.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Cédric Le Goater" <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Gerd Hoffmann <kraxel@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Havard Skinnemoen <hskinnemoen@google.com>, Tyrone Ting <kfting@nuvoton.com>, Markus Armbruster <armbru@redhat.com>, Coiby Xu <Coiby.Xu@gmail.com>, Jason Wang <jasowang@redhat.com>, Fam Zheng <fam@euphon.net>
There is a newer version of this series
[PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32
Posted by Bin Meng 3 years, 5 months ago
From: Bin Meng <bin.meng@windriver.com>

The test cases 'test_{tx,rx}' call socketpair() which does not exist
on win32. Exclude them.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 tests/qtest/npcm7xx_emc-test.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c
index a353fef0ca..c373d24e1e 100644
--- a/tests/qtest/npcm7xx_emc-test.c
+++ b/tests/qtest/npcm7xx_emc-test.c
@@ -209,6 +209,7 @@ static int emc_module_index(const EMCModule *mod)
     return diff;
 }
 
+#ifndef _WIN32
 static void packet_test_clear(void *sockets)
 {
     int *test_sockets = sockets;
@@ -243,6 +244,7 @@ static int *packet_test_init(int module_num, GString *cmd_line)
     g_test_queue_destroy(packet_test_clear, test_sockets);
     return test_sockets;
 }
+#endif /* _WIN32 */
 
 static uint32_t emc_read(QTestState *qts, const EMCModule *mod,
                          NPCM7xxPWMRegister regno)
@@ -250,6 +252,7 @@ static uint32_t emc_read(QTestState *qts, const EMCModule *mod,
     return qtest_readl(qts, mod->base_addr + regno * sizeof(uint32_t));
 }
 
+#ifndef _WIN32
 static void emc_write(QTestState *qts, const EMCModule *mod,
                       NPCM7xxPWMRegister regno, uint32_t value)
 {
@@ -339,6 +342,7 @@ static bool emc_soft_reset(QTestState *qts, const EMCModule *mod)
     g_message("%s: Timeout expired", __func__);
     return false;
 }
+#endif /* _WIN32 */
 
 /* Check emc registers are reset to default value. */
 static void test_init(gconstpointer test_data)
@@ -387,6 +391,7 @@ static void test_init(gconstpointer test_data)
     qtest_quit(qts);
 }
 
+#ifndef _WIN32
 static bool emc_wait_irq(QTestState *qts, const EMCModule *mod, int step,
                          bool is_tx)
 {
@@ -843,6 +848,7 @@ static void test_rx(gconstpointer test_data)
 
     qtest_quit(qts);
 }
+#endif /* _WIN32 */
 
 static void emc_add_test(const char *name, const TestData* td,
                          GTestDataFunc fn)
@@ -865,8 +871,10 @@ int main(int argc, char **argv)
         td->module = &emc_module_list[i];
 
         add_test(init, td);
+#ifndef _WIN32
         add_test(tx, td);
         add_test(rx, td);
+#endif
     }
 
     return g_test_run();
-- 
2.34.1
Re: [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32
Posted by Hao Wu 3 years, 5 months ago
On Wed, Aug 24, 2022 at 3:35 AM Bin Meng <bmeng.cn@gmail.com> wrote:

> From: Bin Meng <bin.meng@windriver.com>
>
> The test cases 'test_{tx,rx}' call socketpair() which does not exist
> on win32. Exclude them.
>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
>
Reviewed-by: Hao Wu <wuhaotsh@google.com>

> ---
>
>  tests/qtest/npcm7xx_emc-test.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/tests/qtest/npcm7xx_emc-test.c
> b/tests/qtest/npcm7xx_emc-test.c
> index a353fef0ca..c373d24e1e 100644
> --- a/tests/qtest/npcm7xx_emc-test.c
> +++ b/tests/qtest/npcm7xx_emc-test.c
> @@ -209,6 +209,7 @@ static int emc_module_index(const EMCModule *mod)
>      return diff;
>  }
>
> +#ifndef _WIN32
>  static void packet_test_clear(void *sockets)
>  {
>      int *test_sockets = sockets;
> @@ -243,6 +244,7 @@ static int *packet_test_init(int module_num, GString
> *cmd_line)
>      g_test_queue_destroy(packet_test_clear, test_sockets);
>      return test_sockets;
>  }
> +#endif /* _WIN32 */
>
>  static uint32_t emc_read(QTestState *qts, const EMCModule *mod,
>                           NPCM7xxPWMRegister regno)
> @@ -250,6 +252,7 @@ static uint32_t emc_read(QTestState *qts, const
> EMCModule *mod,
>      return qtest_readl(qts, mod->base_addr + regno * sizeof(uint32_t));
>  }
>
> +#ifndef _WIN32
>  static void emc_write(QTestState *qts, const EMCModule *mod,
>                        NPCM7xxPWMRegister regno, uint32_t value)
>  {
> @@ -339,6 +342,7 @@ static bool emc_soft_reset(QTestState *qts, const
> EMCModule *mod)
>      g_message("%s: Timeout expired", __func__);
>      return false;
>  }
> +#endif /* _WIN32 */
>
>  /* Check emc registers are reset to default value. */
>  static void test_init(gconstpointer test_data)
> @@ -387,6 +391,7 @@ static void test_init(gconstpointer test_data)
>      qtest_quit(qts);
>  }
>
> +#ifndef _WIN32
>  static bool emc_wait_irq(QTestState *qts, const EMCModule *mod, int step,
>                           bool is_tx)
>  {
> @@ -843,6 +848,7 @@ static void test_rx(gconstpointer test_data)
>
>      qtest_quit(qts);
>  }
> +#endif /* _WIN32 */
>
>  static void emc_add_test(const char *name, const TestData* td,
>                           GTestDataFunc fn)
> @@ -865,8 +871,10 @@ int main(int argc, char **argv)
>          td->module = &emc_module_list[i];
>
>          add_test(init, td);
> +#ifndef _WIN32
>          add_test(tx, td);
>          add_test(rx, td);
> +#endif
>      }
>
>      return g_test_run();
> --
> 2.34.1
>
>
>
Re: [PATCH 43/51] tests/qtest: npcm7xx_emc-test: Skip running test_{tx,rx} on win32
Posted by Thomas Huth 3 years, 5 months ago
On 24/08/2022 11.40, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> The test cases 'test_{tx,rx}' call socketpair() which does not exist
> on win32. Exclude them.
> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
> 
>   tests/qtest/npcm7xx_emc-test.c | 8 ++++++++
>   1 file changed, 8 insertions(+)

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