[applied] test-abidiff-exit: Do not use debuginfo dir when its empty

Message ID 87il7ogi2q.fsf@redhat.com
State New
Headers
Series [applied] test-abidiff-exit: Do not use debuginfo dir when its empty |

Commit Message

Dodji Seketeli Oct. 3, 2023, 9:40 a.m. UTC
  From 528ed9fe557ec73e11a7d5c0c9a396cc0c972b1d Mon Sep 17 00:00:00 2001
From: Dodji Seketeli <dodji@redhat.com>
Date: Tue, 26 Sep 2023 09:35:53 +0200
Subject: 

If the debug info dir is empty in the input test specifier, the abidiff
command should not add any --debug-info-dir{1,2} option.  Fixed thus.

	* tests/test-abidiff-exit.cc (main): If debug info dir is empty in
	the input test specifier, do not try to use it in the abidiff
	command.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 tests/test-abidiff-exit.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc
index a6d54e5c..e539242a 100644
--- a/tests/test-abidiff-exit.cc
+++ b/tests/test-abidiff-exit.cc
@@ -1092,8 +1092,12 @@  main()
 	bool is_ok = true;
 	in_elfv0_path = source_dir_prefix + s->in_elfv0_path;
 	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;
+	in_elfv0_debug_dir.clear();
+	in_elfv1_debug_dir.clear();
+	if (s->in_elfv0_debug_dir && strcmp(s->in_elfv0_debug_dir, ""))
+	  in_elfv0_debug_dir = source_dir_prefix + s->in_elfv0_debug_dir;
+	if (s->in_elfv1_debug_dir && strcmp(s->in_elfv1_debug_dir, ""))
+	  in_elfv1_debug_dir = source_dir_prefix + s->in_elfv1_debug_dir;
 	in_elfv0_headers_dirs.clear();
 	in_elfv1_headers_dirs.clear();
 	in_elfv0_added_bins_dir.clear();