From patchwork Tue Sep 29 23:56:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 54285 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id C20EF23009 for ; Tue, 29 Sep 2015 23:59:31 +0000 (UTC) Received: by laak17 with SMTP id k17sf12564582laa.3 for ; Tue, 29 Sep 2015 16:59:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list; bh=PIqy/Yzs0ZD4gJtDJVNN8yO9I0xVXBF2cF316K0lbNo=; b=irB+yQ1pt9oJnobD07dl85HMKJ0xtWTZ5CyNQA1J1GixDliRr5gj2NLvjlFx9eHyQ2 aGUBsWNzdawMNptmAkTvUFi4vXJjh5wieEQ8hROf7Ikzt/B/iT3BLyvnTjEh7gxnmJx6 mjfmEIzHcT3rXDzKKITk8C+EniPF/BSDR3e2ugw8PNH8s7h2dh/xaRLQ+MpuzRCIG08a xfge3eYhPBMUsV3cHJZTL5kW0AHfIpAgmH1ksZGOg+/CH6V+Tum4+vsju0Nicrs8jisU VZM3zFvi6iQu1T8ko1USRJB4vPCvrNT7TyTRTfXf3gsbNEDH+KhWaxVruxpd94riXzDc dIBQ== X-Gm-Message-State: ALoCoQkIdzCeifACDIqghtU4yauoXeOOr5xkY9qeaBfP8ssn8HkDAxB7iKIDIbKp5wF6s8CTRj5l X-Received: by 10.112.125.104 with SMTP id mp8mr82808lbb.20.1443571170039; Tue, 29 Sep 2015 16:59:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.218.208 with SMTP id r199ls10211lfg.2.gmail; Tue, 29 Sep 2015 16:59:29 -0700 (PDT) X-Received: by 10.112.13.161 with SMTP id i1mr204530lbc.96.1443571169756; Tue, 29 Sep 2015 16:59:29 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id 28si12152173lfy.25.2015.09.29.16.59.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 16:59:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labzv5 with SMTP id zv5so27367337lab.1 for ; Tue, 29 Sep 2015 16:59:29 -0700 (PDT) X-Received: by 10.112.139.201 with SMTP id ra9mr188963lbb.29.1443571169310; Tue, 29 Sep 2015 16:59:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2430630lbq; Tue, 29 Sep 2015 16:59:28 -0700 (PDT) X-Received: by 10.180.81.199 with SMTP id c7mr1255919wiy.87.1443571168753; Tue, 29 Sep 2015 16:59:28 -0700 (PDT) Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com. [209.132.183.39]) by mx.google.com with ESMTPS id hs10si29969087wib.46.2015.09.29.16.59.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 16:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8TNuuuH005388; Tue, 29 Sep 2015 19:56:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t8TNusgH032262 for ; Tue, 29 Sep 2015 19:56:54 -0400 Received: from colepc.redhat.com (ovpn-113-60.phx2.redhat.com [10.3.113.60]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8TNuo7T015888; Tue, 29 Sep 2015 19:56:54 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 29 Sep 2015 19:56:47 -0400 Message-Id: <9e35b42c371fd9d2d232942c4e72dc6d5091c8ed.1443570876.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] testutils: Drop virtTestResult X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: crobinso@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 virtTestResult is suboptimal for a few reasons: - It poorly duplicates virtTestRun pass/fail reporting logic - It doesn't have virtTestRun's alloc testing support - It only reports the test name _after_ the test has run. - It doesn't follow the standard virtTestRun pattern that most other tests use. There's no users left, so drop it. If any other async tests like eventtest spring up that don't cleanly fit the virtTestRun pattern, I suggest they just open code the support for it around virtTestRun --- tests/testutils.c | 38 -------------------------------------- tests/testutils.h | 2 -- 2 files changed, 40 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index bd4ff73..857e819 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -119,44 +119,6 @@ static void virTestAllocHook(int nalloc ATTRIBUTE_UNUSED, } #endif -void virtTestResult(const char *name, int ret, const char *msg, ...) -{ - va_list vargs; - va_start(vargs, msg); - - if (testCounter == 0 && !virTestGetVerbose()) - fprintf(stderr, " "); - - testCounter++; - if (virTestGetVerbose()) { - fprintf(stderr, "%3zu) %-60s ", testCounter, name); - if (ret == 0) { - fprintf(stderr, "OK\n"); - } else { - fprintf(stderr, "FAILED\n"); - if (msg) { - char *str; - if (virVasprintfQuiet(&str, msg, vargs) == 0) { - fprintf(stderr, "%s", str); - VIR_FREE(str); - } - } - } - } else { - if (testCounter != 1 && - !((testCounter-1) % 40)) { - fprintf(stderr, " %-3zu\n", (testCounter-1)); - fprintf(stderr, " "); - } - if (ret == 0) - fprintf(stderr, "."); - else - fprintf(stderr, "!"); - } - - va_end(vargs); -} - #ifdef TEST_OOM_TRACE static void virTestShowTrace(void) diff --git a/tests/testutils.h b/tests/testutils.h index f34a393..ccf1d29 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -48,8 +48,6 @@ extern char *progname; bool virtTestOOMActive(void); -void virtTestResult(const char *name, int ret, const char *msg, ...) - ATTRIBUTE_FMT_PRINTF(3,4); int virtTestRun(const char *title, int (*body)(const void *data), const void *data);