From patchwork Tue Jul 31 16:47:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 951703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41g2S66gsbz9ryl for ; Wed, 1 Aug 2018 02:48:04 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 094E33E76A2 for ; Tue, 31 Jul 2018 18:48:01 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id 7F96D3E602B for ; Tue, 31 Jul 2018 18:47:58 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id 0DEE91A00937 for ; Tue, 31 Jul 2018 18:47:57 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6C2E280D; Tue, 31 Jul 2018 09:47:55 -0700 (PDT) Received: from localhost (e105922-lin.Emea.Arm.com [10.4.13.124]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 103633F5BA; Tue, 31 Jul 2018 09:47:54 -0700 (PDT) From: Punit Agrawal To: ltp@lists.linux.it Date: Tue, 31 Jul 2018 17:47:45 +0100 Message-Id: <20180731164745.7289-1-punit.agrawal@arm.com> X-Mailer: git-send-email 2.18.0 X-ARM-No-Footer: FoSSMail X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH v3] ltp-pan: Increase allowed width of test name in logs X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" ltp-pan truncates the test name when logging the outcome of tests. This is causing issues with tooling which is expecting to parse unique test names from the log. cgroup_fj_stress_cpuacct_2_2_o PASS 0 cgroup_fj_stress_cpuacct_3_3_o PASS 0 cgroup_fj_stress_cpuacct_4_4_o PASS 0 cgroup_fj_stress_cpuacct_2_9_o PASS 0 cgroup_fj_stress_cpuacct_10_3_ PASS 0 Fix this by increasing the expected size of test name and removing the hard restriction on the size of the name. Refactor the common part of the format string into a macro as it seems to be repeated a few. Signed-off-by: Punit Agrawal --- Hi, I've updated the patch to fix the issues from the previous version, viz, * corrected the bogus macro definition * re-factored only part of the format string Thanks, Punit pan/ltp-pan.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c index a2bb9b7ef..8ac484ec6 100644 --- a/pan/ltp-pan.c +++ b/pan/ltp-pan.c @@ -130,6 +130,9 @@ static char *test_out_dir = NULL; /* dir to buffer output to */ zoo_t zoofile; static char *reporttype = NULL; +/* Common format string for ltp-pan results */ +#define ResultFmt "%-50s %-10.10s" + /* zoolib */ int rec_signal; /* received signal */ int send_signal; /* signal to send */ @@ -350,9 +353,9 @@ int main(int argc, char **argv) fprintf(logfile, "Test Start Time: %s\n", s); fprintf(logfile, "-----------------------------------------\n"); - fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n", + fprintf(logfile, ResultFmt" %-10.10s\n", "Testcase", "Result", "Exit Value"); - fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n", + fprintf(logfile, ResultFmt" %-10.10s\n", "--------", "------", "------------"); } fflush(logfile); @@ -825,7 +828,7 @@ check_pids(struct tag_pgrp *running, int *num_active, int keep_active, } fprintf(logfile, - "%-30.30s %-10.10s %-5d\n", + ResultFmt" %-5d\n", running[i].cmd->name, result_str, w); @@ -1104,7 +1107,7 @@ run_child(struct coll_entry *colle, struct tag_pgrp *active, int quiet_mode, if (termid != 0) ++ * failcnt; - fprintf(logfile, "%-30.30s %-10.10s %-5d\n", + fprintf(logfile, ResultFmt" %-5d\n", colle->name, ((termid != 0) ? "FAIL" : "PASS"), termid);