[php-SymfonyCmfRouting] Only run tests with "--with tests" option
Shawn Iwinski
siwinski at fedoraproject.org
Wed May 8 16:26:36 UTC 2013
commit dd009c16070ca93b71dcf285482c2713d3ce173e
Author: Shawn Iwinski <siwinski at redhat.com>
Date: Wed May 8 12:26:21 2013 -0400
Only run tests with "--with tests" option
php-SymfonyCmfRouting.spec | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/php-SymfonyCmfRouting.spec b/php-SymfonyCmfRouting.spec
index cf878b2..70bdcc2 100644
--- a/php-SymfonyCmfRouting.spec
+++ b/php-SymfonyCmfRouting.spec
@@ -9,6 +9,10 @@
%global symfony_min_ver 2.1.0
%global symfony_max_ver 2.3.0
+# Tests are only run with rpmbuild --with tests
+# Need to investigate errors
+%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
+
Name: php-SymfonyCmfRouting
Version: %{github_version}
Release: 1%{?dist}
@@ -20,6 +24,7 @@ URL: http://symfony.com/doc/master/cmf/components/routing.html
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
+%if %{with_tests}
# For tests
BuildRequires: php-common >= %{php_min_ver}
BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
@@ -33,6 +38,7 @@ BuildRequires: php-pear(pear.symfony.com/HttpKernel) < %{symfony_max_ver}
BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-spl
+%endif
Requires: php-common >= %{php_min_ver}
Requires: php-pear(pear.symfony.com/Routing) >= %{symfony_min_ver}
@@ -97,9 +103,13 @@ cp -rp * %{buildroot}%{_datadir}/php/Symfony/Cmf/Component/Routing/
%check
+%if %{with_tests}
%{_bindir}/phpunit \
-d include_path="%{buildroot}%{_datadir}/php:%{pear_phpdir}" \
-c phpunit.xml.dist
+%else
+: Tests skipped, missing '--with tests' option
+%endif
%files
@@ -110,6 +120,7 @@ cp -rp * %{buildroot}%{_datadir}/php/Symfony/Cmf/Component/Routing/
%exclude %{_datadir}/php/Symfony/Cmf/Component/Routing/LICENSE
%exclude %{_datadir}/php/Symfony/Cmf/Component/Routing/README.md
%exclude %{_datadir}/php/Symfony/Cmf/Component/Routing/composer.json
+%exclude %{_datadir}/php/Symfony/Cmf/Component/Routing/phpunit.xml.dist
%exclude %{_datadir}/php/Symfony/Cmf/Component/Routing/Test
%exclude %{_datadir}/php/Symfony/Cmf/Component/Routing/Tests
@@ -118,6 +129,8 @@ cp -rp * %{buildroot}%{_datadir}/php/Symfony/Cmf/Component/Routing/
* Wed May 08 2013 Shawn Iwinski <shawn.iwinski at gmail.com> 1.0.1-1
- Updated to version 1.0.1
- Added php-pear(pear.symfony.com/HttpFoundation) require
+- Only run tests with "--with tests" option
+- Remove phpunit.xml.dist from packaging since tests themselves are not included
* Sat Mar 09 2013 Shawn Iwinski <shawn.iwinski at gmail.com> 1.0.0-0.3.alpha4.20130306git4706313
- Added additional commits (snapshot) beyond tagged version 1.0.0-alpha4 which
More information about the scm-commits
mailing list