From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 11E243858C2C for ; Mon, 20 Jun 2022 15:08:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 11E243858C2C Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-mKEpZ5W5P7GCb6RAl2DSiQ-1; Mon, 20 Jun 2022 11:08:34 -0400 X-MC-Unique: mKEpZ5W5P7GCb6RAl2DSiQ-1 Received: by mail-qv1-f70.google.com with SMTP id w18-20020a0ce112000000b0046e7f2c5a06so10582908qvk.0 for ; Mon, 20 Jun 2022 08:08:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=gMoPpWi+fEfthLId5YNEv061inBZc+5z3T4DBj9FtOo=; b=pHmJdHZOPz/xqtxaA5htfBlvwxkxIttaCqjExXkCRAh7JcXTbRFeseTi+R8ETvF1fO otCULELqCkVKO9/72/9SBBaVszRmOrqiaORXj3WeITFTMkynvx1to8Qn3Ouq7ijUskb6 7alqkMS4S5aXNVdNzTPJRgjDX5ndnNhgOqhkGNjuibHRa/e6TpC3h5m8J+BqR4OdPJbl o/XrZpxKWIecJqww5q+/E0kuEy0TR1m7C1zrQDAxFbEGIK1ah3VvS5pIg4L3/IblU06t dPqSk70GtWxuxJ4grMQJAw7hTMqtYwBNxFqlwwVy2PdXJvup3Bw1DdUh6qPPrF+8+DJ6 TRCg== X-Gm-Message-State: AJIora9sDE+5tIpsiTiUrL3220T0rxPuf/6VEUCdprk7XlzzXdp67scx hLhysz416LcLvqLxz7fT+J03yuiOWkWKsiDeDoaV79xrF9QjdZgN+lukcGuJJkBMa/Uj5fokUoL Kp6Y+3on3tYhAZXPWHRMOSA1WbYUAm7gQ+orMdRczKHa7Z5qGSg1zq4Q8nuBWM5jnfdwQ X-Received: by 2002:ac8:7fc1:0:b0:304:ed32:4463 with SMTP id b1-20020ac87fc1000000b00304ed324463mr20166301qtk.504.1655737713983; Mon, 20 Jun 2022 08:08:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u+WcF+J4FvvPNc5zLYnw9E/fDv/vzGPDZlsPGpvAly/GILTDUo6Ckji+Tt14g75OVxpY1C6w== X-Received: by 2002:ac8:7fc1:0:b0:304:ed32:4463 with SMTP id b1-20020ac87fc1000000b00304ed324463mr20166269qtk.504.1655737713618; Mon, 20 Jun 2022 08:08:33 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id b198-20020a3767cf000000b0069fc13ce1f3sm11901688qkc.36.2022.06.20.08.08.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 08:08:33 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 2C7755800FC; Mon, 20 Jun 2022 17:08:31 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH] Add better error messaging to several tests Organization: Red Hat / France X-Operating-System: Fedora 37 X-URL: http://www.redhat.com Date: Mon, 20 Jun 2022 17:08:30 +0200 Message-ID: <877d5bid8x.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2022 15:08:41 -0000 Hello, When test-read-dwarf and test-diff-filter fail, it's important to know what exact command line failed. This patch makes these tests display the failing command. * tests/test-diff-filter.cc (test_task::perform): Display the failing command. * tests/test-read-common.cc (test_task::run_abidw): Likewise. * tests/test-read-common.h (test_task::run_diff): Likewise. Signed-off-by: Dodji Seketeli --- tests/test-diff-filter.cc | 3 +++ tests/test-read-common.cc | 8 +++++--- tests/test-read-common.h | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test-diff-filter.cc b/tests/test-diff-filter.cc index e90adafe..72a1bc93 100644 --- a/tests/test-diff-filter.cc +++ b/tests/test-diff-filter.cc @@ -902,6 +902,9 @@ struct test_task : public abigail::workers::task } else is_ok = false; + + if (!abidiff_ok) + error_message += "cmd failed: " + cmd; } }; //end struct test_task. diff --git a/tests/test-read-common.cc b/tests/test-read-common.cc index b441945c..b794a311 100644 --- a/tests/test-read-common.cc +++ b/tests/test-read-common.cc @@ -108,7 +108,8 @@ test_task::run_abidw(const string& extargs) + in_abi_path + "\nand:\n" + out_abi_path - + "\n"; + + "\n" + + "command was: '" + cmd + "'\n"; return false; } @@ -131,11 +132,12 @@ test_task::run_diff() string cmd = "diff -u " + in_abi_path + " " + out_abi_path; if (system(cmd.c_str())) { - error_message = string("ABIs differ:\n") + error_message = string("ABI files differ:\n") + in_abi_path + "\nand:\n" + out_abi_path - + "\n"; + + "\n" + + "command was: '" + cmd + "'\n"; return false; } diff --git a/tests/test-read-common.h b/tests/test-read-common.h index 00d4d1d1..4277896a 100644 --- a/tests/test-read-common.h +++ b/tests/test-read-common.h @@ -101,6 +101,10 @@ struct test_task : public abigail::workers::task bool set_out_abi_path() { + if (!spec.out_abi_path) + // No output abi path was specified in the spec, so get out. + return false; + out_abi_path = out_abi_base + spec.out_abi_path; if (!abigail::tools_utils::ensure_parent_dir_created(out_abi_path)) { -- 2.36.1 -- Dodji