From patchwork Tue Jan 27 14:25:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5718261 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C2E55C058D for ; Tue, 27 Jan 2015 14:25:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC9F5201FE for ; Tue, 27 Jan 2015 14:25:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0C6F7201F5 for ; Tue, 27 Jan 2015 14:25:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 990106E34D; Tue, 27 Jan 2015 06:25:51 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B7F96E34D for ; Tue, 27 Jan 2015 06:25:50 -0800 (PST) Received: by mail-wg0-f43.google.com with SMTP id y19so15071552wgg.2 for ; Tue, 27 Jan 2015 06:25:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9x496ERrk9239r477PrT1dlY7PTMbf3ZDUk7CQzrvOg=; b=MtLX2AUDojTVS52MeHFGrUrWviDQblQxGh5AaNP+j5m/NNCTYlzst0H875w6p/zidT LwEMQeg47Z4od9cphYNQk3OBSKSp2sj+0QXlw/7vQNT1TfKLpuXKEmp/vVDBJyLaCBum RCBlBT+SYBKEoPmxoMI+HSOM5Ax2FBydVWM1T3mR9HgywqCUv+izwf8KElNa+tyqJKSt Cy9ZqUhpmPj2WhuiJuxDeSKIkOhEOF7Dv2qne2M6+frMgLVz43wJEGPVyBwiKsR4olfo jSuAqtM3HlfT6yWHatYLNq0vJqAcFVjA2yYRkVIV4M0Cwpx3y/tN0OR++G9AemcQULYg +HGA== X-Gm-Message-State: ALoCoQkwPcDSjelx7m61KL7aVg8b4GwInsk6nuJEEOn634j5Z7DB7JbtJnqwVTUArH4KUAl6S6gQ X-Received: by 10.180.21.161 with SMTP id w1mr6634905wie.44.1422368747839; Tue, 27 Jan 2015 06:25:47 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id n3sm2012742wja.36.2015.01.27.06.25.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jan 2015 06:25:47 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Tue, 27 Jan 2015 14:25:44 +0000 Message-Id: <1422368744-14230-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422368744-14230-1-git-send-email-thomas.wood@intel.com> References: <1422368744-14230-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/2] lib: add exit status message to simple tests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an exit status message to simple tests, similar to the one printed for subtests. This includes the test outcome and the time taken to run the test. Signed-off-by: Thomas Wood --- lib/igt_core.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 41f84bb..0ae6918 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -591,6 +591,9 @@ out: /* install exit handler, to ensure we clean up */ igt_install_exit_handler(common_exit_handler); + if (!test_with_subtests) + gettime(&subtest_time); + return ret; } @@ -975,8 +978,33 @@ void igt_exit(void) kmsg(KERN_INFO "%s: exiting, ret=%d\n", command_str, igt_exitcode); igt_debug("Exiting with status code %d\n", igt_exitcode); - if (!test_with_subtests) + if (!test_with_subtests) { + struct timespec now; + double elapsed; + const char *result; + + gettime(&now); + elapsed = now.tv_sec - subtest_time.tv_sec; + elapsed += (now.tv_nsec - subtest_time.tv_nsec) * 1e-9; + + switch (igt_exitcode) { + case IGT_EXIT_SUCCESS: + result = "SUCCESS"; + break; + case IGT_EXIT_TIMEOUT: + result = "TIMEOUT"; + break; + case IGT_EXIT_SKIP: + result = "SKIP"; + break; + default: + result = "FAIL"; + } + + + printf("%s (%.3fs)\n", result, elapsed); exit(igt_exitcode); + } /* Calling this without calling one of the above is a failure */ assert(skipped_one || succeeded_one || failed_one);