From patchwork Wed Feb 5 17:01:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 317208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 388212C0099 for ; Thu, 6 Feb 2014 04:04:58 +1100 (EST) Received: from localhost ([::1]:60387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB5uC-00080G-3K for incoming@patchwork.ozlabs.org; Wed, 05 Feb 2014 12:04:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB5qp-0002z9-6P for qemu-devel@nongnu.org; Wed, 05 Feb 2014 12:01:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WB5qh-00048x-Jf for qemu-devel@nongnu.org; Wed, 05 Feb 2014 12:01:27 -0500 Received: from cantor2.suse.de ([195.135.220.15]:38659 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB5qh-00048Q-Cn for qemu-devel@nongnu.org; Wed, 05 Feb 2014 12:01:19 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B579375014; Wed, 5 Feb 2014 17:01:18 +0000 (UTC) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 5 Feb 2014 18:01:16 +0100 Message-Id: <1391619677-32387-5-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1391619677-32387-1-git-send-email-afaerber@suse.de> References: <1391619677-32387-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH qom-next 4/5] tests: Add PC-Net qtest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Test PCI only for now. Signed-off-by: Andreas Färber --- tests/Makefile | 4 ++++ tests/pcnet-test.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 tests/pcnet-test.c diff --git a/tests/Makefile b/tests/Makefile index eabdf98..867d931 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -69,6 +69,9 @@ check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c check-qtest-pci-y += tests/rtl8139-test$(EXESUF) gcov-files-pci-y += hw/net/rtl8139.c +check-qtest-pci-y += tests/pcnet-test$(EXESUF) +gcov-files-pci-y += hw/net/pcnet.c +gcov-files-pci-y += hw/net/pcnet-pci.c check-qtest-i386-y = tests/endianness-test$(EXESUF) check-qtest-i386-y += tests/fdc-test$(EXESUF) @@ -210,6 +213,7 @@ tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y) tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o +tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/blockdev-test$(EXESUF): tests/blockdev-test.o $(libqos-pc-obj-y) diff --git a/tests/pcnet-test.c b/tests/pcnet-test.c new file mode 100644 index 0000000..643b348 --- /dev/null +++ b/tests/pcnet-test.c @@ -0,0 +1,35 @@ +/* + * QTest testcase for PC-Net NIC + * + * Copyright (c) 2013-2014 SUSE LINUX Products GmbH + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include "libqtest.h" + +#include +#include +#include "qemu/osdep.h" + +static void pci_nop(void) +{ +} + +int main(int argc, char **argv) +{ + QTestState *s; + int ret; + + g_test_init(&argc, &argv, NULL); + qtest_add_func("/pcnet/pci/nop", pci_nop); + + s = qtest_start("-device pcnet"); + ret = g_test_run(); + + if (s) { + qtest_quit(s); + } + + return ret; +}