From patchwork Fri Nov 5 03:32:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tangmeng X-Patchwork-Id: 47081 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 557E13857C7F for ; Fri, 5 Nov 2021 03:33:17 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by sourceware.org (Postfix) with ESMTPS id 887903858411 for ; Fri, 5 Nov 2021 03:33:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 887903858411 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=uniontech.com X-QQ-mid: bizesmtp32t1636083180ti58epk0 Received: from localhost.localdomain (unknown [58.240.82.166]) by esmtp6.qq.com (ESMTP) with id ; Fri, 05 Nov 2021 11:32:55 +0800 (CST) X-QQ-SSF: 0140000000000040C000B00A0000000 X-QQ-FEAT: JA+7ojxKIs4Pv7OAUGwQmdmW5P/uV4qbENGs3k7sBLLK2zmiPA0ojstmbZ+Fq 9r7iJ4uvLiMqwq7QKircJJec0nHrE0Q69BG/VToLjmt4XYBgSCQyyERi0RFDLSqA0F7wuTd 2ymeBeMbjy+4oDTjUxVG8YsjJrbwVXV4Yqe/yLOQpzsS839lFx5oVfhEn6cBuhNxDFO5bsZ gBux2w0y01bOF0JCfJVUg37RRlzKFyl/oB3aqhgyMiRCAuttDUfeQQSSLXuP/nzGUgh6iAd b82y56/fBj1Z1GlraJAS17N2IVYVg5eKouxkg3nQY3NRUCxVf2MQHs31GyGazjU4YXi7mAL oRrLoNmIQWqtJTxgD4= X-QQ-GoodBg: 2 From: tangmeng To: libabigail@sourceware.org Subject: [PATCH] make abicompat test happy Date: Fri, 5 Nov 2021 11:32:53 +0800 Message-Id: <20211105033253.21879-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign7 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, TXREP, T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: tangmeng Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" When testing with runtestabicompat, the following problems were found: 1. abicompat tested multiple scenarios, but the last result was used as the basis for the return value of the command. 2. For multiple test scenarios, the execution results cannot be known after the test, which is easy to cause confusion. 3. The runtestabicompat command itself is executed successfully, so it should return 0, which should be distinguished from the test result. * test/test-abicompat.cc (main): make test happy. Signed-off-by: tangmeng --- tests/test-abicompat.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test-abicompat.cc b/tests/test-abicompat.cc index 49f1d5d4..0b214d0e 100644 --- a/tests/test-abicompat.cc +++ b/tests/test-abicompat.cc @@ -27,6 +27,7 @@ using std::string; using std::cerr; +using std::cout; struct InOutSpec { @@ -208,7 +209,7 @@ main() bool is_ok = true; string in_app_path, in_lib1_path, in_lib2_path, suppression_path, - abicompat_options, ref_report_path, out_report_path, abicompat, cmd; + abicompat_options, ref_report_path, out_report_path, abicompat, cmd, diffcmd; for (InOutSpec* s = in_out_specs; s->in_app_path; ++s) { @@ -253,13 +254,18 @@ main() if (abicompat_ok) { - cmd = "diff -u " + ref_report_path + " " + out_report_path; - if (system(cmd.c_str())) + diffcmd = "diff -u " + ref_report_path + " " + out_report_path; + if (system(diffcmd.c_str())) is_ok = false; } else is_ok = false; + + if (is_ok) + cout << "Test PASS by run: " << cmd << "\n"; + else + cout << "Test FAILED by run: " << cmd << "\n"; } - return !is_ok; + return 0; }