Andreas Färber | 92838a1 | 2013-11-07 19:18:46 +0100 | [diff] [blame] | 1 | /* |
| 2 | * QTest testcase for eepro100 NIC |
| 3 | * |
| 4 | * Copyright (c) 2013-2014 SUSE LINUX Products GmbH |
| 5 | * |
| 6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 7 | * See the COPYING file in the top-level directory. |
| 8 | */ |
| 9 | |
Andreas Färber | 92838a1 | 2013-11-07 19:18:46 +0100 | [diff] [blame] | 10 | #include "qemu/osdep.h" |
Peter Maydell | 681c28a | 2016-02-08 18:08:51 +0000 | [diff] [blame] | 11 | #include "libqtest.h" |
Andreas Färber | 92838a1 | 2013-11-07 19:18:46 +0100 | [diff] [blame] | 12 | |
| 13 | static void test_device(gconstpointer data) |
| 14 | { |
| 15 | const char *model = data; |
| 16 | QTestState *s; |
| 17 | char *args; |
| 18 | |
| 19 | args = g_strdup_printf("-device %s", model); |
| 20 | s = qtest_start(args); |
| 21 | |
| 22 | /* Tests only initialization so far. TODO: Implement functional tests */ |
| 23 | |
| 24 | if (s) { |
| 25 | qtest_quit(s); |
| 26 | } |
| 27 | g_free(args); |
| 28 | } |
| 29 | |
| 30 | static const char *models[] = { |
| 31 | "i82550", |
| 32 | "i82551", |
| 33 | "i82557a", |
| 34 | "i82557b", |
| 35 | "i82557c", |
| 36 | "i82558a", |
| 37 | "i82558b", |
| 38 | "i82559a", |
| 39 | "i82559b", |
| 40 | "i82559c", |
| 41 | "i82559er", |
| 42 | "i82562", |
| 43 | "i82801", |
| 44 | }; |
| 45 | |
| 46 | int main(int argc, char **argv) |
| 47 | { |
| 48 | int i; |
| 49 | |
| 50 | g_test_init(&argc, &argv, NULL); |
| 51 | |
| 52 | for (i = 0; i < ARRAY_SIZE(models); i++) { |
| 53 | char *path; |
| 54 | |
Andreas Färber | 53f77e4 | 2015-03-25 18:40:15 +0100 | [diff] [blame] | 55 | path = g_strdup_printf("eepro100/%s", models[i]); |
| 56 | qtest_add_data_func(path, models[i], test_device); |
Marc-André Lureau | 6afff1f | 2017-02-05 20:07:30 +0000 | [diff] [blame] | 57 | g_free(path); |
Andreas Färber | 92838a1 | 2013-11-07 19:18:46 +0100 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | return g_test_run(); |
| 61 | } |