From: Avi Kivity Subject: [PATCH 3/5] test: access: report successful tests optionally Date: Wed, 28 Apr 2010 18:47:56 +0300 Message-ID: <1272469678-10728-4-git-send-email-avi@redhat.com> References: <1272469678-10728-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49991 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495Ab0D1Pr7 (ORCPT ); Wed, 28 Apr 2010 11:47:59 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3SFlx2K019358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 28 Apr 2010 11:47:59 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3SFlwTx005814 for ; Wed, 28 Apr 2010 11:47:59 -0400 In-Reply-To: <1272469678-10728-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: There are so many tests, no point in reporting successful ones. Leave the capability optional in case a failure triggers a kvm or testsuite crash before the report is complete and we need to see which test failed. Signed-off-by: Avi Kivity --- kvm/user/test/x86/access.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/x86/access.c b/kvm/user/test/x86/access.c index 0906691..c7a7075 100644 --- a/kvm/user/test/x86/access.c +++ b/kvm/user/test/x86/access.c @@ -6,6 +6,8 @@ #define true 1 #define false 0 +static _Bool verbose = false; + typedef unsigned long pt_element_t; #define PAGE_SIZE ((pt_element_t)4096) @@ -145,6 +147,9 @@ typedef struct { unsigned long linear_addr; } __attribute__((packed)) descriptor_table_t; + +static void ac_test_show(ac_test_t *at); + void lidt(idt_entry_t *idt, int nentries) { descriptor_table_t dt; @@ -469,6 +474,10 @@ static void ac_test_check(ac_test_t *at, _Bool *success_ret, _Bool cond, *success_ret = false; + if (!verbose) { + ac_test_show(at); + } + va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); @@ -565,7 +574,7 @@ int ac_test_do_access(ac_test_t *at) ac_test_check(at, &success, *at->pdep != at->expected_pde, "pde %x expected %x", *at->pdep, at->expected_pde); - if (success) { + if (success && verbose) { printf("PASS\n"); } return success; @@ -590,7 +599,9 @@ int ac_test_exec(ac_test_t *at) { int r; - ac_test_show(at); + if (verbose) { + ac_test_show(at); + } ac_test_setup_pte(at); r = ac_test_do_access(at); return r; -- 1.7.0.4