From patchwork Mon Dec 28 17:02:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 561321 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 139A6140BBB for ; Tue, 29 Dec 2015 04:03:41 +1100 (AEDT) Received: from localhost ([::1]:45274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDbCs-0000vA-U1 for incoming@patchwork.ozlabs.org; Mon, 28 Dec 2015 12:03:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDbCK-0008Co-3i for qemu-devel@nongnu.org; Mon, 28 Dec 2015 12:03:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDbCG-0007xe-TQ for qemu-devel@nongnu.org; Mon, 28 Dec 2015 12:03:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDbCG-0007xa-Nj for qemu-devel@nongnu.org; Mon, 28 Dec 2015 12:03:00 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 32B413B75A for ; Mon, 28 Dec 2015 17:03:00 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBSH2wIp021909 for ; Mon, 28 Dec 2015 12:02:59 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 28 Dec 2015 18:02:08 +0100 Message-Id: <1451322178-261185-1-git-send-email-imammedo@redhat.com> In-Reply-To: <1451321851-260744-1-git-send-email-imammedo@redhat.com> References: <1451321851-260744-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 01/51] tests: acpi: print ASL diff in verbose mode 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 print ASL difference if there is any when executing 'make V=1 check'. Use 'DIFF' environment variable to determine which diff utility to use and if it's not set notify user by printing warning that DIFF is not set if run in verbose mode and there is difference in ASL. Signed-off-by: Igor Mammedov --- tests/bios-tables-test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 6d37332..75ec330 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -580,6 +580,22 @@ static void test_acpi_asl(test_data *data) (gchar *)&signature, sdt->asl_file, sdt->aml_file, exp_sdt->asl_file, exp_sdt->aml_file); + if (getenv("V")) { + const char *diff_cmd = getenv("DIFF"); + if (diff_cmd) { + int ret G_GNUC_UNUSED; + char *diff = g_strdup_printf("%s %s %s", diff_cmd, + exp_sdt->asl_file, sdt->asl_file); + ret = system(diff) ; + g_free(diff); + } else { + fprintf(stderr, "acpi-test: Warning. not showing " + "difference since no diff utility is specified. " + "Set 'DIFF' environment variable to a preferred " + "diff utility and run 'make V=1 check' again to " + "see ASL difference."); + } + } } } g_string_free(asl, true);