summaryrefslogtreecommitdiffstats
path: root/atoum.spec
blob: 6d248b18183e8e6e7f0acbdf7ad49cb0104c42d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# remirepo spec file for atoum, from:
#
# Fedora spec file for atoum
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#

# For compatibility with SCL
%undefine __brp_mangle_shebangs

%global gh_commit    35714b3044ccbfea6d9d78a7a7107347ee1b5ce9
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})

Name:           atoum
Version:        3.4.1
Release:        1%{?dist}
Summary:        PHP Unit Testing framework

License:        BSD
URL:            http://atoum.org
Source0:        https://github.com/%{name}/%{name}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz

BuildArch:      noarch

BuildRequires:       php(language) >= 5.6
BuildRequires:       php-hash
BuildRequires:       php-json
BuildRequires:       php-session
BuildRequires:       php-tokenizer
BuildRequires:       php-xml

BuildRequires:       php-mbstring

BuildRequires:       php-cli
BuildRequires:       php-date
BuildRequires:       php-dom
BuildRequires:       php-pcre
BuildRequires:       php-phar
BuildRequires:       php-reflection
BuildRequires:       php-spl

# From composer.json, 	"require": {
#        "php": "^5.6.0 || ^7.0.0 <7.4.0",
#        "ext-hash": "*",
#        "ext-json": "*",
#        "ext-tokenizer": "*",
#        "ext-xml": "*"
Requires:       php(language) >= 5.6
Requires:       php-hash
Requires:       php-json
Requires:       php-tokenizer
Requires:       php-xml
# From composer.json, 	"suggest": {
#        "ext-mbstring": "Provides support for UTF-8 strings"
#        "atoum/stubs": "Provides IDE support (like autocompletion) for atoum",
#        "ext-xdebug": "Provides code coverage report (>= 2.3)"
Requires:       php-mbstring
# From phpcompatinfo report for version 3.2.0
Requires:       php-cli
Requires:       php-date
Requires:       php-dom
Requires:       php-pcre
Requires:       php-phar
Requires:       php-reflection
Requires:       php-spl
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
Suggests:       php-pecl-xdebug
%endif

Provides: php-composer(atoum/atoum) = %{version}

%if %{?runselftest}%{!?runselftest:1}
%global with_tests   0%{!?_without_tests:1}
%else
%global with_tests   0%{?_with_tests:1}
%endif


%description
A simple, modern and intuitive unit testing framework for PHP!

It has been designed from the start with the following ideas in mind :
* Can be implemented rapidly ;
* Simplify test development ;
* Allow for writing reliable, readable, and clear unit tests ;

To accomplish that, it massively uses capabilities provided by PHP 5.3,
to give the developer a whole new way of writing unit tests.
Also, thanks to its fluid interface, it allows for writing unit tests in
a fashion close to natural language.
It also makes it easier to implement stubbing within tests, thanks to
intelligent uses of anonymous functions and closures.
atoum natively, and by default, performs the execution of each unit test
within a separate PHP process, to warrant isolation.
Of course, it can be used seamlessly for continuous integration, and given its
design, it can be made to cope with specific needs extremely easily.
atoum also accomplishes all of this without affecting performance, since it
has been developed to boast a reduced memory footprint while allowing for
hastened test execution.
It can also generate unit test execution reports in the Xunit format,
which makes it compatible with continuous integration tools such as Jenkins.
atoum also generates code coverage reports, in order to make it possible
to supervise unit tests.

Optional dependency:
- php-pecl-xdebug for code coverage reports


%prep
%setup -qn %{name}-%{gh_commit}

rm resources/configurations/.gitignore
rm scripts/git/.tag tests/units/classes/scripts/git/.tag
sed -i bin/%{name} \
    -e "s|__DIR__ . '/../|'%{_datadir}/%{name}/|"

sed -i constants.php \
    -e "s/dev-master/%{version}/"


%build
# Empty build section


%install
# create needed directories
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_bindir}
install -m 0644 -p constants.php %{buildroot}%{_datadir}/%{name}
install -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
cp -pr classes   %{buildroot}%{_datadir}/%{name}
cp -pr resources %{buildroot}%{_datadir}/%{name}
cp -pr scripts   %{buildroot}%{_datadir}/%{name}
cp -pr tests     %{buildroot}%{_datadir}/%{name}


%check
%if %{with_tests}
cd tests/units
echo "date.timezone=UTC" >php.ini
export PHPRC=$(pwd)/php.ini

ret=0
for cmd in php php72 php73 php74; do
  if which $cmd; then
    $cmd runner.php --use-dot-report --max-children-number 4 --directories . || ret=1
  fi
done

if [ $(php -r 'echo PHP_VERSION_ID;') -lt 70400 ]
then
  exit $ret
fi
%else
: Tests skipped
%endif


%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc ABOUT *.md
%doc composer.json
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*


%changelog
* Thu Jan 23 2020 Remi Collet <remi@remirepo.net> - 3.4.1-1
- update to 3.4.1

* Thu Jan  2 2020 Remi Collet <remi@remirepo.net> - 3.4.0-2
- update to 3.4.0
- fix reported version

* Fri Mar 16 2018 Remi Collet <remi@remirepo.net> - 3.3.0-1
- update to 3.3.0
- undefine __brp_mangle_shebangs

* Tue Oct  3 2017 Remi Collet <remi@remirepo.net> - 3.2.0-2
- test build for https://github.com/atoum/atoum/pull/754

* Thu Sep  7 2017 Remi Collet <remi@remirepo.net> - 3.2.0-1
- Update to 3.2.0

* Fri Aug  4 2017 Remi Collet <remi@remirepo.net> - 3.1.1-1
- Update to 3.1.1

* Wed Jul 12 2017 Remi Collet <remi@remirepo.net> - 3.1.0-1
- Update to 3.1.0
- run test suite against SCL if installed

* Wed Feb 22 2017 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
- update to 3.0.0
- raise dependency on PHP 5.6

* Sat Feb 11 2017 Remi Collet <remi@fedoraproject.org> - 2.9.0-1
- update to 2.9.0

* Sat Aug 13 2016 Remi Collet <remi@fedoraproject.org> - 2.8.2-1
- update to 2.8.2

* Sat Jul  2 2016 Remi Collet <remi@fedoraproject.org> - 2.8.1-1
- update to 2.8.1

* Fri Jul  1 2016 Remi Collet <remi@fedoraproject.org> - 2.8.0-1
- update to 2.8.0

* Sat May 21 2016 Remi Collet <remi@fedoraproject.org> - 2.7.0-1
- update to 2.7.0

* Fri Apr  8 2016 Remi Collet <remi@fedoraproject.org> - 2.6.1-1
- update to 2.6.1

* Wed Mar  9 2016 Remi Collet <remi@fedoraproject.org> - 2.6.0-1
- update to 2.6.0

* Thu Jan 28 2016 Remi Collet <remi@fedoraproject.org> - 2.5.2-1
- update to 2.5.2

* Mon Jan 18 2016 Remi Collet <remi@fedoraproject.org> - 2.5.1-1
- update to 2.5.1

* Fri Jan  8 2016 Remi Collet <remi@fedoraproject.org> - 2.5.0-1
- update to 2.5.0

* Mon Dec  7 2015 Remi Collet <remi@fedoraproject.org> - 2.4.1-1
- update to 2.4.1

* Fri Oct 23 2015 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
- update to 2.3.0
- drop patch merged upstream

* Thu Sep 17 2015 Remi Collet <remi@fedoraproject.org> - 2.2.2-1
- update to 2.2.2

* Thu Aug 27 2015 Remi Collet <remi@fedoraproject.org> - 2.2.1-1
- update to 2.2.1

* Sun Aug  2 2015 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
- update to 2.2.0
- XDebug is optional

* Mon May 11 2015 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
- update to 2.1.0
- update source0

* Tue Mar 24 2015 Remi Collet <RPMS@famillecollet.com> - 2.0.1-1
- add backport stuff

* Sun Mar 22 2015 Johan Cwiklinski <johan AT x-tnd DOT be> - 2.0.1-1
- Last upstream release

* Wed Jun 11 2014 Johan Cwiklinski <johan AT x-tnd DOT be> - 0-0.11.gite1f64c2
- Add provides for registered Packagist package

* Mon Jun 09 2014 Johan Cwiklinski <johan AT x-tnd DOT be> - 0-0.10.gite1f64c2
- Last upstream commit

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.9.git35a880e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat May 10 2014 Johan Cwiklinski <johan AT x-tnd DOT be> - 0.0.8.git35a880e
- Last upstream commit

* Sun Dec 08 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 0.0.7.gita68f365
- Last upstream commit

* Wed Aug 07 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 0.0.6.git587a130
- Last upstream commit

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.5.gita0452f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sun Jun 23 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 0.0.4.gita0452f6
- Last upstream commit

* Fri May 10 2013 Johan Cwiklinski <johan AT x-tnd DOt be> - 0.0.3.git3118d58
- Last upstream commit

* Sun Feb 10 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 0.0.2.gitdbfb82f
- Last upstream commit
- Rename package from php-atoum to atoum
- add missing requires
- change path to %%{_datadir}/%%{name}
- add tests and relevant BR

* Sun Jan 13 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 0-0.2.git724d3ee
- Use %%{real_name} instead of %%{name} in path

* Sun Jan 13 2013 Johan Cwiklinski <johan AT x-tnd DOT be> - 0-0.1.git724d3ee
- Initial Release