From patchwork Wed Jan 9 18:53:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 1954051 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5AB89E007B for ; Wed, 9 Jan 2013 18:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464Ab3AISx1 (ORCPT ); Wed, 9 Jan 2013 13:53:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932438Ab3AISxK (ORCPT ); Wed, 9 Jan 2013 13:53:10 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r09IqRDa031858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Jan 2013 13:52:28 -0500 Received: from blackpad.lan.raisama.net (vpn1-7-24.gru2.redhat.com [10.97.7.24]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r09IqRq7020828; Wed, 9 Jan 2013 13:52:27 -0500 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 8D8D5203D82; Wed, 9 Jan 2013 16:54:05 -0200 (BRST) From: Eduardo Habkost To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Igor Mammedov , kvm@vger.kernel.org Subject: [RFC 10/12] tests: Support target-specific unit tests Date: Wed, 9 Jan 2013 16:53:50 -0200 Message-Id: <1357757632-1950-11-git-send-email-ehabkost@redhat.com> In-Reply-To: <1357757632-1950-1-git-send-email-ehabkost@redhat.com> References: <1357757632-1950-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org To make unit tests that depend on target-specific files, use check-unit--y and test-obj--y. Signed-off-by: Eduardo Habkost --- tests/Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index b09a343..fa96d1a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -74,8 +74,6 @@ test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) qemu-tool.o test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o test-qapi-obj-y += module.o -$(test-obj-y): QEMU_INCLUDES += -Itests - tests/check-qint$(EXESUF): tests/check-qint.o qint.o tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o @@ -111,9 +109,20 @@ tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y) tests/fdc-test$(EXESUF): tests/fdc-test.o tests/libqtest.o $(trace-obj-y) tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o tests/libqtest.o $(trace-obj-y) -# QTest rules +# unit test rules: TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) + +# target-specific tests/objs: +test-obj-y += $(foreach TARGET,$(TARGETS), $(test-obj-$(TARGET)-y)) +check-unit-y += $(foreach TARGET,$(TARGETS), $(check-unit-$(TARGET)-y)) + +$(foreach TARGET,$(TARGETS),$(eval $(test-obj-$(TARGET)-y): QEMU_INCLUDES += -Itarget-$(TARGET))) + +$(test-obj-y): QEMU_INCLUDES += -Itests + +# QTest rules + QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))