From f5af3b4fcc37d251d3efb6150fadb5258d6e2e74 Mon Sep 17 00:00:00 2001
From: Elias Pipping <pipping@exherbo.org>
Date: Sun, 14 Oct 2012 21:30:26 +0200
Subject: [PATCH] Fix out-of-source tests

---
 tests/Makefile.am          | 1 +
 tests/pkcs12-decode/pkcs12 | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index b6c14be..d8307f7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -108,6 +108,7 @@ TESTS_ENVIRONMENT =						\
 	PKCS12FILE_2=$(srcdir)/pkcs12-decode/pkcs12_2certs.p12	\
 	PKCS12PASSWORD_2=""					\
 	EXEEXT=$(EXEEXT)					\
+	top_builddir="$(top_builddir)"				\
 	srcdir="$(srcdir)"
 
 if WANT_TEST_SUITE
diff --git a/tests/pkcs12-decode/pkcs12 b/tests/pkcs12-decode/pkcs12
index a2ee20b..ca58827 100755
--- a/tests/pkcs12-decode/pkcs12
+++ b/tests/pkcs12-decode/pkcs12
@@ -22,7 +22,8 @@
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 srcdir=${srcdir:-.}
-CERTTOOL=${CERTTOOL:-../../src/certtool}
+top_builddir=${top_builddir:-../..}
+CERTTOOL=${CERTTOOL:-${top_builddir}/src/certtool}
 DEBUG=""
 
 if test "x$1" != "x";then
@@ -49,7 +50,7 @@ for p12 in 'client.p12 foobar' noclient.p12 unclient.p12 pkcs12_2certs.p12; do
 done
 
 file=test-null.p12
-$CERTTOOL --p12-info --inder --null-password --infile $file >/dev/null 2>&1
+$CERTTOOL --p12-info --inder --null-password --infile $srcdir/$file >/dev/null 2>&1
 rc=$?
 if test $rc != 0; then
 	echo "PKCS12 FATAL $file"
-- 
1.7.12.3

