public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] test-abidiff-exit: Fix the command line passed to abidiff
Date: Wed, 26 Apr 2023 14:28:03 +0200	[thread overview]
Message-ID: <87fs8m7rqk.fsf@redhat.com> (raw)

Hello,

I noticed that the command line passed to abidiff in the
test-abidiff-exit.cc is getting bigger and bigger as the test runs.
This is because in the main loop that calls abidiff on each test, we
forget to reset the "headers directories" part of the command line
passed to abidiff.

Fixed thus.

	* tests/test-abidiff-exit.cc (main): Reset the headers directories
	passed to abidiff at each iteration.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 tests/test-abidiff-exit.cc | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc
index dafd0036..f7f1b0f9 100644
--- a/tests/test-abidiff-exit.cc
+++ b/tests/test-abidiff-exit.cc
@@ -934,10 +934,19 @@ main()
 	in_elfv1_path = source_dir_prefix + s->in_elfv1_path;
 	in_elfv0_debug_dir = source_dir_prefix + s->in_elfv0_debug_dir;
 	in_elfv1_debug_dir = source_dir_prefix + s->in_elfv1_debug_dir;
-	split_string(s->in_elfv0_headers_dirs, ",", in_elfv0_headers_dirs);
-	split_string(s->in_elfv1_headers_dirs, ",", in_elfv1_headers_dirs);
-	do_prefix_strings(in_elfv0_headers_dirs, source_dir_prefix);
-	do_prefix_strings(in_elfv1_headers_dirs, source_dir_prefix);
+	in_elfv0_headers_dirs.clear();
+	in_elfv1_headers_dirs.clear();
+	if (s->in_elfv0_headers_dirs && strcmp(s->in_elfv0_headers_dirs, ""))
+	  {
+	    split_string(s->in_elfv0_headers_dirs, ",", in_elfv0_headers_dirs);
+	    do_prefix_strings(in_elfv0_headers_dirs, source_dir_prefix);
+	  }
+
+	if (s->in_elfv1_headers_dirs && strcmp(s->in_elfv1_headers_dirs, ""))
+	  {
+	    split_string(s->in_elfv1_headers_dirs, ",", in_elfv1_headers_dirs);
+	    do_prefix_strings(in_elfv1_headers_dirs, source_dir_prefix);
+	  }
 
 	if (s->in_suppr_path && strcmp(s->in_suppr_path, ""))
 	  in_suppression_path = source_dir_prefix + s->in_suppr_path;
-- 
2.39.1


-- 
		Dodji


                 reply	other threads:[~2023-04-26 12:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fs8m7rqk.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).