[packages/libgit2] omit tests requiring online access

draenog draenog at pld-linux.org
Fri Jun 7 21:42:43 CEST 2013


commit c1bf3b60bd0f39f89c9dc371b56d614fb30f669d
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Fri Jun 7 20:40:56 2013 +0100

    omit tests requiring online access

 libgit2-test-online.patch | 18 ++++++++++++++++++
 libgit2.spec              |  5 ++++-
 2 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/libgit2.spec b/libgit2.spec
index 831115f..f5caed3 100644
--- a/libgit2.spec
+++ b/libgit2.spec
@@ -1,6 +1,7 @@
 #
 # Conditional build:
 %bcond_without	tests		# build without tests
+%bcond_with	tests_online	# build with tests reqiuring online access
 
 Summary:	C git library
 Summary(pl.UTF-8):	Biblioteka git dla C
@@ -12,6 +13,7 @@ Group:		Libraries
 Source0:	https://github.com/libgit2/libgit2/archive/v%{version}.tar.gz?/%{name}-version.tgz
 # Source0-md5:	ce6845df0dd084ef2633a69dba64929c
 Patch0:	        %{name}-http-parser.patch
+Patch1:	        %{name}-test-online.patch
 URL:		http://libgit2.github.com/
 BuildRequires:	cmake >= 2.6
 BuildRequires:	http-parser-devel
@@ -49,11 +51,12 @@ Pliki nagłówkowe biblioteki libgit2.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 install -d build
 cd build
-%cmake ..
+%cmake %{?with_tests_online:-DONLINE_TESTS=1} ..
 %{__make}
 
 %{?with_tests:%{__make} test ARGS="-V"}
diff --git a/libgit2-test-online.patch b/libgit2-test-online.patch
new file mode 100644
index 0000000..8154317
--- /dev/null
+++ b/libgit2-test-online.patch
@@ -0,0 +1,18 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 10caa16..714d86c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -359,7 +359,12 @@ IF (BUILD_CLAR)
+ 	ENDIF ()
+ 
+ 	ENABLE_TESTING()
+-	ADD_TEST(libgit2_clar libgit2_clar -ionline)
++        IF (ONLINE_TESTS)
++	    ADD_TEST(libgit2_clar libgit2_clar -ionline)
++        ELSE ()
++	    ADD_TEST(libgit2_clar libgit2_clar -xonline)
++        ENDIF ()
++
+ ENDIF ()
+ 
+ IF (TAGS)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libgit2.git/commitdiff/c1bf3b60bd0f39f89c9dc371b56d614fb30f669d



More information about the pld-cvs-commit mailing list