From 140e91d2db981d796f0af330c382af3ef5899315 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Tue, 26 Apr 2016 11:57:14 +0200
Subject: [PATCH] tests: fix test_leading_slash for lt-bsdtar wrapper
---
configure.ac | 3 +++
tar/test/test_leading_slash.c | 14 +++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 851007d..750f561 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,6 +152,9 @@ esac
AM_CONDITIONAL([BUILD_BSDTAR], [ test "$build_bsdtar" = yes ])
AM_CONDITIONAL([STATIC_BSDTAR], [ test "$static_bsdtar" = yes ])
+if test "$static_bsdtar" = yes; then
+ AC_DEFINE([STATIC_BSDTAR], [1], [bsdtar linked statically])
+fi
#
# Options for building bsdcat.
diff --git a/tar/test/test_leading_slash.c b/tar/test/test_leading_slash.c
index 52646d0..0122e00 100644
--- a/tar/test/test_leading_slash.c
+++ b/tar/test/test_leading_slash.c
@@ -25,6 +25,14 @@
#include "test.h"
__FBSDID("$FreeBSD$");
+#ifdef _WIN32
+# define BSDTAR_CMD "bsdtar.exe"
+#elif defined(STATIC_BSDTAR)
+# define BSDTAR_CMD "bsdtar"
+#else
+# define BSDTAR_CMD "lt-bsdtar"
+#endif
+
DEFINE_TEST(test_leading_slash)
{
const char *reffile = "test_leading_slash.tar";
@@ -36,10 +44,6 @@ DEFINE_TEST(test_leading_slash)
assertTextFileContents("foo\x0a", "foo/hardlink");
assertIsHardlink("foo/file", "foo/hardlink");
assertEmptyFile("test.out");
-#ifdef _WIN32
- assertTextFileContents("bsdtar.exe: Removing leading '/' from member names\x0a", "test.err");
-#else
- assertTextFileContents("bsdtar: Removing leading '/' from member names\x0a", "test.err");
-#endif
+ assertTextFileContents(BSDTAR_CMD ": Removing leading '/' from member names\x0a", "test.err");
}
--
2.5.5