[packages/mirall] securing and isolating tests

glen glen at pld-linux.org
Sun Feb 8 00:21:02 CET 2015


commit 91f71456e45fecc6776640e891ae4f57e1f7bd64
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Feb 8 01:20:34 2015 +0200

    securing and isolating tests

 mirall.spec | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/mirall.spec b/mirall.spec
index 029517b..17847c0 100644
--- a/mirall.spec
+++ b/mirall.spec
@@ -70,6 +70,9 @@ Header files for %{name}
 %prep
 %setup -q
 
+# Keep tests in build dir
+%{__sed} -i -e "s#\"/tmp#\"$(pwd)#g" test/test*.h
+
 %if %{without nautilus}
 %{__sed} -i -e "s/add_subdirectory(nautilus)//" shell_integration/CMakeLists.txt
 %endif
@@ -90,7 +93,13 @@ cd build
 
 %{__make}
 %{__make} doc-man
-%{?with_tests:%{__make} test}
+
+%if %{with tests}
+# 1 test needs an existing ${HOME}/.config directory
+install -d .config
+%{__make} test \
+	HOME=$(pwd)
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mirall.git/commitdiff/f7cb732f3656781e6c48be91d9ecaefe2c4c37c1



More information about the pld-cvs-commit mailing list