xref: /qemu/tests/qtest/modules-test.c (revision fd66dbd4)
11e8a1faeSThomas Huth #include "qemu/osdep.h"
2907b5105SMarc-André Lureau #include "libqtest.h"
31e8a1faeSThomas Huth 
41e8a1faeSThomas Huth const char common_args[] = "-nodefaults -machine none";
51e8a1faeSThomas Huth 
test_modules_load(const void * data)61e8a1faeSThomas Huth static void test_modules_load(const void *data)
71e8a1faeSThomas Huth {
81e8a1faeSThomas Huth     QTestState *qts;
91e8a1faeSThomas Huth     const char **args = (const char **)data;
101e8a1faeSThomas Huth 
111e8a1faeSThomas Huth     qts = qtest_init(common_args);
121e8a1faeSThomas Huth     qtest_module_load(qts, args[0], args[1]);
131e8a1faeSThomas Huth     qtest_quit(qts);
141e8a1faeSThomas Huth }
151e8a1faeSThomas Huth 
main(int argc,char * argv[])161e8a1faeSThomas Huth int main(int argc, char *argv[])
171e8a1faeSThomas Huth {
181e8a1faeSThomas Huth     const char *modules[] = {
19fd66dbd4SStefan Hajnoczi #ifdef CONFIG_BLKIO
20fd66dbd4SStefan Hajnoczi         "block-", "blkio",
21fd66dbd4SStefan Hajnoczi #endif
221e8a1faeSThomas Huth #ifdef CONFIG_CURL
231e8a1faeSThomas Huth         "block-", "curl",
241e8a1faeSThomas Huth #endif
251e8a1faeSThomas Huth #ifdef CONFIG_GLUSTERFS
261e8a1faeSThomas Huth         "block-", "gluster",
271e8a1faeSThomas Huth #endif
281e8a1faeSThomas Huth #ifdef CONFIG_LIBISCSI
291e8a1faeSThomas Huth         "block-", "iscsi",
301e8a1faeSThomas Huth #endif
311e8a1faeSThomas Huth #ifdef CONFIG_LIBNFS
321e8a1faeSThomas Huth         "block-", "nfs",
331e8a1faeSThomas Huth #endif
341e8a1faeSThomas Huth #ifdef CONFIG_LIBSSH
351e8a1faeSThomas Huth         "block-", "ssh",
361e8a1faeSThomas Huth #endif
371e8a1faeSThomas Huth #ifdef CONFIG_RBD
381e8a1faeSThomas Huth         "block-", "rbd",
391e8a1faeSThomas Huth #endif
401e8a1faeSThomas Huth #ifdef CONFIG_AUDIO_ALSA
411e8a1faeSThomas Huth         "audio-", "alsa",
421e8a1faeSThomas Huth #endif
431e8a1faeSThomas Huth #ifdef CONFIG_AUDIO_OSS
441e8a1faeSThomas Huth         "audio-", "oss",
451e8a1faeSThomas Huth #endif
461e8a1faeSThomas Huth #ifdef CONFIG_AUDIO_PA
471e8a1faeSThomas Huth         "audio-", "pa",
481e8a1faeSThomas Huth #endif
491e8a1faeSThomas Huth #ifdef CONFIG_AUDIO_SDL
501e8a1faeSThomas Huth         "audio-", "sdl",
511e8a1faeSThomas Huth #endif
521e8a1faeSThomas Huth #ifdef CONFIG_CURSES
531e8a1faeSThomas Huth         "ui-", "curses",
541e8a1faeSThomas Huth #endif
551e8a1faeSThomas Huth #if defined(CONFIG_GTK) && defined(CONFIG_VTE)
561e8a1faeSThomas Huth         "ui-", "gtk",
571e8a1faeSThomas Huth #endif
581e8a1faeSThomas Huth #ifdef CONFIG_SDL
591e8a1faeSThomas Huth         "ui-", "sdl",
601e8a1faeSThomas Huth #endif
611e8a1faeSThomas Huth #if defined(CONFIG_SPICE) && defined(CONFIG_GIO)
621e8a1faeSThomas Huth         "ui-", "spice-app",
631e8a1faeSThomas Huth #endif
641e8a1faeSThomas Huth     };
651e8a1faeSThomas Huth     int i;
661e8a1faeSThomas Huth 
671e8a1faeSThomas Huth     g_test_init(&argc, &argv, NULL);
681e8a1faeSThomas Huth 
691e8a1faeSThomas Huth     for (i = 0; i < G_N_ELEMENTS(modules); i += 2) {
701e8a1faeSThomas Huth         char *testname = g_strdup_printf("/module/load/%s%s",
711e8a1faeSThomas Huth                                          modules[i], modules[i + 1]);
721e8a1faeSThomas Huth         qtest_add_data_func(testname, modules + i, test_modules_load);
731e8a1faeSThomas Huth         g_free(testname);
741e8a1faeSThomas Huth     }
751e8a1faeSThomas Huth 
761e8a1faeSThomas Huth     return g_test_run();
771e8a1faeSThomas Huth }
78