Marc-André Lureau | eb062cf | 2019-07-22 22:51:40 +0400 | [diff] [blame] | 1 | #include "qemu/osdep.h" |
| 2 | #include "libqtest.h" |
| 3 | |
Marc-André Lureau | d39b626 | 2019-08-27 18:02:41 +0400 | [diff] [blame] | 4 | const char common_args[] = "-nodefaults -machine none"; |
| 5 | |
Marc-André Lureau | eb062cf | 2019-07-22 22:51:40 +0400 | [diff] [blame] | 6 | static void test_modules_load(const void *data) |
| 7 | { |
| 8 | QTestState *qts; |
Paolo Bonzini | 0712c1b | 2019-08-22 19:42:13 +0200 | [diff] [blame] | 9 | const char **args = (const char **)data; |
Marc-André Lureau | eb062cf | 2019-07-22 22:51:40 +0400 | [diff] [blame] | 10 | |
Marc-André Lureau | d39b626 | 2019-08-27 18:02:41 +0400 | [diff] [blame] | 11 | qts = qtest_init(common_args); |
Marc-André Lureau | eb062cf | 2019-07-22 22:51:40 +0400 | [diff] [blame] | 12 | qtest_module_load(qts, args[0], args[1]); |
| 13 | qtest_quit(qts); |
| 14 | } |
| 15 | |
| 16 | int main(int argc, char *argv[]) |
| 17 | { |
| 18 | const char *modules[] = { |
| 19 | #ifdef CONFIG_CURL |
| 20 | "block-", "curl", |
| 21 | #endif |
| 22 | #ifdef CONFIG_GLUSTERFS |
| 23 | "block-", "gluster", |
| 24 | #endif |
| 25 | #ifdef CONFIG_LIBISCSI |
| 26 | "block-", "iscsi", |
| 27 | #endif |
| 28 | #ifdef CONFIG_LIBNFS |
| 29 | "block-", "nfs", |
| 30 | #endif |
| 31 | #ifdef CONFIG_LIBSSH |
| 32 | "block-", "ssh", |
| 33 | #endif |
| 34 | #ifdef CONFIG_RBD |
| 35 | "block-", "rbd", |
| 36 | #endif |
| 37 | #ifdef CONFIG_AUDIO_ALSA |
| 38 | "audio-", "alsa", |
| 39 | #endif |
| 40 | #ifdef CONFIG_AUDIO_OSS |
| 41 | "audio-", "oss", |
| 42 | #endif |
| 43 | #ifdef CONFIG_AUDIO_PA |
| 44 | "audio-", "pa", |
| 45 | #endif |
| 46 | #ifdef CONFIG_AUDIO_SDL |
| 47 | "audio-", "sdl", |
| 48 | #endif |
| 49 | #ifdef CONFIG_CURSES |
| 50 | "ui-", "curses", |
| 51 | #endif |
| 52 | #if defined(CONFIG_GTK) && defined(CONFIG_VTE) |
| 53 | "ui-", "gtk", |
| 54 | #endif |
| 55 | #ifdef CONFIG_SDL |
| 56 | "ui-", "sdl", |
| 57 | #endif |
Marc-André Lureau | f54d432 | 2019-08-27 18:02:40 +0400 | [diff] [blame] | 58 | #if defined(CONFIG_SPICE) && defined(CONFIG_GIO) |
| 59 | "ui-", "spice-app", |
| 60 | #endif |
Marc-André Lureau | eb062cf | 2019-07-22 22:51:40 +0400 | [diff] [blame] | 61 | }; |
| 62 | int i; |
| 63 | |
| 64 | g_test_init(&argc, &argv, NULL); |
| 65 | |
| 66 | for (i = 0; i < G_N_ELEMENTS(modules); i += 2) { |
Cole Robinson | eca3a94 | 2019-11-13 16:09:35 -0500 | [diff] [blame] | 67 | char *testname = g_strdup_printf("/module/load/%s%s", |
| 68 | modules[i], modules[i + 1]); |
Marc-André Lureau | eb062cf | 2019-07-22 22:51:40 +0400 | [diff] [blame] | 69 | qtest_add_data_func(testname, modules + i, test_modules_load); |
| 70 | g_free(testname); |
| 71 | } |
| 72 | |
| 73 | return g_test_run(); |
| 74 | } |