From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHXsQ-0003KJ-9N for qemu-devel@nongnu.org; Fri, 08 Jan 2016 09:18:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHXsN-0002eG-4E for qemu-devel@nongnu.org; Fri, 08 Jan 2016 09:18:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHXsM-0002df-Ud for qemu-devel@nongnu.org; Fri, 08 Jan 2016 09:18:47 -0500 Date: Fri, 8 Jan 2016 16:18:42 +0200 From: "Michael S. Tsirkin" Message-ID: <1452262668-31244-5-git-send-email-mst@redhat.com> References: <1452262668-31244-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452262668-31244-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 04/59] tests: acpi: print ASL diff in verbose mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Wei Huang , Peter Maydell , Gabriel Somlo , Laszlo Ersek , Igor Mammedov From: Igor Mammedov 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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); -- MST