Commit | Line | Data |
---|---|---|
233e7676 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> | |
ac257f12 | 3 | ;;; Copyright © 2014 David Thompson <davet@gnu.org> |
4ac696c6 | 4 | ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> |
ac257f12 RW |
5 | ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org> |
6 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> | |
7 | ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com> | |
8 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> | |
28edab7a | 9 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
4df24531 | 10 | ;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il> |
ac257f12 RW |
11 | ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> |
12 | ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> | |
13 | ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org> | |
dd6e70f9 | 14 | ;;; Copyright © 2016 Roel Janssen <roel@gnu.org> |
762b5a89 RW |
15 | ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com> |
16 | ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com> | |
5f6aba6b | 17 | ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org> |
ac257f12 | 18 | ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> |
42678deb | 19 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
ac257f12 RW |
20 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
21 | ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> | |
b19a960f | 22 | ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net> |
ac257f12 | 23 | ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com> |
10511c41 | 24 | ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com> |
8e91cecd | 25 | ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net> |
47956fa0 | 26 | ;;; Copyright © 2017 ng0 <ng0@n0.is> |
7aa37aa0 | 27 | ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net> |
3293fad2 | 28 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com> |
5e61de24 | 29 | ;;; Copyright © 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org> |
9268a3c4 | 30 | ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com> |
e57fb285 | 31 | ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> |
968e86bd | 32 | ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com> |
4edefc50 | 33 | ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org> |
135c1e0e | 34 | ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re> |
8b27771b | 35 | ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com> |
d8989c23 | 36 | ;;; |
233e7676 | 37 | ;;; This file is part of GNU Guix. |
d8989c23 | 38 | ;;; |
233e7676 | 39 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
d8989c23 NK |
40 | ;;; under the terms of the GNU General Public License as published by |
41 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
42 | ;;; your option) any later version. | |
43 | ;;; | |
233e7676 | 44 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
d8989c23 NK |
45 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
46 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
47 | ;;; GNU General Public License for more details. | |
48 | ;;; | |
49 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 50 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
d8989c23 | 51 | |
1ffa7090 | 52 | (define-module (gnu packages check) |
59a43334 | 53 | #:use-module (gnu packages) |
f767bcca | 54 | #:use-module (gnu packages autotools) |
bd9d3db6 | 55 | #:use-module (gnu packages base) |
ac257f12 RW |
56 | #:use-module (gnu packages bash) |
57 | #:use-module (gnu packages compression) | |
bd9d3db6 | 58 | #:use-module (gnu packages linux) |
40899635 | 59 | #:use-module (gnu packages llvm) |
bd9d3db6 RW |
60 | #:use-module (gnu packages glib) |
61 | #:use-module (gnu packages gnome) | |
8d54ace7 | 62 | #:use-module (gnu packages golang) |
bd9d3db6 | 63 | #:use-module (gnu packages gtk) |
85b28320 | 64 | #:use-module (gnu packages perl) |
bd9d3db6 | 65 | #:use-module (gnu packages pkg-config) |
5f6aba6b | 66 | #:use-module (gnu packages python) |
ac257f12 | 67 | #:use-module (gnu packages python-web) |
44d10b1f | 68 | #:use-module (gnu packages python-xyz) |
33dc54b0 | 69 | #:use-module (gnu packages time) |
c5d39909 | 70 | #:use-module (gnu packages xml) |
5be2931c | 71 | #:use-module (guix utils) |
ac257f12 | 72 | #:use-module ((guix licenses) #:prefix license:) |
d8989c23 NK |
73 | #:use-module (guix packages) |
74 | #:use-module (guix download) | |
3bfc99c7 | 75 | #:use-module (guix git-download) |
2259442b | 76 | #:use-module (guix build-system cmake) |
3bfc99c7 | 77 | #:use-module (guix build-system gnu) |
38ea84d8 | 78 | #:use-module (guix build-system go) |
cd669fde | 79 | #:use-module (guix build-system python) |
3bfc99c7 | 80 | #:use-module (guix build-system trivial)) |
d8989c23 NK |
81 | |
82 | (define-public check | |
83 | (package | |
84 | (name "check") | |
cf99239c | 85 | (version "0.14.0") |
d8989c23 NK |
86 | (source |
87 | (origin | |
88 | (method url-fetch) | |
dfdf8d74 MB |
89 | (uri (string-append "https://github.com/libcheck/check/releases/download/" |
90 | version "/check-" version ".tar.gz")) | |
d8989c23 NK |
91 | (sha256 |
92 | (base32 | |
cf99239c | 93 | "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx")))) |
d8989c23 | 94 | (build-system gnu-build-system) |
f4d9339c | 95 | (home-page "https://libcheck.github.io/check/") |
35b9e423 | 96 | (synopsis "Unit test framework for C") |
d8989c23 | 97 | (description |
35b9e423 | 98 | "Check is a unit testing framework for C. It features a simple |
d8989c23 NK |
99 | interface for defining unit tests, putting little in the way of the |
100 | developer. Tests are run in a separate address space, so Check can | |
101 | catch both assertion failures and code errors that cause segmentation | |
35b9e423 | 102 | faults or other signals. The output from unit tests can be used within |
d8989c23 | 103 | source code editors and IDEs.") |
ac257f12 | 104 | (license license:lgpl2.1+))) |
34352662 | 105 | |
2a84b550 MB |
106 | ;; Some packages require this older version. Removed once no longer needed. |
107 | (define-public check-0.12 | |
108 | (package/inherit | |
109 | check | |
110 | (version "0.12.0") | |
111 | (source (origin | |
112 | (method url-fetch) | |
113 | (uri (string-append "https://github.com/libcheck/check/releases" | |
114 | "/download/" version "/check-" version ".tar.gz")) | |
115 | (sha256 | |
116 | (base32 | |
117 | "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6")))))) | |
118 | ||
f767bcca RW |
119 | (define-public cunit |
120 | (package | |
121 | (name "cunit") | |
122 | (version "2.1-3") | |
123 | (source | |
124 | (origin | |
125 | (method url-fetch) | |
126 | (uri (string-append "mirror://sourceforge/cunit/CUnit/" | |
127 | version "/CUnit-" version ".tar.bz2")) | |
128 | (sha256 | |
129 | (base32 | |
130 | "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm")))) | |
131 | (build-system gnu-build-system) | |
132 | (arguments '(#:phases | |
911c42de | 133 | (modify-phases %standard-phases |
7aa37aa0 RW |
134 | ;; XXX: The "bootstrap" phase detects the "bootstrap" |
135 | ;; script, but fails to execute it, so we bootstrap | |
136 | ;; manually. | |
137 | (replace 'bootstrap | |
138 | (lambda _ (invoke "autoreconf" "-vfi")))))) | |
f767bcca RW |
139 | (native-inputs |
140 | `(("automake" ,automake) | |
141 | ("autoconf" ,autoconf) | |
142 | ("libtool" ,libtool))) | |
143 | (home-page "http://cunit.sourceforge.net/") | |
144 | (synopsis "Automated testing framework for C") | |
145 | (description | |
146 | "CUnit is a lightweight system for writing, administering, and running | |
147 | unit tests in C. It provides C programmers with basic testing functionality | |
148 | with a flexible variety of user interfaces.") | |
ac257f12 | 149 | (license license:gpl2+))) |
f767bcca | 150 | |
34352662 JD |
151 | (define-public cppunit |
152 | (package | |
153 | (name "cppunit") | |
7f81f8bc | 154 | (version "1.14.0") |
34352662 JD |
155 | (source (origin |
156 | (method url-fetch) | |
34a6f4dc EF |
157 | (uri (string-append "http://dev-www.libreoffice.org/src/" |
158 | name "-" version ".tar.gz")) | |
34352662 JD |
159 | (sha256 |
160 | (base32 | |
7f81f8bc | 161 | "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix")))) |
28edab7a AE |
162 | ;; Explicitly link with libdl. This is expected to be done by packages |
163 | ;; relying on cppunit for their tests. However, not all of them do. | |
164 | ;; If we added the linker flag to such packages, we would pollute all | |
165 | ;; binaries, not only those used for testing. | |
166 | (arguments | |
167 | `(#:make-flags '("LDFLAGS=-ldl"))) | |
34352662 | 168 | (build-system gnu-build-system) |
34a6f4dc | 169 | (home-page "https://wiki.freedesktop.org/www/Software/cppunit/") |
34352662 JD |
170 | (synopsis "Unit testing framework for C++") |
171 | (description "CppUnit is the C++ port of the famous JUnit framework for | |
72b030c0 | 172 | unit testing. Test output is in XML for automatic testing and GUI based for |
34352662 | 173 | supervised tests.") |
ac257f12 | 174 | (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball |
3bfc99c7 | 175 | |
56e72c00 FT |
176 | ;; When dependent packages upgraded to use newer version of catch, this one should |
177 | ;; be removed. | |
3bfc99c7 EB |
178 | (define-public catch-framework |
179 | (package | |
180 | (name "catch") | |
a232ce42 | 181 | (version "1.3.5") ;Sub-minor is the build number |
3bfc99c7 EB |
182 | (source (origin |
183 | (method git-fetch) | |
184 | (uri (git-reference | |
185 | (url "https://github.com/philsquared/Catch") | |
14a17ef6 | 186 | ;; Semi-arbitrary. |
a232ce42 | 187 | (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907"))) |
3bfc99c7 EB |
188 | (file-name (string-append name "-" version)) |
189 | (sha256 | |
190 | (base32 | |
a232ce42 | 191 | "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564")))) |
3bfc99c7 EB |
192 | (build-system trivial-build-system) |
193 | (arguments | |
194 | `(#:modules ((guix build utils)) | |
195 | #:builder (begin | |
196 | (use-modules (guix build utils)) | |
197 | (let* ((source (assoc-ref %build-inputs "source")) | |
198 | (output (assoc-ref %outputs "out")) | |
199 | (incdir (string-append output "/include")) | |
200 | (docdir (string-append output "/share/doc/catch-" | |
201 | ,version))) | |
e3cfef22 MW |
202 | (for-each mkdir-p (list incdir docdir)) |
203 | (install-file (string-append source | |
204 | "/single_include/catch.hpp") | |
205 | incdir) | |
206 | (copy-recursively (string-append source "/docs") | |
207 | docdir) | |
208 | #t)))) | |
3bfc99c7 EB |
209 | (home-page "http://catch-lib.net/") |
210 | (synopsis "Automated test framework for C++ and Objective-C") | |
211 | (description | |
212 | "Catch stands for C++ Automated Test Cases in Headers and is a | |
213 | multi-paradigm automated test framework for C++ and Objective-C.") | |
ac257f12 | 214 | (license license:boost1.0))) |
2259442b | 215 | |
8aa59a54 | 216 | (define-public catch-framework2-1 |
56e72c00 FT |
217 | (package |
218 | (name "catch2") | |
219 | (version "1.12.2") | |
220 | (home-page "https://github.com/catchorg/Catch2") | |
221 | (source (origin | |
28bcf809 EF |
222 | (method git-fetch) |
223 | (uri (git-reference | |
224 | (url "https://github.com/catchorg/Catch2") | |
225 | (commit (string-append "v" version)))) | |
226 | (file-name (git-file-name name version)) | |
56e72c00 FT |
227 | (sha256 |
228 | (base32 | |
28bcf809 | 229 | "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23")))) |
56e72c00 FT |
230 | (build-system cmake-build-system) |
231 | (synopsis "Automated test framework for C++ and Objective-C") | |
232 | (description "Catch2 stands for C++ Automated Test Cases in Headers and is | |
233 | a multi-paradigm automated test framework for C++ and Objective-C.") | |
234 | (license license:boost1.0))) | |
8aa59a54 RW |
235 | |
236 | (define-public catch-framework2 | |
237 | (package | |
238 | (name "catch2") | |
239 | (version "2.1.2") | |
240 | (home-page "https://github.com/catchorg/Catch2") | |
241 | (source (origin | |
242 | (method git-fetch) | |
243 | (uri (git-reference | |
244 | (url "https://github.com/catchorg/Catch2") | |
245 | (commit (string-append "v" version)))) | |
246 | (file-name (git-file-name name version)) | |
247 | (sha256 | |
248 | (base32 | |
249 | "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233")))) | |
250 | (build-system cmake-build-system) | |
251 | (inputs | |
252 | `(("python" ,python-wrapper))) | |
253 | (synopsis "Automated test framework for C++ and Objective-C") | |
254 | (description "Catch2 stands for C++ Automated Test Cases in Headers and is | |
255 | a multi-paradigm automated test framework for C++ and Objective-C.") | |
256 | (license license:boost1.0))) | |
56e72c00 | 257 | |
cd669fde KK |
258 | (define-public cmdtest |
259 | (package | |
260 | (name "cmdtest") | |
d4f5e68e | 261 | (version "0.32") |
cd669fde KK |
262 | (source (origin |
263 | (method url-fetch) | |
264 | (uri (string-append "http://git.liw.fi/cmdtest/snapshot/" | |
265 | name "-" version ".tar.gz")) | |
266 | (sha256 | |
267 | (base32 | |
d4f5e68e | 268 | "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5")))) |
cd669fde KK |
269 | (build-system python-build-system) |
270 | (arguments | |
271 | `(#:python ,python-2 | |
272 | #:phases | |
273 | (modify-phases %standard-phases | |
274 | ;; check phase needs to be run before the build phase. If not, the | |
275 | ;; coverage test runner looks for tests for the built source files, | |
276 | ;; and fails. | |
277 | (delete 'check) | |
278 | (add-before 'build 'check | |
279 | (lambda _ | |
280 | (substitute* "yarn" | |
281 | (("/bin/sh") (which "sh"))) | |
282 | ;; yarn uses python2-ttystatus to print messages. | |
283 | ;; python2-ttystatus requires /dev/tty which is not present in | |
284 | ;; the build environment. Hence assuming-failure test fails. | |
285 | (delete-file "yarn.tests/assuming-failure.script") | |
286 | (delete-file "yarn.tests/assuming-failure.stdout") | |
29594404 | 287 | (invoke "python" "setup.py" "check")))))) |
cd669fde KK |
288 | (native-inputs |
289 | `(("python2-coverage-test-runner" ,python2-coverage-test-runner))) | |
290 | (propagated-inputs | |
291 | `(("python2-cliapp" ,python2-cliapp) | |
292 | ("python2-markdown" ,python2-markdown) | |
293 | ("python2-ttystatus" ,python2-ttystatus))) | |
294 | (home-page "https://liw.fi/cmdtest/") | |
295 | (synopsis "Black box Unix program tester") | |
296 | (description | |
297 | "@code{cmdtest} black box tests Unix command line tools. Roughly, it is | |
298 | given a command line and input files, and the expected output, and it verifies | |
299 | that the command line produces the expected output. If not, it reports a | |
300 | problem, and shows the differences.") | |
ac257f12 | 301 | (license license:gpl3+))) |
cd669fde | 302 | |
2259442b EF |
303 | (define-public cmocka |
304 | (package | |
305 | (name "cmocka") | |
1b6c5e80 | 306 | (version "1.1.5") |
2259442b EF |
307 | (source (origin |
308 | (method url-fetch) | |
5be2931c EF |
309 | (uri (string-append "https://cmocka.org/files/" |
310 | (version-major+minor version) "/cmocka-" | |
2259442b EF |
311 | version ".tar.xz")) |
312 | (sha256 | |
313 | (base32 | |
1b6c5e80 | 314 | "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h")))) |
2259442b EF |
315 | (build-system cmake-build-system) |
316 | (arguments | |
0c048c11 | 317 | `(#:tests? #f)) ; no test target |
2259442b EF |
318 | (home-page "https://cmocka.org/") |
319 | (synopsis "Unit testing framework for C") | |
320 | (description "Cmocka is a unit testing framework for C with support for | |
321 | mock objects. It only requires the standard C library, and works with | |
322 | different compilers. Cmocka supports several different message output formats | |
323 | like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output | |
324 | format.") | |
ac257f12 | 325 | (license license:asl2.0))) |
dd6e70f9 RJ |
326 | |
327 | (define-public cppcheck | |
328 | (package | |
329 | (name "cppcheck") | |
6925c855 | 330 | (version "1.90") |
dd6e70f9 | 331 | (source (origin |
fa44d3a6 EF |
332 | (method git-fetch) |
333 | (uri (git-reference | |
334 | (url "https://github.com/danmar/cppcheck") | |
335 | (commit version))) | |
336 | (file-name (git-file-name name version)) | |
dd6e70f9 | 337 | (sha256 |
6925c855 | 338 | (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h")))) |
dd6e70f9 | 339 | (build-system cmake-build-system) |
4241cb9c EF |
340 | (arguments |
341 | '(#:configure-flags '("-DBUILD_TESTS=ON"))) | |
dd6e70f9 RJ |
342 | (home-page "http://cppcheck.sourceforge.net") |
343 | (synopsis "Static C/C++ code analyzer") | |
344 | (description "Cppcheck is a static code analyzer for C and C++. Unlike | |
345 | C/C++ compilers and many other analysis tools it does not detect syntax errors | |
346 | in the code. Cppcheck primarily detects the types of bugs that the compilers | |
347 | normally do not detect. The goal is to detect only real errors in the code | |
348 | (i.e. have zero false positives).") | |
ac257f12 | 349 | (license license:gpl3+))) |
5f6aba6b | 350 | |
8e91cecd KK |
351 | (define-public cxxtest |
352 | (package | |
353 | (name "cxxtest") | |
354 | (version "4.4") | |
355 | (source (origin | |
356 | (method url-fetch) | |
357 | (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/" | |
358 | version "/cxxtest-" version ".tar.gz")) | |
359 | (sha256 | |
360 | (base32 | |
361 | "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w")))) | |
362 | (build-system python-build-system) | |
363 | (arguments | |
364 | '(#:phases | |
365 | (modify-phases %standard-phases | |
366 | (add-after 'unpack 'chdir-to-source | |
367 | (lambda _ | |
368 | (chdir "python") | |
369 | #t)) | |
370 | (add-after 'install 'install-headers | |
371 | (lambda* (#:key outputs #:allow-other-keys) | |
372 | (let* ((out (assoc-ref outputs "out")) | |
373 | (include-dir (string-append out "/include/cxxtest"))) | |
374 | (for-each (lambda (header-file) | |
375 | (install-file header-file include-dir)) | |
376 | (find-files "../cxxtest")) | |
377 | #t))) | |
378 | (add-after 'install 'install-doc | |
379 | (lambda* (#:key outputs #:allow-other-keys) | |
380 | (let* ((out (assoc-ref outputs "out")) | |
381 | (doc-dir (string-append out "/share/doc/cxxtest"))) | |
382 | (install-file "../README" doc-dir) | |
383 | (install-file "../doc/guide.txt" doc-dir) | |
384 | (copy-recursively "../sample" (string-append doc-dir "/sample")) | |
385 | #t)))))) | |
386 | (propagated-inputs | |
387 | `(("python-ply" ,python-ply))) | |
388 | (home-page "https://cxxtest.com/") | |
389 | (synopsis "Unit testing framework for C++") | |
390 | (description "CxxTest is a unit testing framework for C++ that is similar | |
391 | in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling | |
392 | a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI) | |
393 | and it supports a very flexible form of test discovery.") | |
394 | (license license:lgpl3+))) | |
395 | ||
e14d8dcf MB |
396 | (define-public doctest |
397 | (package | |
398 | (name "doctest") | |
aa0bcb6c | 399 | (version "2.3.7") |
e14d8dcf MB |
400 | (home-page "https://github.com/onqtam/doctest") |
401 | (source (origin | |
402 | (method git-fetch) | |
403 | (uri (git-reference (url home-page) (commit version))) | |
404 | (file-name (git-file-name name version)) | |
405 | (sha256 | |
406 | (base32 | |
aa0bcb6c | 407 | "134lx7pjnglrl4wdmyr9dz3rjb6d4ir6rvapg00gp52n44dbhnrq")))) |
e14d8dcf MB |
408 | (build-system cmake-build-system) |
409 | (synopsis "C++ test framework") | |
410 | (description | |
411 | "doctest is a single-header testing framework for C++11 and later. It | |
412 | has been designed to be fast, light and unintrusive.") | |
413 | (license license:expat))) | |
414 | ||
38ea84d8 | 415 | (define-public go-gopkg.in-check.v1 |
19ef857c LF |
416 | (let ((commit "788fd78401277ebd861206a03c884797c6ec5541") |
417 | (revision "1")) | |
38ea84d8 CB |
418 | (package |
419 | (name "go-gopkg.in-check.v1") | |
420 | (version (git-version "0.0.0" revision commit)) | |
421 | (source (origin | |
422 | (method git-fetch) | |
423 | (uri (git-reference | |
424 | (url "https://github.com/go-check/check.git") | |
425 | (commit commit))) | |
426 | (file-name (git-file-name name version)) | |
427 | (sha256 | |
428 | (base32 | |
19ef857c | 429 | "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a")))) |
38ea84d8 CB |
430 | (build-system go-build-system) |
431 | (arguments | |
432 | '(#:import-path "gopkg.in/check.v1")) | |
19ef857c LF |
433 | (propagated-inputs |
434 | `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty))) | |
38ea84d8 CB |
435 | (synopsis "Rich testing extension for Go's testing package") |
436 | (description | |
437 | "@code{check} is a rich testing extension for Go's testing package.") | |
438 | (home-page "https://github.com/go-check/check") | |
439 | (license license:bsd-2)))) | |
440 | ||
bee30125 CB |
441 | (define-public go-github.com-smartystreets-gunit |
442 | (package | |
443 | (name "go-github.com-smartystreets-gunit") | |
444 | (version "1.0.0") | |
445 | (source (origin | |
446 | (method git-fetch) | |
447 | (uri (git-reference | |
448 | (url "https://github.com/smartystreets/gunit") | |
449 | (commit version))) | |
450 | (file-name (git-file-name name version)) | |
451 | (sha256 | |
452 | (base32 | |
453 | "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z")))) | |
454 | (build-system go-build-system) | |
455 | (arguments | |
456 | '(;; TODO: This package depends on go-github.com-smartystreets-assertions | |
457 | ;; for running the tests, but go-github.com-smartystreets-assertions | |
458 | ;; depends on this package, so break this loop by not running the tests | |
459 | ;; for this package. | |
460 | #:tests? #f | |
461 | #:import-path "github.com/smartystreets/gunit")) | |
462 | (synopsis "Testing tool for Go, in the style of xUnit") | |
463 | (description | |
464 | "@code{gunit} allows the test author to use a struct as the scope for a | |
465 | group of related test cases, in the style of xUnit fixtures. This makes | |
466 | extraction of setup/teardown behavior (as well as invoking the system under | |
467 | test) much simpler.") | |
468 | (home-page "https://github.com/smartystreets/gunit") | |
469 | (license license:expat))) | |
470 | ||
7952804c CB |
471 | (define-public go-github.com-smartystreets-assertions |
472 | (package | |
473 | (name "go-github.com-smartystreets-assertions") | |
474 | (version "1.8.1") | |
475 | (source (origin | |
476 | (method git-fetch) | |
477 | (uri (git-reference | |
478 | (url "https://github.com/smartystreets/assertions") | |
479 | (commit version))) | |
480 | (file-name (git-file-name name version)) | |
481 | (sha256 | |
482 | (base32 | |
483 | "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9")))) | |
484 | (build-system go-build-system) | |
485 | (arguments | |
486 | '(#:import-path "github.com/smartystreets/assertions")) | |
487 | (native-inputs | |
488 | `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit))) | |
489 | (synopsis "Assertions for testing with Go") | |
490 | (description | |
7fef0800 | 491 | "The @code{assertions} package provides convenient assertion functions |
7952804c CB |
492 | for writing tests in Go.") |
493 | (home-page "https://github.com/smartystreets/assertions") | |
494 | (license license:expat))) | |
495 | ||
8d54ace7 CB |
496 | (define-public go-github.com-smartystreets-goconvey |
497 | (package | |
498 | (name "go-github.com-smartystreets-goconvey") | |
499 | (version "1.6.3") | |
500 | (source (origin | |
501 | (method git-fetch) | |
502 | (uri (git-reference | |
503 | (url "https://github.com/smartystreets/goconvey") | |
504 | (commit version))) | |
505 | (file-name (git-file-name name version)) | |
506 | (sha256 | |
507 | (base32 | |
508 | "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh")))) | |
509 | (build-system go-build-system) | |
510 | (arguments | |
511 | '(#:import-path "github.com/smartystreets/goconvey")) | |
512 | (propagated-inputs | |
513 | `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls) | |
514 | ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions))) | |
515 | (synopsis "Go testing tool with both a web and terminal user interface") | |
516 | (description | |
517 | "GoConvey is a testing tool for Go. It integrates with go test, can show | |
518 | test coverage and has a web user interface that will refresh automatically.") | |
519 | (home-page "https://github.com/smartystreets/goconvey") | |
520 | (license license:expat))) | |
521 | ||
5f6aba6b LG |
522 | (define-public googletest |
523 | (package | |
524 | (name "googletest") | |
3293fad2 | 525 | (version "1.10.0") |
5f6aba6b LG |
526 | (source |
527 | (origin | |
d5640c58 EF |
528 | (method git-fetch) |
529 | (uri (git-reference | |
3b39f09f TGR |
530 | (url "https://github.com/google/googletest.git") |
531 | (commit (string-append "release-" version)))) | |
d5640c58 | 532 | (file-name (git-file-name name version)) |
5f6aba6b | 533 | (sha256 |
3293fad2 | 534 | (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz")))) |
84e36a56 | 535 | (build-system cmake-build-system) |
2d5bf32b MR |
536 | (arguments |
537 | `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON"))) | |
5f6aba6b | 538 | (native-inputs |
183fd207 | 539 | `(("python" ,python-wrapper))) |
5f6aba6b LG |
540 | (home-page "https://github.com/google/googletest/") |
541 | (synopsis "Test discovery and XUnit test framework") | |
542 | (description "Google Test features an XUnit test framework, automated test | |
543 | discovery, death tests, assertions, parameterized tests and XML test report | |
544 | generation.") | |
ac257f12 | 545 | (license license:bsd-3))) |
c61794cf | 546 | |
3293fad2 MB |
547 | (define-public googletest-1.8 |
548 | (package/inherit | |
549 | googletest | |
550 | (version "1.8.1") | |
551 | (source (origin | |
552 | (method git-fetch) | |
553 | (uri (git-reference | |
554 | (url "https://github.com/google/googletest.git") | |
555 | (commit (string-append "release-" version)))) | |
556 | (file-name (git-file-name "googletest" version)) | |
557 | (sha256 | |
558 | (base32 | |
559 | "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk")))))) | |
560 | ||
c61794cf | 561 | (define-public cpputest |
562 | (package | |
563 | (name "cpputest") | |
564 | (version "3.8") | |
565 | (source | |
566 | (origin | |
567 | (method url-fetch) | |
568 | (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v" | |
569 | version "/cpputest-" version ".tar.gz")) | |
570 | (sha256 | |
571 | (base32 | |
572 | "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8")))) | |
573 | (build-system gnu-build-system) | |
574 | (native-inputs | |
575 | `(("googletest" ,googletest))) | |
576 | (home-page "https://cpputest.github.io/") | |
577 | (synopsis "Unit testing and mocking framework for C/C++") | |
578 | (description | |
579 | "CppUTest is a C/C++ based unit xUnit test framework. It is written in | |
580 | C++ but is used in C and C++ projects and frequently used in embedded systems | |
581 | but it works for any C/C++ project.") | |
ac257f12 | 582 | (license license:bsd-3))) |
63aa8558 RW |
583 | |
584 | (define-public python-parameterized | |
585 | (package | |
586 | (name "python-parameterized") | |
8d85ad6c | 587 | (version "0.7.3") |
63aa8558 RW |
588 | (source |
589 | (origin | |
590 | (method url-fetch) | |
591 | (uri (pypi-uri "parameterized" version)) | |
592 | (sha256 | |
593 | (base32 | |
8d85ad6c | 594 | "0g1q6n7fkanjv7i1djzw62f46xf573jvza7afabh3baqjqxy7rpd")))) |
63aa8558 | 595 | (build-system python-build-system) |
ae3909eb MB |
596 | (arguments |
597 | '(#:phases (modify-phases %standard-phases | |
598 | (replace 'check | |
599 | (lambda* (#:key tests? #:allow-other-keys) | |
600 | (if tests? | |
601 | (invoke "nosetests" "-v") | |
602 | (format #t "test suite not run~%")) | |
603 | #t))))) | |
604 | (native-inputs | |
605 | `(("python-mock" ,python-mock) | |
606 | ("python-nose" ,python-nose))) | |
63aa8558 RW |
607 | (home-page "https://github.com/wolever/parameterized") |
608 | (synopsis "Parameterized testing with any Python test framework") | |
609 | (description | |
610 | "Parameterized is a Python library that aims to fix parameterized testing | |
611 | for every Python test framework. It supports nose, py.test, and unittest.") | |
ae3909eb | 612 | (properties `((python2-variant . ,(delay python2-parameterized)))) |
ac257f12 | 613 | (license license:bsd-2))) |
63aa8558 RW |
614 | |
615 | (define-public python2-parameterized | |
ae3909eb MB |
616 | (let ((base (package-with-python2 (strip-python2-variant |
617 | python-parameterized)))) | |
618 | (package/inherit | |
619 | base | |
620 | (source | |
621 | (origin | |
622 | (inherit (package-source base)) | |
623 | (patches (search-patches "python2-parameterized-docstring-test.patch"))))))) | |
ac257f12 | 624 | |
e57fb285 PL |
625 | (define-public python-minimock |
626 | (package | |
627 | (name "python-minimock") | |
628 | (version "1.2.8") | |
629 | (source | |
630 | (origin | |
631 | (method url-fetch) | |
632 | (uri (pypi-uri "MiniMock" version)) | |
633 | (sha256 | |
634 | (base32 | |
635 | "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz")))) | |
636 | (build-system python-build-system) | |
637 | (home-page "https://pypi.org/project/MiniMock") | |
638 | (synopsis "Simple Python library for using mock objects") | |
639 | (description "MiniMock is a simple library for building mock objects with | |
640 | doctest.") | |
641 | (license license:expat))) | |
642 | ||
643 | (define-public python2-minimock | |
644 | (package-with-python2 python-minimock)) | |
645 | ||
ac257f12 RW |
646 | (define-public python-mock |
647 | (package | |
648 | (name "python-mock") | |
dab41b95 | 649 | (version "3.0.5") |
ac257f12 RW |
650 | (source |
651 | (origin | |
652 | (method url-fetch) | |
653 | (uri (pypi-uri "mock" version)) | |
654 | (sha256 | |
655 | (base32 | |
dab41b95 | 656 | "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3")))) |
2dd12924 | 657 | (propagated-inputs |
dab41b95 | 658 | `(("python-six" ,python-six))) |
ac257f12 | 659 | (build-system python-build-system) |
2dd12924 | 660 | (arguments |
dab41b95 MB |
661 | ;; FIXME: Tests require "pytest", which depends on this package. |
662 | '(#:tests? #f)) | |
ac257f12 RW |
663 | (home-page "https://github.com/testing-cabal/mock") |
664 | (synopsis "Python mocking and patching library for testing") | |
665 | (description | |
666 | "Mock is a library for testing in Python. It allows you to replace parts | |
667 | of your system under test with mock objects and make assertions about how they | |
668 | have been used.") | |
2dd12924 | 669 | (properties `((python2-variant . ,(delay python2-mock)))) |
ac257f12 RW |
670 | (license license:expat))) |
671 | ||
672 | (define-public python2-mock | |
2dd12924 MB |
673 | (let ((base (package-with-python2 |
674 | (strip-python2-variant python-mock)))) | |
675 | (package (inherit base) | |
676 | (propagated-inputs | |
677 | `(("python2-functools32" ,python2-functools32) | |
678 | ("python2-funcsigs" ,python2-funcsigs) | |
679 | ,@(package-propagated-inputs base)))))) | |
ac257f12 RW |
680 | |
681 | (define-public python-nose | |
682 | (package | |
683 | (name "python-nose") | |
684 | (version "1.3.7") | |
685 | (source | |
686 | (origin | |
687 | (method url-fetch) | |
688 | (uri (pypi-uri "nose" version)) | |
689 | (sha256 | |
690 | (base32 | |
691 | "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi")))) | |
692 | (build-system python-build-system) | |
693 | (arguments | |
694 | '(#:tests? #f)) ; FIXME: test suite fails | |
695 | (home-page "http://readthedocs.org/docs/nose/") | |
696 | (synopsis "Python testing library") | |
697 | (description | |
698 | "Nose extends the unittest library to make testing easier.") | |
699 | (license license:lgpl2.0+))) | |
700 | ||
701 | (define-public python2-nose | |
702 | (package-with-python2 python-nose)) | |
703 | ||
704 | (define-public python-nose2 | |
705 | (package | |
706 | (name "python-nose2") | |
cd773f11 | 707 | (version "0.9.2") |
ac257f12 RW |
708 | (source |
709 | (origin | |
710 | (method url-fetch) | |
711 | (uri (pypi-uri "nose2" version)) | |
712 | (sha256 | |
713 | (base32 | |
cd773f11 | 714 | "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7")))) |
ac257f12 RW |
715 | (build-system python-build-system) |
716 | (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector' | |
717 | (propagated-inputs | |
718 | `(("python-cov-core" ,python-cov-core) | |
719 | ("python-pytest-cov" ,python-pytest-cov) | |
720 | ("python-six" ,python-six))) | |
721 | (home-page "https://github.com/nose-devs/nose2") | |
722 | (synopsis "Next generation of nicer testing for Python") | |
723 | (description | |
724 | "Nose2 is the next generation of nicer testing for Python, based on the | |
725 | plugins branch of unittest2. Nose2 aims to improve on nose by providing a | |
726 | better plugin api, being easier for users to configure, and simplifying internal | |
727 | interfaces and processes.") | |
728 | (license license:bsd-2))) | |
729 | ||
730 | (define-public python2-nose2 | |
731 | (package-with-python2 python-nose2)) | |
732 | ||
733 | (define-public python-unittest2 | |
734 | (package | |
735 | (name "python-unittest2") | |
2dd12924 | 736 | (version "1.1.0") |
ac257f12 RW |
737 | (source |
738 | (origin | |
739 | (method url-fetch) | |
2dd12924 MB |
740 | (uri (pypi-uri "unittest2" version)) |
741 | (patches | |
742 | (search-patches "python-unittest2-python3-compat.patch" | |
743 | "python-unittest2-remove-argparse.patch")) | |
ac257f12 RW |
744 | (sha256 |
745 | (base32 | |
2dd12924 | 746 | "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212")))) |
ac257f12 | 747 | (build-system python-build-system) |
2dd12924 MB |
748 | (arguments |
749 | '(#:phases | |
750 | (modify-phases %standard-phases | |
751 | (replace 'check | |
752 | (lambda _ | |
753 | (zero? (system* "python" "-m" "unittest2" "discover" "--verbose"))))))) | |
754 | (propagated-inputs | |
755 | `(("python-six" ,python-six) | |
756 | ("python-traceback2" ,python-traceback2))) | |
e85af137 | 757 | (home-page "https://pypi.org/project/unittest2/") |
ac257f12 RW |
758 | (synopsis "Python unit testing library") |
759 | (description | |
760 | "Unittest2 is a replacement for the unittest module in the Python | |
761 | standard library.") | |
762 | (license license:psfl))) | |
763 | ||
764 | (define-public python2-unittest2 | |
2dd12924 | 765 | (package-with-python2 python-unittest2)) |
ac257f12 RW |
766 | |
767 | (define-public python-pytest | |
768 | (package | |
769 | (name "python-pytest") | |
b8f4d3f4 | 770 | (version "5.3.5") |
ac257f12 RW |
771 | (source |
772 | (origin | |
773 | (method url-fetch) | |
2dd12924 | 774 | (uri (pypi-uri "pytest" version)) |
ac257f12 RW |
775 | (sha256 |
776 | (base32 | |
b8f4d3f4 | 777 | "139i9cjhrv5aici3skq8iihvfb3lq0d8xb5j7qycr2hlk8cfjpqd")))) |
ac257f12 | 778 | (build-system python-build-system) |
2dd12924 MB |
779 | (arguments |
780 | `(#:phases | |
781 | (modify-phases %standard-phases | |
1a246c01 | 782 | (replace 'check |
c5d39909 MB |
783 | (lambda* (#:key (tests? #t) #:allow-other-keys) |
784 | (if tests? | |
785 | (invoke "pytest" "-vv" "-k" | |
786 | (string-append | |
787 | ;; These tests involve the /usr directory, and fails. | |
788 | "not test_remove_dir_prefix" | |
789 | " and not test_argcomplete" | |
790 | ;; This test tries to override PYTHONPATH, and | |
791 | ;; subsequently fails to locate the test libraries. | |
792 | " and not test_collection")) | |
793 | (format #t "test suite not run~%")) | |
794 | #t))))) | |
ac257f12 | 795 | (propagated-inputs |
a9ae30b7 MB |
796 | `(("python-atomicwrites" ,python-atomicwrites) |
797 | ("python-attrs" ,python-attrs-bootstrap) | |
7ad5c6dd | 798 | ("python-more-itertools" ,python-more-itertools) |
c5d39909 | 799 | ("python-packaging" ,python-packaging-bootstrap) |
7ad5c6dd AI |
800 | ("python-pluggy" ,python-pluggy) |
801 | ("python-py" ,python-py) | |
c5d39909 MB |
802 | ("python-six" ,python-six-bootstrap) |
803 | ("python-wcwidth" ,python-wcwidth))) | |
ac257f12 RW |
804 | (native-inputs |
805 | `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`. | |
806 | ("bash" ,bash) | |
2dd12924 | 807 | ("python-hypothesis" ,python-hypothesis) |
ac257f12 | 808 | ("python-nose" ,python-nose) |
2dd12924 | 809 | ("python-mock" ,python-mock) |
4750b3a2 | 810 | ("python-pytest" ,python-pytest-bootstrap) |
c5d39909 MB |
811 | ("python-setuptools-scm" ,python-setuptools-scm) |
812 | ("python-xmlschema" ,python-xmlschema))) | |
aefa2912 | 813 | (home-page "https://docs.pytest.org/en/latest/") |
ac257f12 RW |
814 | (synopsis "Python testing library") |
815 | (description | |
816 | "Pytest is a testing tool that provides auto-discovery of test modules | |
817 | and functions, detailed info on failing assert statements, modular fixtures, | |
818 | and many external plugins.") | |
7ad5c6dd AI |
819 | (license license:expat) |
820 | (properties `((python2-variant . ,(delay python2-pytest)))))) | |
ac257f12 | 821 | |
c5d39909 | 822 | ;; Pytest 4.x are the last versions that support Python 2. |
ac257f12 | 823 | (define-public python2-pytest |
c5d39909 MB |
824 | (package |
825 | (inherit (strip-python2-variant python-pytest)) | |
826 | (name "python2-pytest") | |
0ae97f5d | 827 | (version "4.6.9") |
c5d39909 MB |
828 | (source (origin |
829 | (method url-fetch) | |
830 | (uri (pypi-uri "pytest" version)) | |
831 | (sha256 | |
832 | (base32 | |
0ae97f5d | 833 | "0fgkmpc31nzy97fxfrkqbzycigdwxwwmninx3qhkzp81migggs0r")))) |
c5d39909 MB |
834 | (build-system python-build-system) |
835 | (arguments | |
836 | `(#:python ,python-2 | |
837 | ,@(package-arguments python-pytest))) | |
838 | (propagated-inputs | |
839 | `(("python-atomicwrites" ,python2-atomicwrites) | |
840 | ("python-attrs" ,python2-attrs-bootstrap) | |
841 | ("python-funcsigs" ,python2-funcsigs) | |
0ae97f5d | 842 | ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap) |
c5d39909 | 843 | ("python-more-itertools" ,python2-more-itertools) |
0ae97f5d | 844 | ("python-packaging" ,python2-packaging-bootstrap) |
c5d39909 MB |
845 | ("python-pathlib2" ,python2-pathlib2) |
846 | ("python-pluggy" ,python2-pluggy) | |
847 | ("python-py" ,python2-py) | |
0ae97f5d MB |
848 | ("python-six" ,python2-six-bootstrap) |
849 | ("python-wcwidth" ,python2-wcwidth))) | |
c5d39909 MB |
850 | (native-inputs |
851 | `(("bash" ,bash) ;tests require 'compgen' | |
852 | ("python-hypothesis" ,python2-hypothesis) | |
853 | ("python-nose" ,python2-nose) | |
854 | ("python-mock" ,python2-mock) | |
855 | ("python-pytest" ,python2-pytest-bootstrap) | |
856 | ("python-setuptools-scm" ,python2-setuptools-scm))))) | |
ac257f12 | 857 | |
2dd12924 | 858 | (define-public python-pytest-bootstrap |
ac257f12 | 859 | (package |
7ad5c6dd | 860 | (inherit (strip-python2-variant python-pytest)) |
2dd12924 MB |
861 | (name "python-pytest-bootstrap") |
862 | (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm))) | |
7ad5c6dd AI |
863 | (arguments `(#:tests? #f)) |
864 | (properties `((python2-variant . ,(delay python2-pytest-bootstrap)))))) | |
ac257f12 | 865 | |
2dd12924 | 866 | (define-public python2-pytest-bootstrap |
c5d39909 MB |
867 | (hidden-package |
868 | (package/inherit | |
869 | python2-pytest | |
870 | (name "python2-pytest-bootstrap") | |
871 | (arguments | |
872 | (substitute-keyword-arguments (package-arguments python2-pytest) | |
873 | ((#:tests? _ #f) #f))) | |
874 | (native-inputs | |
875 | `(("python-setuptools-scm" ,python2-setuptools-scm))) | |
876 | (propagated-inputs | |
877 | `(("python-atomicwrites" ,python2-atomicwrites) | |
878 | ("python-attrs" ,python2-attrs-bootstrap) | |
879 | ("python-funcsigs" ,python2-funcsigs-bootstrap) | |
0ae97f5d | 880 | ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap) |
c5d39909 | 881 | ("python-more-itertools" ,python2-more-itertools) |
0ae97f5d | 882 | ("python-packaging" ,python2-packaging-bootstrap) |
c5d39909 | 883 | ("python-pathlib2" ,python2-pathlib2-bootstrap) |
0ae97f5d MB |
884 | ("python-pluggy" ,python2-pluggy-bootstrap) |
885 | ("python-py" ,python2-py) | |
886 | ("python-wcwidth" ,python2-wcwidth)))))) | |
ac257f12 RW |
887 | |
888 | (define-public python-pytest-cov | |
889 | (package | |
890 | (name "python-pytest-cov") | |
cc63d8cf | 891 | (version "2.8.1") |
ac257f12 RW |
892 | (source |
893 | (origin | |
894 | (method url-fetch) | |
895 | (uri (pypi-uri "pytest-cov" version)) | |
896 | (sha256 | |
cc63d8cf | 897 | (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc")))) |
ac257f12 RW |
898 | (build-system python-build-system) |
899 | (arguments | |
900 | `(#:phases | |
901 | (modify-phases %standard-phases | |
902 | (replace 'check | |
903 | (lambda _ | |
123d92ea | 904 | ;; Options taken from tox.ini. |
ac257f12 | 905 | ;; TODO: make "--restructuredtext" tests pass. They currently fail |
123d92ea | 906 | ;; with "Duplicate implicit target name". |
29594404 MW |
907 | (invoke "python" "./setup.py" "check" |
908 | "--strict" "--metadata")))))) | |
ac257f12 RW |
909 | (propagated-inputs |
910 | `(("python-coverage" ,python-coverage) | |
911 | ("python-pytest" ,python-pytest))) | |
912 | (home-page "https://github.com/pytest-dev/pytest-cov") | |
913 | (synopsis "Pytest plugin for measuring coverage") | |
914 | (description | |
915 | "Pytest-cov produces coverage reports. It supports centralised testing and | |
916 | distributed testing in both @code{load} and @code{each} modes. It also | |
917 | supports coverage of subprocesses.") | |
918 | (license license:expat))) | |
919 | ||
920 | (define-public python2-pytest-cov | |
921 | (package-with-python2 python-pytest-cov)) | |
922 | ||
923 | (define-public python-pytest-runner | |
924 | (package | |
925 | (name "python-pytest-runner") | |
861a2659 | 926 | (version "5.2") |
ac257f12 RW |
927 | (source |
928 | (origin | |
929 | (method url-fetch) | |
930 | (uri (pypi-uri "pytest-runner" version)) | |
931 | (sha256 | |
932 | (base32 | |
861a2659 | 933 | "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn")))) |
ac257f12 | 934 | (build-system python-build-system) |
861a2659 MB |
935 | (arguments |
936 | '(;; FIXME: The test suite requires 'python-flake8' and 'python-black', | |
937 | ;; but that introduces a circular dependency. | |
938 | #:tests? #f | |
939 | #:phases (modify-phases %standard-phases | |
940 | (replace 'check | |
941 | (lambda* (#:key tests? #:allow-other-keys) | |
942 | (if tests? | |
943 | (invoke "pytest" "-vv") | |
944 | (format #t "test suite not run~%")) | |
945 | #t))))) | |
ac257f12 | 946 | (native-inputs |
861a2659 | 947 | `(("python-setuptools-scm" ,python-setuptools-scm))) |
ac257f12 RW |
948 | (home-page "https://github.com/pytest-dev/pytest-runner") |
949 | (synopsis "Invoke py.test as a distutils command") | |
950 | (description | |
951 | "This package provides a @command{pytest-runner} command that | |
952 | @file{setup.py} files can use to run tests.") | |
953 | (license license:expat))) | |
954 | ||
955 | (define-public python2-pytest-runner | |
956 | (package-with-python2 python-pytest-runner)) | |
957 | ||
ff0efc8f MB |
958 | ;; python-bleach 3.1.0 requires this ancient version of pytest-runner. |
959 | ;; Remove once no longer needed. | |
960 | (define-public python-pytest-runner-2 | |
961 | (package/inherit | |
962 | python-pytest-runner | |
963 | (version "2.12.2") | |
964 | (source (origin | |
965 | (method url-fetch) | |
966 | (uri (pypi-uri "pytest-runner" version)) | |
967 | (sha256 | |
968 | (base32 | |
969 | "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6")))))) | |
970 | ||
971 | (define-public python2-pytest-runner-2 | |
972 | (package-with-python2 python-pytest-runner-2)) | |
973 | ||
ac257f12 RW |
974 | (define-public python-pytest-mock |
975 | (package | |
976 | (name "python-pytest-mock") | |
71fb3263 | 977 | (version "1.10.1") |
ac257f12 RW |
978 | (source |
979 | (origin | |
980 | (method url-fetch) | |
f7bd4f23 | 981 | (uri (pypi-uri "pytest-mock" version)) |
ac257f12 RW |
982 | (sha256 |
983 | (base32 | |
71fb3263 | 984 | "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad")))) |
ac257f12 RW |
985 | (build-system python-build-system) |
986 | (native-inputs | |
f7bd4f23 | 987 | `(("python-setuptools-scm" ,python-setuptools-scm))) |
ac257f12 RW |
988 | (propagated-inputs |
989 | `(("python-pytest" ,python-pytest))) | |
990 | (home-page "https://github.com/pytest-dev/pytest-mock/") | |
991 | (synopsis "Thin-wrapper around the mock package for easier use with py.test") | |
992 | (description | |
993 | "This plugin installs a @code{mocker} fixture which is a thin-wrapper | |
994 | around the patching API provided by the @code{mock} package, but with the | |
995 | benefit of not having to worry about undoing patches at the end of a test. | |
996 | The mocker fixture has the same API as @code{mock.patch}, supporting the | |
997 | same arguments.") | |
998 | (properties `((python2-variant . ,(delay python2-pytest-mock)))) | |
999 | (license license:expat))) | |
1000 | ||
1001 | (define-public python2-pytest-mock | |
1002 | (let ((base (package-with-python2 | |
1003 | (strip-python2-variant python-pytest-mock)))) | |
1004 | (package (inherit base) | |
1005 | (propagated-inputs | |
1006 | `(("python2-mock" ,python2-mock) | |
1007 | ,@(package-propagated-inputs base)))))) | |
1008 | ||
1009 | (define-public python-pytest-xdist | |
1010 | (package | |
1011 | (name "python-pytest-xdist") | |
d70cb3e0 | 1012 | (version "1.25.0") |
ac257f12 RW |
1013 | (source |
1014 | (origin | |
1015 | (method url-fetch) | |
d70cb3e0 | 1016 | (uri (pypi-uri "pytest-xdist" version)) |
ac257f12 RW |
1017 | (sha256 |
1018 | (base32 | |
d70cb3e0 | 1019 | "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n")) |
ac257f12 RW |
1020 | (modules '((guix build utils))) |
1021 | (snippet | |
1022 | '(begin | |
1023 | ;; Remove pre-compiled .pyc files from source. | |
1024 | (for-each delete-file-recursively | |
1025 | (find-files "." "__pycache__" #:directories? #t)) | |
1026 | (for-each delete-file (find-files "." "\\.pyc$")) | |
1027 | #t)))) | |
1028 | (build-system python-build-system) | |
1029 | (arguments | |
1030 | '(#:tests? #f)) ;FIXME: Some tests are failing. | |
1031 | ;; #:phases | |
1032 | ;; (modify-phases %standard-phases | |
1033 | ;; (delete 'check) | |
1034 | ;; (add-after 'install 'check | |
1035 | ;; (lambda* (#:key inputs outputs #:allow-other-keys) | |
1036 | ;; (add-installed-pythonpath inputs outputs) | |
1037 | ;; (zero? (system* "py.test" "-v"))))) | |
1038 | (native-inputs | |
d70cb3e0 | 1039 | `(("python-setuptools-scm" ,python-setuptools-scm))) |
ac257f12 RW |
1040 | (propagated-inputs |
1041 | `(("python-execnet" ,python-execnet) | |
1042 | ("python-pytest" ,python-pytest) | |
1043 | ("python-py" ,python-py))) | |
1044 | (home-page | |
1045 | "https://github.com/pytest-dev/pytest-xdist") | |
1046 | (synopsis | |
1047 | "Plugin for py.test with distributed testing and loop-on-failing modes") | |
1048 | (description | |
1049 | "The pytest-xdist plugin extends py.test with some unique test execution | |
1050 | modes: parallelization, running tests in boxed subprocesses, the ability | |
1051 | to run tests repeatedly when failed, and the ability to run tests on multiple | |
1052 | Python interpreters or platforms. It uses rsync to copy the existing | |
1053 | program code to a remote location, executes there, and then syncs the | |
1054 | result back.") | |
1055 | (license license:expat))) | |
1056 | ||
1057 | (define-public python2-pytest-xdist | |
1058 | (package-with-python2 python-pytest-xdist)) | |
1059 | ||
90afa80d RW |
1060 | (define-public python-pytest-timeout |
1061 | (package | |
1062 | (name "python-pytest-timeout") | |
5e579676 | 1063 | (version "1.3.4") |
90afa80d RW |
1064 | (source |
1065 | (origin | |
1066 | (method url-fetch) | |
1067 | (uri (pypi-uri "pytest-timeout" version)) | |
1068 | (sha256 | |
1069 | (base32 | |
5e579676 | 1070 | "13n42azbvs5slvy2n1a9nw17r4qdq10dd68nln3jp925safa3yl0")))) |
90afa80d | 1071 | (build-system python-build-system) |
5e579676 MB |
1072 | (arguments |
1073 | '(#:phases (modify-phases %standard-phases | |
1074 | (replace 'check | |
1075 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1076 | ;; Make the installed plugin discoverable by Pytest. | |
1077 | (add-installed-pythonpath inputs outputs) | |
1078 | (invoke "pytest" "-vv")))))) | |
90afa80d RW |
1079 | (propagated-inputs |
1080 | `(("python-pytest" ,python-pytest))) | |
5e579676 MB |
1081 | (native-inputs |
1082 | `(("python-pexpect" ,python-pexpect))) | |
90afa80d RW |
1083 | (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/") |
1084 | (synopsis "Plugin for py.test to abort hanging tests") | |
1085 | (description | |
1086 | "This package provides a py.test plugin that aborts hanging tests after a | |
1087 | timeout has been exceeded.") | |
1088 | (license license:expat))) | |
1089 | ||
b27a0dd4 LDB |
1090 | (define-public python-pytest-forked |
1091 | (package | |
1092 | (name "python-pytest-forked") | |
1093 | (version "1.1.3") | |
1094 | (source | |
1095 | (origin | |
1096 | (method url-fetch) | |
1097 | (uri (pypi-uri "pytest-forked" version)) | |
1098 | (sha256 | |
1099 | (base32 | |
1100 | "000i4q7my2fq4l49n8idx2c812dql97qv6qpm2vhrrn9v6g6j18q")))) | |
1101 | (build-system python-build-system) | |
1102 | (propagated-inputs | |
1103 | `(("python-pytest" ,python-pytest))) | |
1104 | (native-inputs | |
1105 | `(("python-setuptools-scm" ,python-setuptools-scm))) | |
1106 | (home-page | |
1107 | "https://github.com/pytest-dev/pytest-forked") | |
1108 | (synopsis | |
1109 | "Run tests in isolated forked subprocesses") | |
1110 | (description | |
1111 | "Pytest plugin which will run each test in a subprocess and will report if | |
1112 | a test crashed the process.") | |
1113 | (license license:expat))) | |
1114 | ||
ac257f12 RW |
1115 | (define-public python-scripttest |
1116 | (package | |
1117 | (name "python-scripttest") | |
1118 | (version "1.3") | |
1119 | (source | |
1120 | (origin | |
1121 | (method url-fetch) | |
5af020bb | 1122 | (uri (pypi-uri "scripttest" version)) |
ac257f12 RW |
1123 | (sha256 |
1124 | (base32 | |
1125 | "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m")))) | |
1126 | (build-system python-build-system) | |
1127 | (native-inputs | |
1128 | `(("python-pytest" ,python-pytest))) | |
63b06670 TGR |
1129 | (home-page (string-append "https://web.archive.org/web/20161029233413/" |
1130 | "http://pythonpaste.org/scripttest/")) | |
ac257f12 RW |
1131 | (synopsis "Python library to test command-line scripts") |
1132 | (description "Scripttest is a Python helper library for testing | |
1133 | interactive command-line applications. With it you can run a script in a | |
1134 | subprocess and see the output as well as any file modifications.") | |
1135 | (license license:expat))) | |
1136 | ||
1137 | (define-public python2-scripttest | |
1138 | (package-with-python2 python-scripttest)) | |
1139 | ||
8b93f7e4 | 1140 | (define-public python-testtools-bootstrap |
ac257f12 | 1141 | (package |
8b93f7e4 MB |
1142 | (name "python-testtools-bootstrap") |
1143 | (version "2.3.0") | |
ac257f12 RW |
1144 | (source |
1145 | (origin | |
1146 | (method url-fetch) | |
1147 | (uri (pypi-uri "testtools" version)) | |
1148 | (sha256 | |
1149 | (base32 | |
0ea6af99 EF |
1150 | "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq")) |
1151 | (patches (search-patches "python-testtools.patch")))) | |
ac257f12 | 1152 | (build-system python-build-system) |
8b93f7e4 | 1153 | (arguments '(#:tests? #f)) |
ac257f12 | 1154 | (propagated-inputs |
8b93f7e4 MB |
1155 | `(("python-extras" ,python-extras) |
1156 | ("python-fixtures" ,python-fixtures-bootstrap) | |
1157 | ("python-mimeparse" ,python-mimeparse) | |
1158 | ("python-pbr" ,python-pbr-minimal) | |
1159 | ("python-six" ,python-six) | |
1160 | ("python-traceback2" ,python-traceback2) | |
1161 | ("python-unittest2" ,python-unittest2))) | |
ac257f12 RW |
1162 | (home-page "https://github.com/testing-cabal/testtools") |
1163 | (synopsis | |
1164 | "Extensions to the Python standard library unit testing framework") | |
8b93f7e4 MB |
1165 | (description |
1166 | "This package is only for bootstrapping. Do not use this.") | |
1167 | (license license:psfl))) | |
1168 | ||
1169 | (define-public python2-testtools-bootstrap | |
1170 | (package-with-python2 python-testtools-bootstrap)) | |
1171 | ||
1172 | (define-public python-testtools | |
1173 | (package | |
1174 | (inherit python-testtools-bootstrap) | |
1175 | (name "python-testtools") | |
1176 | (arguments | |
1177 | `(#:phases (modify-phases %standard-phases | |
1178 | (replace 'check | |
1179 | (lambda _ | |
1180 | (invoke "python" "-m" "testtools.run" | |
1181 | "testtools.tests.test_suite")))))) | |
1182 | (propagated-inputs | |
1183 | `(("python-extras" ,python-extras) | |
1184 | ("python-fixtures" ,python-fixtures) | |
1185 | ("python-mimeparse" ,python-mimeparse) | |
1186 | ("python-pbr" ,python-pbr) | |
1187 | ("python-six" ,python-six) | |
1188 | ("python-traceback2" ,python-traceback2) | |
1189 | ("python-unittest2" ,python-unittest2))) | |
1190 | (native-inputs | |
1191 | `(("python-testscenarios" ,python-testscenarios-bootstrap))) | |
ac257f12 RW |
1192 | (description |
1193 | "Testtools extends the Python standard library unit testing framework to | |
1194 | provide matchers, more debugging information, and cross-Python | |
8b93f7e4 | 1195 | compatibility."))) |
ac257f12 RW |
1196 | |
1197 | (define-public python2-testtools | |
1198 | (package-with-python2 python-testtools)) | |
1199 | ||
8b93f7e4 | 1200 | (define-public python-testscenarios-bootstrap |
ac257f12 | 1201 | (package |
8b93f7e4 | 1202 | (name "python-testscenarios-bootstrap") |
ae565a9a | 1203 | (version "0.5.0") |
ac257f12 RW |
1204 | (source |
1205 | (origin | |
1206 | (method url-fetch) | |
ae565a9a | 1207 | (uri (pypi-uri "testscenarios" version)) |
ac257f12 RW |
1208 | (sha256 |
1209 | (base32 | |
ae565a9a | 1210 | "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2")))) |
ac257f12 | 1211 | (build-system python-build-system) |
ae565a9a MB |
1212 | (arguments |
1213 | `(#:phases (modify-phases %standard-phases | |
1214 | (replace 'check | |
1215 | (lambda _ | |
1216 | (invoke "python" "-m" "testtools.run" | |
1217 | "testscenarios.test_suite")))))) | |
ac257f12 | 1218 | (propagated-inputs |
ae565a9a MB |
1219 | `(("python-pbr" ,python-pbr-minimal) |
1220 | ("python-testtools" ,python-testtools-bootstrap))) | |
ac257f12 RW |
1221 | (home-page "https://launchpad.net/testscenarios") |
1222 | (synopsis "Pyunit extension for dependency injection") | |
1223 | (description | |
8b93f7e4 | 1224 | "This package is only for bootstrapping. Don't use this.") |
ac257f12 RW |
1225 | (license (list license:bsd-3 license:asl2.0)))) ; at the user's option |
1226 | ||
8b93f7e4 MB |
1227 | (define-public python2-testscenarios-bootstrap |
1228 | (package-with-python2 python-testscenarios-bootstrap)) | |
1229 | ||
1230 | (define-public python-testscenarios | |
1231 | (package | |
1232 | (inherit python-testscenarios-bootstrap) | |
1233 | (name "python-testscenarios") | |
1234 | (propagated-inputs | |
ae565a9a MB |
1235 | `(("python-pbr" ,python-pbr) |
1236 | ("python-testtools" ,python-testtools))) | |
8b93f7e4 MB |
1237 | (description |
1238 | "Testscenarios provides clean dependency injection for Python unittest | |
1239 | style tests."))) | |
1240 | ||
ac257f12 RW |
1241 | (define-public python2-testscenarios |
1242 | (package-with-python2 python-testscenarios)) | |
1243 | ||
bc69104a MB |
1244 | ;; Testresources requires python-pbr at runtime, but pbr needs it for its |
1245 | ;; own tests. Hence this bootstrap variant. | |
1246 | (define-public python-testresources-bootstrap | |
ac257f12 | 1247 | (package |
bc69104a MB |
1248 | (name "python-testresources-bootstrap") |
1249 | (version "2.0.1") | |
1250 | (source (origin | |
1251 | (method url-fetch) | |
1252 | (uri (pypi-uri "testresources" version)) | |
1253 | (sha256 | |
1254 | (base32 | |
1255 | "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf")))) | |
ac257f12 | 1256 | (build-system python-build-system) |
bc69104a MB |
1257 | (arguments '(#:tests? #f)) |
1258 | (propagated-inputs | |
1259 | `(("python-pbr" ,python-pbr-minimal))) | |
ac257f12 RW |
1260 | (home-page "https://launchpad.net/testresources") |
1261 | (synopsis | |
1262 | "Pyunit extension for managing test resources") | |
1263 | (description | |
bc69104a MB |
1264 | "This package is only here for bootstrapping purposes. Use the regular |
1265 | testresources package instead.") | |
ac257f12 RW |
1266 | (license (list license:bsd-3 license:asl2.0)))) ; at the user's option |
1267 | ||
bc69104a MB |
1268 | (define-public python2-testresources-bootstrap |
1269 | (package-with-python2 python-testresources-bootstrap)) | |
1270 | ||
1271 | (define-public python-testresources | |
1272 | (package | |
1273 | (inherit python-testresources-bootstrap) | |
1274 | (name "python-testresources") | |
1275 | (propagated-inputs | |
1276 | `(("python-pbr" ,python-pbr))) | |
1277 | (arguments '()) | |
1278 | (native-inputs | |
1279 | `(("python-fixtures" ,python-fixtures) | |
1280 | ("python-testtols" ,python-testtools))) | |
1281 | (description | |
1282 | "Testresources is an extension to Python's unittest to allow declarative | |
1283 | use of resources by test cases."))) | |
1284 | ||
ac257f12 RW |
1285 | (define-public python2-testresources |
1286 | (package-with-python2 python-testresources)) | |
1287 | ||
8b93f7e4 | 1288 | (define-public python-subunit-bootstrap |
ac257f12 | 1289 | (package |
8b93f7e4 | 1290 | (name "python-subunit-bootstrap") |
4df24531 | 1291 | (version "1.3.0") |
ac257f12 RW |
1292 | (source |
1293 | (origin | |
1294 | (method url-fetch) | |
8b93f7e4 | 1295 | (uri (pypi-uri "python-subunit" version)) |
ac257f12 RW |
1296 | (sha256 |
1297 | (base32 | |
4df24531 | 1298 | "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn")))) |
ac257f12 RW |
1299 | (build-system python-build-system) |
1300 | (propagated-inputs | |
1301 | `(("python-extras" ,python-extras) | |
8b93f7e4 | 1302 | ("python-testtools" ,python-testtools-bootstrap))) |
ac257f12 | 1303 | (native-inputs |
151f32a7 MB |
1304 | `(("python-fixtures" ,python-fixtures-bootstrap) |
1305 | ("python-hypothesis" ,python-hypothesis) | |
8b93f7e4 | 1306 | ("python-testscenarios" ,python-testscenarios-bootstrap))) |
4df24531 | 1307 | (home-page "https://launchpad.net/subunit") |
ac257f12 RW |
1308 | (synopsis "Python implementation of the subunit protocol") |
1309 | (description | |
8b93f7e4 MB |
1310 | "This package is here for bootstrapping purposes only. Use the regular |
1311 | python-subunit package instead.") | |
ac257f12 RW |
1312 | (license (list license:bsd-3 license:asl2.0)))) ; at the user's option |
1313 | ||
8b93f7e4 MB |
1314 | (define-public python2-subunit-bootstrap |
1315 | (package-with-python2 python-subunit-bootstrap)) | |
1316 | ||
1317 | (define-public python-subunit | |
1318 | (package | |
1319 | (inherit python-subunit-bootstrap) | |
1320 | (name "python-subunit") | |
1321 | (propagated-inputs | |
1322 | `(("python-extras" ,python-extras) | |
1323 | ("python-testtools" ,python-testtools))) | |
1324 | (native-inputs | |
1325 | `(("python-fixtures" ,python-fixtures) | |
1326 | ("python-hypothesis" ,python-hypothesis) | |
1327 | ("python-testscenarios" ,python-testscenarios))) | |
1328 | (description | |
1329 | "Python-subunit is a Python implementation of the subunit test streaming | |
1330 | protocol."))) | |
1331 | ||
ac257f12 RW |
1332 | (define-public python2-subunit |
1333 | (package-with-python2 python-subunit)) | |
1334 | ||
335c9e39 MB |
1335 | ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its |
1336 | ;; own tests. Hence this bootstrap variant. | |
1337 | (define-public python-fixtures-bootstrap | |
ac257f12 | 1338 | (package |
335c9e39 | 1339 | (name "python-fixtures-bootstrap") |
9c77852e | 1340 | (version "3.0.0") |
335c9e39 MB |
1341 | (source (origin |
1342 | (method url-fetch) | |
1343 | (uri (pypi-uri "fixtures" version)) | |
1344 | (sha256 | |
1345 | (base32 | |
9c77852e | 1346 | "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w")))) |
ac257f12 | 1347 | (build-system python-build-system) |
335c9e39 MB |
1348 | (arguments `(#:tests? #f)) |
1349 | (propagated-inputs | |
1350 | `(("python-pbr-minimal" ,python-pbr-minimal) | |
1351 | ("python-six" ,python-six))) | |
1352 | (home-page "https://launchpad.net/python-fixtures") | |
1353 | (synopsis "Python test fixture library") | |
1354 | (description | |
1355 | "This package is only used for bootstrapping. Use the regular | |
1356 | python-fixtures package instead.") | |
1357 | (license (list license:bsd-3 license:asl2.0)))) ; at user's option | |
1358 | ||
1359 | (define-public python2-fixtures-bootstrap | |
1360 | (package-with-python2 python-fixtures-bootstrap)) | |
1361 | ||
1362 | (define-public python-fixtures | |
1363 | (package | |
1364 | (inherit python-fixtures-bootstrap) | |
1365 | (name "python-fixtures") | |
ac257f12 RW |
1366 | (arguments |
1367 | '(#:phases | |
1368 | (modify-phases %standard-phases | |
1369 | (replace 'check | |
1370 | (lambda _ | |
29594404 MW |
1371 | (invoke "python" "-m" "testtools.run" |
1372 | "fixtures.test_suite")))))) | |
ac257f12 | 1373 | (propagated-inputs |
335c9e39 MB |
1374 | ;; Fixtures uses pbr at runtime to check versions, etc. |
1375 | `(("python-pbr" ,python-pbr) | |
1376 | ("python-six" ,python-six))) | |
ac257f12 RW |
1377 | (native-inputs |
1378 | `(("python-mock" ,python-mock) | |
8b93f7e4 | 1379 | ("python-testtools" ,python-testtools-bootstrap))) |
ac257f12 RW |
1380 | (description |
1381 | "Fixtures provides a way to create reusable state, useful when writing | |
335c9e39 | 1382 | Python tests."))) |
ac257f12 RW |
1383 | |
1384 | (define-public python2-fixtures | |
1385 | (package-with-python2 python-fixtures)) | |
1386 | ||
335c9e39 | 1387 | (define-public python-testrepository-bootstrap |
ac257f12 | 1388 | (package |
335c9e39 MB |
1389 | (name "python-testrepository-bootstrap") |
1390 | (version "0.0.20") | |
ac257f12 RW |
1391 | (source |
1392 | (origin | |
1393 | (method url-fetch) | |
9fcedf07 | 1394 | (uri (pypi-uri "testrepository" version)) |
ac257f12 RW |
1395 | (sha256 |
1396 | (base32 | |
1397 | "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m")))) | |
1398 | (build-system python-build-system) | |
335c9e39 MB |
1399 | (arguments '(#:tests? #f)) |
1400 | (propagated-inputs | |
1401 | `(("python-fixtures" ,python-fixtures-bootstrap) | |
8b93f7e4 MB |
1402 | ("python-subunit" ,python-subunit-bootstrap) |
1403 | ("python-testtools" ,python-testtools-bootstrap))) | |
335c9e39 MB |
1404 | (native-inputs |
1405 | `(("python-mimeparse" ,python-mimeparse))) | |
1406 | (home-page "https://launchpad.net/testrepository") | |
1407 | (synopsis "Database for Python test results") | |
1408 | (description | |
1409 | "Bootstrap package for python-testrepository. Don't use this.") | |
1410 | (license (list license:bsd-3 license:asl2.0)))) ; at user's option | |
1411 | ||
1412 | (define-public python2-testrepository-bootstrap | |
1413 | (package-with-python2 python-testrepository-bootstrap)) | |
1414 | ||
1415 | (define-public python-testrepository | |
1416 | (package | |
1417 | (inherit python-testrepository-bootstrap) | |
1418 | (name "python-testrepository") | |
ac257f12 RW |
1419 | (arguments |
1420 | ;; FIXME: Many tests are failing. | |
1421 | '(#:tests? #f)) | |
1422 | (propagated-inputs | |
1423 | `(("python-fixtures" ,python-fixtures) | |
1424 | ("python-subunit" ,python-subunit) | |
1425 | ("python-testtools" ,python-testtools))) | |
1426 | (native-inputs | |
335c9e39 | 1427 | `(("python-mimeparse" ,python-mimeparse))) |
ac257f12 RW |
1428 | (description "Testrepository provides a database of test results which can |
1429 | be used as part of a developer's workflow to check things such as what tests | |
335c9e39 | 1430 | have failed since the last commit or what tests are currently failing."))) |
ac257f12 RW |
1431 | |
1432 | (define-public python2-testrepository | |
1433 | (package-with-python2 python-testrepository)) | |
1434 | ||
1435 | (define-public python-coverage | |
1436 | (package | |
1437 | (name "python-coverage") | |
5e1d6787 | 1438 | (version "5.0.3") |
ac257f12 RW |
1439 | (source |
1440 | (origin | |
1441 | (method url-fetch) | |
1442 | (uri (pypi-uri "coverage" version)) | |
1443 | (sha256 | |
1444 | (base32 | |
5e1d6787 | 1445 | "1vrg8panqw79pswg52ygbrff3wdnxarrd9qz6c64ah0c4h2cmbvp")))) |
ac257f12 RW |
1446 | (build-system python-build-system) |
1447 | (arguments | |
1448 | ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors. | |
1449 | '(#:tests? #f)) | |
1450 | (home-page "http://nedbatchelder.com/code/coverage") | |
1451 | (synopsis "Code coverage measurement for Python") | |
1452 | (description | |
1453 | "Coverage measures code coverage, typically during test execution. It | |
1454 | uses the code analysis tools and tracing hooks provided in the Python standard | |
1455 | library to determine which lines are executable, and which have been | |
1456 | executed.") | |
1457 | (license license:bsd-3))) | |
1458 | ||
1459 | (define-public python2-coverage | |
1460 | (package-with-python2 python-coverage)) | |
1461 | ||
8b27771b JM |
1462 | (define-public python-pytest-asyncio |
1463 | (package | |
1464 | (name "python-pytest-asyncio") | |
1465 | (version "0.10.0") | |
1466 | (source | |
1467 | (origin | |
1468 | (method url-fetch) | |
1469 | (uri (pypi-uri "pytest-asyncio" version)) | |
1470 | (sha256 | |
1471 | (base32 "1bysy4nii13bm7h345wxf8fxcjhab7l374pqdv7vwv3izl053b4z")))) | |
1472 | (build-system python-build-system) | |
1473 | (native-inputs | |
1474 | `(("python-coverage" ,python-coverage) | |
1475 | ("python-async-generator" ,python-async-generator) | |
1476 | ("python-hypothesis" ,python-hypothesis) | |
1477 | ("python-pytest" ,python-pytest))) | |
1478 | (home-page "https://github.com/pytest-dev/pytest-asyncio") | |
1479 | (synopsis "Pytest support for asyncio") | |
1480 | (description "Python asyncio code is usually written in the form of | |
1481 | coroutines, which makes it slightly more difficult to test using normal | |
1482 | testing tools. @code{pytest-asyncio} provides useful fixtures and markers | |
1483 | to make testing async code easier.") | |
1484 | (license license:asl2.0))) | |
1485 | ||
ac257f12 RW |
1486 | (define-public python-cov-core |
1487 | (package | |
1488 | (name "python-cov-core") | |
1489 | (version "1.15.0") | |
1490 | (source | |
1491 | (origin | |
1492 | (method url-fetch) | |
1493 | (uri (pypi-uri "cov-core" version)) | |
1494 | (sha256 | |
1495 | (base32 | |
1496 | "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a")))) | |
1497 | (build-system python-build-system) | |
1498 | (propagated-inputs | |
1499 | `(("python-coverage" ,python-coverage))) | |
1500 | (home-page "https://github.com/schlamar/cov-core") | |
1501 | (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov") | |
1502 | (description | |
1503 | "This is a library package for use by @code{pytest-cov}, @code{nose-cov} | |
1504 | and @code{nose2-cov}. It is useful for developing coverage plugins for these | |
1505 | testing frameworks.") | |
1506 | (license license:expat))) | |
1507 | ||
1508 | (define-public python2-cov-core | |
1509 | (package-with-python2 python-cov-core)) | |
1510 | ||
c3f9a6ce EF |
1511 | (define-public python-codecov |
1512 | (package | |
1513 | (name "python-codecov") | |
1514 | (version "2.0.15") | |
1515 | (source | |
1516 | (origin | |
1517 | (method url-fetch) | |
1518 | (uri (pypi-uri "codecov" version)) | |
1519 | (sha256 | |
1520 | (base32 | |
1521 | "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f")))) | |
1522 | (build-system python-build-system) | |
1523 | (native-inputs | |
1524 | `(("python-unittest2" ,python-unittest2))) | |
1525 | (propagated-inputs | |
1526 | `(("python-coverage" ,python-coverage) | |
1527 | ("python-requests" ,python-requests))) | |
1528 | (home-page "http://github.com/codecov/codecov-python") | |
1529 | (synopsis "Upload code coverage reports to @code{codecov.io}") | |
1530 | (description | |
1531 | "Codecov collects code coverage reports from code written in Python, Java, | |
1532 | C/C++, R, and more, and uploads it to the @code{codecov.io} service.") | |
1533 | (license license:asl2.0))) | |
1534 | ||
ac257f12 RW |
1535 | (define-public python-testpath |
1536 | (package | |
1537 | (name "python-testpath") | |
1538 | (version "0.2") | |
1539 | (source | |
1540 | (origin | |
52305b0a EF |
1541 | (method git-fetch) |
1542 | (uri (git-reference | |
1543 | (url "https://github.com/jupyter/testpath") | |
1544 | (commit version))) | |
1545 | (file-name (git-file-name name version)) | |
ac257f12 RW |
1546 | (sha256 |
1547 | (base32 | |
52305b0a | 1548 | "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f")))) |
ac257f12 RW |
1549 | (build-system python-build-system) |
1550 | (arguments | |
1551 | `(#:tests? #f ; this package does not even have a setup.py | |
1552 | #:modules ((guix build python-build-system) | |
1553 | (guix build utils) | |
1554 | (srfi srfi-1)) | |
ac257f12 RW |
1555 | #:phases |
1556 | (modify-phases %standard-phases | |
1557 | (delete 'install) | |
1558 | (replace 'build | |
1559 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1560 | (let* ((version (last | |
1561 | (string-split (assoc-ref inputs "python") #\-))) | |
1562 | (x.y (string-join (take (string-split version #\.) 2) | |
1563 | ".")) | |
1564 | (dir (string-append | |
1565 | (assoc-ref outputs "out") | |
1566 | "/lib/python" x.y "/site-packages/testpath"))) | |
1567 | (mkdir-p dir) | |
1568 | (copy-recursively "testpath" dir)) | |
1569 | #t))))) | |
1570 | (home-page "https://github.com/takluyver/testpath") | |
1571 | (synopsis "Test utilities for code working with files and commands") | |
1572 | (description | |
1573 | "Testpath is a collection of utilities for Python code working with files | |
162a1374 | 1574 | and commands. It contains functions to check things on the file system, and |
ac257f12 RW |
1575 | tools for mocking system commands and recording calls to those.") |
1576 | (license license:expat))) | |
1577 | ||
1578 | (define-public python2-testpath | |
1579 | (package-with-python2 python-testpath)) | |
1580 | ||
1581 | (define-public python-testlib | |
1582 | (package | |
1583 | (name "python-testlib") | |
1584 | (version "0.6.5") | |
1585 | (source | |
1586 | (origin | |
1587 | (method url-fetch) | |
cb539b7c | 1588 | (uri (pypi-uri "testlib" version ".zip")) |
ac257f12 RW |
1589 | (sha256 |
1590 | (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y")))) | |
1591 | (build-system python-build-system) | |
1592 | (native-inputs | |
1593 | `(("unzip" ,unzip))) ; for unpacking the source | |
1594 | (synopsis "Python micro test suite harness") | |
1595 | (description "A micro unittest suite harness for Python.") | |
1596 | (home-page "https://github.com/trentm/testlib") | |
1597 | (license license:expat))) | |
1598 | ||
1599 | (define-public python2-testlib | |
1600 | (package-with-python2 python-testlib)) | |
1601 | ||
1602 | ;;; The software provided by this package was integrated into pytest 2.8. | |
1603 | (define-public python-pytest-cache | |
1604 | (package | |
1605 | (name "python-pytest-cache") | |
1606 | (version "1.0") | |
1607 | (source (origin | |
1608 | (method url-fetch) | |
1609 | (uri (pypi-uri "pytest-cache" version)) | |
1610 | (sha256 | |
1611 | (base32 | |
1612 | "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y")))) | |
1613 | (build-system python-build-system) | |
1614 | (propagated-inputs | |
1615 | `(("python-apipkg" ,python-apipkg) | |
1616 | ("python-execnet" ,python-execnet) | |
1617 | ("python-py" ,python-py) | |
1618 | ("python-pytest" ,python-pytest))) | |
1619 | (synopsis "Py.test plugin with mechanisms for caching across test runs") | |
1620 | (description "The pytest-cache plugin provides tools to rerun failures from | |
1621 | the last py.test invocation.") | |
1622 | (home-page "https://bitbucket.org/hpk42/pytest-cache/") | |
1623 | (license license:expat))) | |
1624 | ||
1625 | (define-public python2-pytest-cache | |
1626 | (package-with-python2 python-pytest-cache)) | |
1627 | ||
1628 | (define-public python-pytest-localserver | |
1629 | (package | |
1630 | (name "python-pytest-localserver") | |
74854d11 | 1631 | (version "0.5.0") |
ac257f12 | 1632 | (source (origin |
74854d11 EF |
1633 | (method url-fetch) |
1634 | (uri (pypi-uri "pytest-localserver" version)) | |
1635 | (sha256 | |
1636 | (base32 | |
1637 | "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s")))) | |
ac257f12 RW |
1638 | (build-system python-build-system) |
1639 | (arguments | |
45a2346f EF |
1640 | '(#:phases |
1641 | (modify-phases %standard-phases | |
ac257f12 RW |
1642 | (replace 'check |
1643 | (lambda _ | |
45a2346f | 1644 | (invoke "py.test" "-v")))))) |
ac257f12 RW |
1645 | (native-inputs |
1646 | `(("python-pytest" ,python-pytest) | |
1647 | ("python-requests" ,python-requests) | |
1648 | ("python-six" ,python-six))) | |
1649 | (propagated-inputs | |
1650 | `(("python-werkzeug" ,python-werkzeug))) | |
1651 | (synopsis "Py.test plugin to test server connections locally") | |
1652 | (description "Pytest-localserver is a plugin for the pytest testing | |
1653 | framework which enables you to test server connections locally.") | |
e85af137 | 1654 | (home-page "https://pypi.org/project/pytest-localserver/") |
ac257f12 RW |
1655 | (license license:expat))) |
1656 | ||
1657 | (define-public python-pytest-xprocess | |
1658 | (package | |
1659 | (name "python-pytest-xprocess") | |
1660 | (version "0.9.1") | |
1661 | (source (origin | |
1662 | (method url-fetch) | |
1663 | (uri (pypi-uri "pytest-xprocess" version)) | |
1664 | (sha256 | |
1665 | (base32 | |
1666 | "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp")))) | |
1667 | (build-system python-build-system) | |
1668 | (propagated-inputs | |
1669 | `(("python-pytest" ,python-pytest) | |
1670 | ("python-pytest-cache" ,python-pytest-cache) | |
1671 | ("python-psutil" ,python-psutil))) | |
1672 | (synopsis "Pytest plugin to manage external processes across test runs") | |
1673 | (description "Pytest-xprocess is an experimental py.test plugin for managing | |
1674 | processes across test runs.") | |
1675 | (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess") | |
1676 | (license license:expat))) | |
1677 | ||
1678 | (define-public python-pytest-subtesthack | |
1679 | (package | |
1680 | (name "python-pytest-subtesthack") | |
1681 | (version "0.1.1") | |
1682 | (source (origin | |
1683 | (method url-fetch) | |
1684 | (uri (pypi-uri "pytest-subtesthack" version)) | |
1685 | (sha256 | |
1686 | (base32 | |
1687 | "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x")))) | |
1688 | (build-system python-build-system) | |
1689 | (propagated-inputs | |
1690 | `(("python-pytest" ,python-pytest))) | |
1691 | (synopsis "Set-up and tear-down fixtures for unit tests") | |
1692 | (description "This plugin allows you to set up and tear down fixtures within | |
1693 | unit test functions that use @code{py.test}. This is useful for using | |
1694 | @command{hypothesis} inside py.test, as @command{hypothesis} will call the test | |
1695 | function multiple times, without setting up or tearing down fixture state as is | |
1696 | normally the case.") | |
1697 | (home-page "https://github.com/untitaker/pytest-subtesthack/") | |
1698 | (license license:unlicense))) | |
1699 | ||
1700 | (define-public python2-pytest-subtesthack | |
1701 | (package-with-python2 python-pytest-subtesthack)) | |
1702 | ||
7600513a CB |
1703 | (define-public python-pytest-sugar |
1704 | (package | |
1705 | (name "python-pytest-sugar") | |
1706 | (version "0.9.2") | |
1707 | (source | |
1708 | (origin | |
1709 | (method url-fetch) | |
1710 | (uri (pypi-uri "pytest-sugar" version)) | |
1711 | (sha256 | |
1712 | (base32 | |
1713 | "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w")))) | |
1714 | (build-system python-build-system) | |
1715 | (propagated-inputs | |
1716 | `(("python-packaging" ,python-packaging) | |
1717 | ("python-pytest" ,python-pytest) | |
1718 | ("python-termcolor" ,python-termcolor))) | |
1719 | (home-page "https://pivotfinland.com/pytest-sugar/") | |
1720 | (synopsis "Plugin for pytest that changes the default look and feel") | |
1721 | (description | |
1722 | "@code{pytest-sugar} is a plugin for py.test that changes the default | |
1723 | look and feel of py.test, using a progress bar and showing failures and errors | |
1724 | instantly.") | |
1725 | (license license:bsd-3))) | |
1726 | ||
ac257f12 RW |
1727 | (define-public python-hypothesis |
1728 | (package | |
1729 | (name "python-hypothesis") | |
916f1d55 | 1730 | (version "5.4.1") |
ac257f12 RW |
1731 | (source (origin |
1732 | (method url-fetch) | |
1733 | (uri (pypi-uri "hypothesis" version)) | |
1734 | (sha256 | |
1735 | (base32 | |
916f1d55 | 1736 | "0zn09bn6hadk4vxl6jy8bkjr5fz8mrhin3z46w7pq5qgbaycr89p")))) |
ac257f12 | 1737 | (build-system python-build-system) |
3b5378a8 MB |
1738 | (arguments |
1739 | ;; XXX: Tests are not distributed with the PyPI archive. | |
1740 | '(#:tests? #f)) | |
b19a960f AI |
1741 | (propagated-inputs |
1742 | `(("python-attrs" ,python-attrs-bootstrap) | |
3b5378a8 | 1743 | ("python-sortedcontainers" ,python-sortedcontainers))) |
ac257f12 RW |
1744 | (synopsis "Library for property based testing") |
1745 | (description "Hypothesis is a library for testing your Python code against a | |
1746 | much larger range of examples than you would ever want to write by hand. It’s | |
1747 | based on the Haskell library, Quickcheck, and is designed to integrate | |
1748 | seamlessly into your existing Python unit testing work flow.") | |
b19a960f | 1749 | (home-page "https://github.com/HypothesisWorks/hypothesis-python") |
ac257f12 RW |
1750 | (license license:mpl2.0) |
1751 | (properties `((python2-variant . ,(delay python2-hypothesis)))))) | |
1752 | ||
3b5378a8 | 1753 | ;; This is the last version of Hypothesis that supports Python 2. |
ac257f12 RW |
1754 | (define-public python2-hypothesis |
1755 | (let ((hypothesis (package-with-python2 | |
1756 | (strip-python2-variant python-hypothesis)))) | |
1757 | (package (inherit hypothesis) | |
3b5378a8 MB |
1758 | (version "4.57.1") |
1759 | (source (origin | |
1760 | (method url-fetch) | |
1761 | (uri (pypi-uri "hypothesis" version)) | |
1762 | (sha256 | |
1763 | (base32 | |
1764 | "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw")))) | |
ac257f12 RW |
1765 | (propagated-inputs |
1766 | `(("python2-enum34" ,python2-enum34) | |
1767 | ,@(package-propagated-inputs hypothesis)))))) | |
1768 | ||
1769 | (define-public python-lit | |
1770 | (package | |
1771 | (name "python-lit") | |
8c2781f0 | 1772 | (version "0.5.1") |
ac257f12 RW |
1773 | (source |
1774 | (origin | |
1775 | (method url-fetch) | |
1776 | (uri (pypi-uri "lit" version)) | |
1777 | (sha256 | |
1778 | (base32 | |
8c2781f0 | 1779 | "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97")))) |
ac257f12 | 1780 | (build-system python-build-system) |
39afd2a8 DM |
1781 | (arguments |
1782 | `(#:phases | |
1783 | (modify-phases %standard-phases | |
1784 | (replace 'check | |
1785 | (lambda _ | |
40899635 | 1786 | (invoke "python" "lit.py" "tests")))))) |
39afd2a8 | 1787 | (native-inputs |
40899635 | 1788 | `(("llvm" ,llvm))) |
ac97dce1 | 1789 | (home-page "https://llvm.org/") |
ac257f12 RW |
1790 | (synopsis "LLVM Software Testing Tool") |
1791 | (description "@code{lit} is a portable tool for executing LLVM and Clang | |
1792 | style test suites, summarizing their results, and providing indication of | |
1793 | failures.") | |
1794 | (license license:ncsa))) | |
1795 | ||
1796 | (define-public python2-lit | |
1797 | (package-with-python2 python-lit)) | |
1798 | ||
1799 | (define-public python-pytest-pep8 | |
1800 | (package | |
1801 | (name "python-pytest-pep8") | |
1802 | (version "1.0.6") | |
1803 | (source (origin | |
1804 | (method url-fetch) | |
1805 | (uri (pypi-uri "pytest-pep8" version)) | |
1806 | (sha256 | |
1807 | (base32 | |
1808 | "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3")))) | |
1809 | (build-system python-build-system) | |
1810 | (arguments | |
1811 | `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12. | |
1812 | (native-inputs | |
1813 | `(("python-pytest" ,python-pytest))) | |
1814 | (propagated-inputs | |
1815 | `(("python-pep8" ,python-pep8))) | |
1816 | (home-page "https://bitbucket.org/pytest-dev/pytest-pep8") | |
1817 | (synopsis "Py.test plugin to check PEP8 requirements") | |
1818 | (description "Pytest plugin for checking PEP8 compliance.") | |
1819 | (license license:expat))) | |
1820 | ||
1821 | (define-public python2-pytest-pep8 | |
1822 | (package-with-python2 python-pytest-pep8)) | |
1823 | ||
1824 | (define-public python-pytest-flakes | |
1825 | (package | |
1826 | (name "python-pytest-flakes") | |
1827 | (version "1.0.1") | |
1828 | (source (origin | |
1829 | (method url-fetch) | |
1830 | (uri (pypi-uri "pytest-flakes" version)) | |
1831 | (sha256 | |
1832 | (base32 | |
1833 | "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw")))) | |
1834 | (build-system python-build-system) | |
1835 | (arguments | |
1836 | `(#:phases | |
1837 | (modify-phases %standard-phases | |
1838 | (delete 'check) | |
1839 | (add-after 'install 'check | |
1840 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
1841 | ;; It's easier to run tests after install. | |
1842 | ;; Make installed package available for running the tests | |
1843 | (add-installed-pythonpath inputs outputs) | |
29594404 | 1844 | (invoke "py.test" "-vv")))))) |
ac257f12 RW |
1845 | (native-inputs |
1846 | `(("python-coverage" ,python-coverage) | |
1847 | ("python-pytest" ,python-pytest) | |
1848 | ("python-pytest-cache" ,python-pytest-cache) | |
1849 | ("python-pytest-pep8" ,python-pytest-pep8))) | |
1850 | (propagated-inputs | |
1851 | `(("python-pyflakes" ,python-pyflakes))) | |
1852 | (home-page "https://github.com/fschulze/pytest-flakes") | |
1853 | (synopsis "Py.test plugin to check source code with pyflakes") | |
1854 | (description "Pytest plugin for checking Python source code with pyflakes.") | |
1855 | (license license:expat))) | |
1856 | ||
1857 | (define-public python2-pytest-flakes | |
1858 | (package-with-python2 python-pytest-flakes)) | |
1859 | ||
1860 | (define-public python2-coverage-test-runner | |
1861 | (package | |
1862 | (name "python2-coverage-test-runner") | |
6a46a06c | 1863 | (version "1.15") |
ac257f12 RW |
1864 | (source |
1865 | (origin | |
1866 | (method url-fetch) | |
1867 | (uri (string-append | |
1868 | "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/" | |
1869 | "coverage-test-runner/snapshot/coverage-test-runner-" | |
1870 | version ".tar.gz")) | |
1871 | (sha256 | |
1872 | (base32 | |
6a46a06c | 1873 | "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny")))) |
ac257f12 RW |
1874 | (build-system python-build-system) |
1875 | (arguments | |
1876 | `(#:python ,python-2 | |
1877 | #:phases | |
1878 | (modify-phases %standard-phases | |
1879 | (replace 'check | |
1880 | (lambda _ | |
29594404 | 1881 | (invoke "./testrun")))))) |
ac257f12 RW |
1882 | (propagated-inputs |
1883 | `(("python2-coverage" ,python2-coverage))) | |
1884 | (home-page "https://liw.fi/coverage-test-runner/") | |
1885 | (synopsis "Python module for running unit tests") | |
1886 | (description "@code{CoverageTestRunner} is a python module for running | |
1887 | unit tests and failing them if the unit test module does not exercise all | |
1888 | statements in the module it tests.") | |
1889 | (license license:gpl3+))) | |
1890 | ||
10511c41 MO |
1891 | ;; Further releases, up to 2.4.3, have failing unit tests. See: |
1892 | ;; https://github.com/PyCQA/pylint/issues/3198. | |
ac257f12 RW |
1893 | (define-public python-pylint |
1894 | (package | |
1895 | (name "python-pylint") | |
10511c41 | 1896 | (version "2.3.1") |
ac257f12 RW |
1897 | (source |
1898 | (origin | |
10511c41 MO |
1899 | (method git-fetch) |
1900 | (uri (git-reference | |
1901 | (url "https://github.com/PyCQA/pylint") | |
1902 | (commit (string-append "pylint-" version)))) | |
1903 | (file-name (git-file-name name version)) | |
ac257f12 RW |
1904 | (sha256 |
1905 | (base32 | |
10511c41 | 1906 | "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z")))) |
ac257f12 RW |
1907 | (build-system python-build-system) |
1908 | (native-inputs | |
1909 | `(("python-pytest" ,python-pytest) | |
1910 | ("python-pytest-runner" ,python-pytest-runner) | |
1911 | ("python-tox" ,python-tox))) | |
1912 | (propagated-inputs | |
1913 | `(("python-astroid" ,python-astroid) | |
1914 | ("python-isort" ,python-isort) | |
1915 | ("python-mccabe" ,python-mccabe) | |
1916 | ("python-six" ,python-six))) | |
ac257f12 RW |
1917 | (home-page "https://github.com/PyCQA/pylint") |
1918 | (synopsis "Python source code analyzer which looks for coding standard | |
1919 | errors") | |
1920 | (description "Pylint is a Python source code analyzer which looks | |
1921 | for programming errors, helps enforcing a coding standard and sniffs | |
1922 | for some code smells (as defined in Martin Fowler's Refactoring book). | |
1923 | ||
1924 | Pylint has many rules enabled by default, way too much to silence them | |
1925 | all on a minimally sized program. It's highly configurable and handle | |
1926 | pragmas to control it from within your code. Additionally, it is | |
1927 | possible to write plugins to add your own checks.") | |
1928 | (properties `((python2-variant . ,(delay python2-pylint)))) | |
1929 | (license license:gpl2+))) | |
1930 | ||
74c1a561 MO |
1931 | ;; Python2 is not supported anymore by Pylint. See: |
1932 | ;; https://github.com/PyCQA/pylint/issues/1763. | |
ac257f12 RW |
1933 | (define-public python2-pylint |
1934 | (let ((pylint (package-with-python2 | |
74c1a561 | 1935 | (strip-python2-variant python-pylint)))) |
ac257f12 | 1936 | (package (inherit pylint) |
06323c8e | 1937 | (version "1.9.5") |
74c1a561 MO |
1938 | (source |
1939 | (origin | |
1940 | (method git-fetch) | |
1941 | (uri (git-reference | |
1942 | (url "https://github.com/PyCQA/pylint") | |
1943 | (commit (string-append "pylint-" version)))) | |
1944 | (file-name (git-file-name (package-name pylint) version)) | |
1945 | (sha256 | |
1946 | (base32 | |
06323c8e | 1947 | "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2")))) |
74c1a561 MO |
1948 | (arguments |
1949 | `(,@(package-arguments pylint) | |
1950 | #:phases | |
1951 | (modify-phases %standard-phases | |
1952 | (replace 'check | |
1953 | (lambda _ | |
1954 | ;; Somehow, tests fail if run from the build directory. | |
1955 | (let ((work "/tmp/work")) | |
1956 | (mkdir-p work) | |
1957 | (setenv "PYTHONPATH" | |
1958 | (string-append (getenv "PYTHONPATH") ":" work)) | |
1959 | (copy-recursively "." work) | |
1960 | (with-directory-excursion "/tmp" | |
1961 | (invoke "python" "-m" "unittest" "discover" | |
1962 | "-s" (string-append work "/pylint/test") | |
1963 | "-p" "*test_*.py")))))))) | |
1964 | (native-inputs | |
1965 | `(("python2-futures" ,python2-futures) | |
1966 | ,@(package-native-inputs pylint))) | |
ac257f12 RW |
1967 | (propagated-inputs |
1968 | `(("python2-backports-functools-lru-cache" | |
1969 | ,python2-backports-functools-lru-cache) | |
1970 | ("python2-configparser" ,python2-configparser) | |
1971 | ,@(package-propagated-inputs pylint)))))) | |
1972 | ||
1973 | (define-public python-paramunittest | |
1974 | (package | |
1975 | (name "python-paramunittest") | |
1976 | (version "0.2") | |
1977 | (source | |
1978 | (origin | |
1979 | (method url-fetch) | |
1980 | (uri (pypi-uri "ParamUnittest" version)) | |
1981 | (sha256 | |
1982 | (base32 | |
1983 | "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1")))) | |
1984 | (build-system python-build-system) | |
1985 | (home-page | |
1986 | "https://github.com/rik0/ParamUnittest") | |
1987 | (synopsis | |
1988 | "Simple extension to have parametrized unit tests") | |
1989 | (description | |
4d72d02b VC |
1990 | "This package creates parameterized unit-tests that work with the standard |
1991 | unittest package. A parameterized test case is automatically converted to multiple test | |
ac257f12 RW |
1992 | cases. Since they are TestCase subclasses, they work with other test suites that |
1993 | recognize TestCases.") | |
1994 | (license license:bsd-2))) | |
1995 | ||
1996 | (define-public python2-python-paramunittest | |
1997 | (package-with-python2 python-paramunittest)) | |
1998 | ||
1999 | (define-public python-pytest-warnings | |
2000 | (package | |
2001 | (name "python-pytest-warnings") | |
2002 | (version "0.2.0") | |
2003 | (source | |
2004 | (origin | |
2005 | (method url-fetch) | |
2006 | (uri (pypi-uri "pytest-warnings" version)) | |
2007 | (sha256 | |
2008 | (base32 | |
2009 | "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g")))) | |
2010 | (build-system python-build-system) | |
2011 | (propagated-inputs | |
2dd12924 | 2012 | `(("pytest" ,python-pytest))) |
ac257f12 RW |
2013 | (home-page "https://github.com/fschulze/pytest-warnings") |
2014 | (synopsis "Pytest plugin to list Python warnings in pytest report") | |
2015 | (description | |
2016 | "Python-pytest-warnings is a pytest plugin to list Python warnings in | |
2017 | pytest report.") | |
29f25f29 MB |
2018 | (license license:expat) |
2019 | (properties `((python2-variant . ,(delay python2-pytest-warnings)) | |
2020 | ;; This package is part of pytest as of version 3.1.0. | |
2021 | (superseded . ,python-pytest))))) | |
ac257f12 RW |
2022 | |
2023 | (define-public python2-pytest-warnings | |
29f25f29 MB |
2024 | (package (inherit (package-with-python2 |
2025 | (strip-python2-variant python-pytest-warnings))) | |
2026 | (properties `((superseded . ,python2-pytest))))) | |
ac257f12 RW |
2027 | |
2028 | (define-public python-pytest-capturelog | |
2029 | (package | |
2030 | (name "python-pytest-capturelog") | |
2031 | (version "0.7") | |
2032 | (source | |
2033 | (origin | |
2034 | (method url-fetch) | |
2035 | (uri (pypi-uri "pytest-capturelog" version ".tar.gz")) | |
2036 | (sha256 | |
2037 | (base32 | |
2038 | "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n")))) | |
2039 | (build-system python-build-system) | |
2040 | (propagated-inputs | |
2dd12924 | 2041 | `(("pytest" ,python-pytest))) |
a7f27da7 | 2042 | (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview") |
ac257f12 RW |
2043 | (synopsis "Pytest plugin to catch log messages") |
2044 | (description | |
2045 | "Python-pytest-catchlog is a pytest plugin to catch log messages.") | |
2046 | (license license:expat))) | |
2047 | ||
2048 | (define-public python2-pytest-capturelog | |
2049 | (package-with-python2 python-pytest-capturelog)) | |
2050 | ||
2051 | (define-public python-pytest-catchlog | |
2052 | (package | |
2053 | (name "python-pytest-catchlog") | |
2054 | (version "1.2.2") | |
2055 | (source | |
2056 | (origin | |
2057 | (method url-fetch) | |
2058 | (uri (pypi-uri "pytest-catchlog" version ".zip")) | |
2059 | (sha256 | |
2060 | (base32 | |
2061 | "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab")))) | |
2062 | (build-system python-build-system) | |
2063 | (native-inputs | |
2064 | `(("unzip" ,unzip))) | |
2065 | (propagated-inputs | |
2dd12924 | 2066 | `(("pytest" ,python-pytest))) |
ac257f12 RW |
2067 | (home-page "https://github.com/eisensheng/pytest-catchlog") |
2068 | (synopsis "Pytest plugin to catch log messages") | |
2069 | (description | |
2070 | "Python-pytest-catchlog is a pytest plugin to catch log messages. This is | |
2071 | a fork of pytest-capturelog.") | |
2072 | (license license:expat))) | |
2073 | ||
2074 | (define-public python2-pytest-catchlog | |
2075 | (package-with-python2 python-pytest-catchlog)) | |
2076 | ||
2077 | (define-public python-nosexcover | |
2078 | (package | |
2079 | (name "python-nosexcover") | |
2080 | (version "1.0.11") | |
2081 | (source (origin | |
2082 | (method url-fetch) | |
2083 | (uri (pypi-uri "nosexcover" version)) | |
2084 | (sha256 | |
2085 | (base32 | |
2086 | "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319")))) | |
2087 | (build-system python-build-system) | |
2088 | (propagated-inputs | |
2089 | `(("python-coverage" ,python-coverage) | |
2090 | ("python-nose" ,python-nose))) | |
2091 | (home-page "http://github.com/cmheisel/nose-xcover") | |
2092 | (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports") | |
2093 | (description "Nose-xcover is a companion to the built-in | |
2094 | @code{nose.plugins.cover}. This plugin will write out an XML coverage report | |
2095 | to a file named coverage.xml. | |
2096 | ||
2097 | It will honor all the options you pass to the Nose coverage plugin, | |
2098 | especially -cover-package.") | |
2099 | (license license:expat))) | |
2100 | ||
2101 | (define-public python2-nosexcover | |
2102 | (package-with-python2 python-nosexcover)) | |
2103 | ||
2104 | (define-public python-discover | |
2105 | (package | |
2106 | (name "python-discover") | |
2107 | (version "0.4.0") | |
2108 | (source | |
2109 | (origin | |
2110 | (method url-fetch) | |
415ae330 | 2111 | (uri (pypi-uri "discover" version)) |
ac257f12 RW |
2112 | (sha256 |
2113 | (base32 | |
2114 | "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5")))) | |
2115 | (build-system python-build-system) | |
e85af137 | 2116 | (home-page "https://pypi.org/project/discover/") |
ac257f12 RW |
2117 | (synopsis |
2118 | "Python test discovery for unittest") | |
2119 | (description | |
2120 | "Discover provides test discovery for unittest, a feature that has been | |
2121 | backported from Python 2.7 for Python 2.4+.") | |
2122 | (license license:bsd-3))) | |
2123 | ||
2124 | (define-public python2-discover | |
2125 | (package-with-python2 python-discover)) | |
2126 | ||
2127 | (define-public behave | |
2128 | (package | |
2129 | (name "behave") | |
eddb9dac | 2130 | (version "1.2.6") |
ac257f12 RW |
2131 | (source (origin |
2132 | (method url-fetch) | |
eddb9dac | 2133 | (uri (pypi-uri "behave" version)) |
ac257f12 RW |
2134 | (sha256 |
2135 | (base32 | |
a8cb1e72 CB |
2136 | "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr")) |
2137 | (patches (search-patches | |
2138 | "behave-skip-a-couple-of-tests.patch")))) | |
ac257f12 | 2139 | (build-system python-build-system) |
1e257d3d KK |
2140 | (native-inputs |
2141 | `(("python-mock" ,python-mock) | |
2142 | ("python-nose" ,python-nose) | |
eddb9dac MB |
2143 | ("python-pathpy" ,python-pathpy) |
2144 | ("python-pyhamcrest" ,python-pyhamcrest) | |
2145 | ("python-pytest" ,python-pytest))) | |
ac257f12 | 2146 | (propagated-inputs |
037bef7d DM |
2147 | `(("python-importlib-metadata" ,python-importlib-metadata) |
2148 | ("python-six" ,python-six) | |
ac257f12 RW |
2149 | ("python-parse" ,python-parse) |
2150 | ("python-parse-type" ,python-parse-type))) | |
1e257d3d | 2151 | (arguments |
74471036 JL |
2152 | '(#:test-target "behave_test" |
2153 | #:phases | |
2154 | (modify-phases %standard-phases | |
2155 | (add-before 'check 'fix-library-loading | |
2156 | (lambda _ | |
2157 | ;; Otherwise, tests fail with no module named 'path' | |
2158 | (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":" | |
2159 | (getcwd) "/tasks/_vendor")) | |
2160 | #t))))) | |
ac257f12 RW |
2161 | (home-page "https://github.com/behave/behave") |
2162 | (synopsis "Python behavior-driven development") | |
2163 | (description | |
2164 | "Behave is a tool for behavior-driven development in python. | |
2165 | Behavior-driven development (or BDD) is an agile software development | |
2166 | technique that encourages collaboration between developers, QA and | |
2167 | non-technical or business participants in a software project. Behave uses | |
2168 | tests written in a natural language style, backed up by Python code.") | |
2169 | (license license:x11))) | |
2170 | ||
2171 | (define-public python-behave-web-api | |
2172 | (package | |
2173 | (name "python-behave-web-api") | |
2174 | (version "1.0.6") | |
2175 | (source | |
2176 | (origin | |
2177 | (method url-fetch) | |
2178 | (uri (pypi-uri "behave-web-api" version)) | |
2179 | (sha256 | |
2180 | (base32 | |
2181 | "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19")))) | |
2182 | (build-system python-build-system) | |
2183 | (arguments | |
2184 | `(#:phases | |
2185 | (modify-phases %standard-phases | |
2186 | (add-after 'unpack 'fix-dependencies | |
2187 | (lambda _ | |
2188 | (substitute* "setup.py" | |
2189 | (("'wheel'") "") ; We don't use it. | |
29594404 MW |
2190 | (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in. |
2191 | #t))))) | |
ac257f12 RW |
2192 | (propagated-inputs |
2193 | `(("behave" ,behave) | |
2194 | ("python-requests" ,python-requests))) | |
2195 | (home-page "https://github.com/jefersondaniel/behave-web-api") | |
2196 | (synopsis "Provides testing for JSON APIs with Behave for Python") | |
2197 | (description "This package provides testing utility modules for testing | |
2198 | JSON APIs with Behave.") | |
2199 | (license license:expat))) | |
2200 | ||
2201 | (define-public python2-behave-web-api | |
2202 | (package-with-python2 python-behave-web-api)) | |
2203 | ||
2204 | (define-public python-rednose | |
2205 | (package | |
2206 | (name "python-rednose") | |
a431b035 | 2207 | (version "1.2.3") |
ac257f12 RW |
2208 | (source |
2209 | (origin | |
2210 | (method url-fetch) | |
2211 | (uri (pypi-uri "rednose" version)) | |
2212 | (sha256 | |
2213 | (base32 | |
a431b035 | 2214 | "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h")))) |
ac257f12 | 2215 | (build-system python-build-system) |
c2f0e5a4 MB |
2216 | (arguments |
2217 | `(#:phases (modify-phases %standard-phases | |
2218 | (add-after 'unpack 'patch-setup.py | |
2219 | (lambda _ | |
2220 | ;; Six is only required for tests and later versions | |
2221 | ;; work fine. | |
2222 | (substitute* "setup.py" | |
2223 | (("six==1.10.0") "six")) | |
2224 | #t))))) | |
ac257f12 RW |
2225 | (propagated-inputs |
2226 | `(("python-colorama" ,python-colorama) | |
2227 | ("python-termstyle" ,python-termstyle))) | |
2228 | (native-inputs | |
2229 | `(("python-six" ,python-six) | |
2230 | ("python-nose" ,python-nose))) | |
2231 | (home-page "https://github.com/JBKahn/rednose") | |
2232 | (synopsis "Colored output for Python nosetests") | |
2233 | (description "This package provides colored output for the | |
2234 | @command{nosetests} command of the Python Nose unit test framework.") | |
2235 | (license license:bsd-3))) | |
2236 | ||
2237 | (define-public python2-rednose | |
2238 | (package-with-python2 python-rednose)) | |
2239 | ||
e68321a6 VC |
2240 | (define-public python-nose-random |
2241 | (package | |
2242 | (name "python-nose-random") | |
2243 | (version "1.0.0") | |
2244 | (source | |
2245 | (origin | |
2246 | (method git-fetch) | |
2247 | (uri (git-reference | |
2248 | (url "https://github.com/fzumstein/nose-random") | |
2249 | (commit version))) | |
2250 | (file-name (git-file-name name version)) | |
2251 | (sha256 | |
2252 | (base32 | |
2253 | "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2")))) | |
2254 | (build-system python-build-system) | |
2255 | (native-inputs | |
2256 | `(("python-nose" ,python-nose))) | |
2257 | (home-page "https://github.com/fzumstein/nose-random") | |
2258 | (synopsis "Nose plugin to facilitate randomized unit testing with | |
2259 | Python") | |
2260 | (description "Python nose-random is designed to facilitate | |
2261 | Monte-Carlo style unit testing. The idea is to improve testing by | |
2262 | running your code against a large number of randomly generated input | |
2263 | scenarios.") | |
2264 | (license license:expat))) | |
2265 | ||
ac257f12 RW |
2266 | (define-public python-nose-randomly |
2267 | (package | |
2268 | (name "python-nose-randomly") | |
9a0765aa | 2269 | (version "1.2.6") |
ac257f12 RW |
2270 | (source |
2271 | (origin | |
2272 | (method url-fetch) | |
2273 | (uri (pypi-uri "nose-randomly" version)) | |
2274 | (sha256 | |
9a0765aa | 2275 | (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y")))) |
ac257f12 RW |
2276 | (build-system python-build-system) |
2277 | (native-inputs | |
2278 | `(("python-nose" ,python-nose) | |
2279 | ("python-numpy" ,python-numpy))) | |
2280 | (home-page "https://github.com/adamchainz/nose-randomly") | |
2281 | (synopsis | |
2282 | "Nose plugin to randomly order tests and control random.seed") | |
2283 | (description | |
2284 | "This is a @code{Nose} plugin to randomly order tests which can be quite | |
2285 | powerful in discovering hidden flaws in the tests themselves, while helping to | |
2286 | reduce inter-test dependencies. It also helps in controlling @code{random.seed}, | |
2287 | by resetting it to a repeatable number for each test, enabling the tests to | |
2288 | create data based on random numbers and yet remain repeatable.") | |
2289 | (license license:bsd-3))) | |
2290 | ||
2291 | (define-public python2-nose-randomly | |
2292 | (package-with-python2 python-nose-randomly)) | |
2293 | ||
2294 | (define-public python-nose-timer | |
2295 | (package | |
2296 | (name "python-nose-timer") | |
9b241d4c | 2297 | (version "0.7.5") |
ac257f12 RW |
2298 | (source |
2299 | (origin | |
2300 | (method url-fetch) | |
2301 | (uri (pypi-uri "nose-timer" version)) | |
ac257f12 | 2302 | (sha256 |
9b241d4c | 2303 | (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4")))) |
ac257f12 RW |
2304 | (build-system python-build-system) |
2305 | (propagated-inputs | |
2306 | `(("python-nose" ,python-nose) | |
2307 | ("python-termcolor" ,python-termcolor))) | |
2308 | (home-page "https://github.com/mahmoudimus/nose-timer") | |
2309 | (synopsis "Timer plugin for nosetests") | |
2310 | (description "Shows how much time was needed to run individual tests.") | |
2311 | (license license:expat))) | |
2312 | ||
2313 | (define-public python2-nose-timer | |
2314 | (package-with-python2 python-nose-timer)) | |
762b5a89 RW |
2315 | |
2316 | (define-public python-freezegun | |
2317 | (package | |
2318 | (name "python-freezegun") | |
0eb2ce12 | 2319 | (version "0.3.14") |
762b5a89 RW |
2320 | (source |
2321 | (origin | |
2322 | (method url-fetch) | |
2323 | (uri (pypi-uri "freezegun" version)) | |
2324 | (sha256 | |
0eb2ce12 | 2325 | (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2")))) |
762b5a89 RW |
2326 | (build-system python-build-system) |
2327 | (native-inputs | |
2328 | `(("python-mock" ,python-mock) | |
4e24e442 | 2329 | ("python-pytest" ,python-pytest))) |
762b5a89 RW |
2330 | (propagated-inputs |
2331 | `(("python-six" ,python-six) | |
2332 | ("python-dateutil" ,python-dateutil))) | |
2333 | (arguments | |
2334 | `(#:phases | |
2335 | (modify-phases %standard-phases | |
2336 | ;; The tests are normally executed via `make test`, but the PyPi | |
2337 | ;; package does not include the Makefile. | |
2338 | (replace 'check | |
2339 | (lambda _ | |
4e24e442 | 2340 | (invoke "pytest" "-vv")))))) |
762b5a89 RW |
2341 | (home-page "https://github.com/spulec/freezegun") |
2342 | (synopsis "Test utility for mocking the datetime module") | |
2343 | (description | |
2344 | "FreezeGun is a library that allows your python tests to travel through | |
2345 | time by mocking the datetime module.") | |
2346 | (license license:asl2.0))) | |
2347 | ||
2348 | (define-public python2-freezegun | |
2349 | (package-with-python2 python-freezegun)) | |
2350 | ||
2351 | (define-public python-flexmock | |
2352 | (package | |
2353 | (name "python-flexmock") | |
9bec3ba4 | 2354 | (version "0.10.4") |
762b5a89 RW |
2355 | (source (origin |
2356 | (method url-fetch) | |
2357 | (uri (pypi-uri "flexmock" version)) | |
2358 | (sha256 | |
2359 | (base32 | |
9bec3ba4 | 2360 | "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh")))) |
762b5a89 RW |
2361 | (build-system python-build-system) |
2362 | (home-page "https://flexmock.readthedocs.org") | |
2363 | (synopsis "Testing library for Python") | |
2364 | (description | |
2365 | "flexmock is a testing library for Python that makes it easy to create | |
2366 | mocks, stubs and fakes.") | |
2367 | (license license:bsd-3))) | |
2368 | ||
2369 | (define-public python2-flexmock | |
2370 | (package-with-python2 python-flexmock)) | |
2371 | ||
2372 | (define-public python-flaky | |
2373 | (package | |
2374 | (name "python-flaky") | |
eba8a00d | 2375 | (version "3.5.3") |
762b5a89 RW |
2376 | (source (origin |
2377 | (method url-fetch) | |
2378 | (uri (pypi-uri "flaky" version)) | |
2379 | (sha256 | |
2380 | (base32 | |
eba8a00d | 2381 | "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j")))) |
762b5a89 RW |
2382 | (build-system python-build-system) |
2383 | (arguments | |
2384 | ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet. | |
2385 | '(#:tests? #f)) | |
2386 | (home-page "https://github.com/box/flaky") | |
2387 | (synopsis "Automatically rerun flaky tests") | |
2388 | (description | |
2389 | "Flaky is a plugin for @code{nose} or @code{py.test} that automatically | |
2390 | reruns flaky tests. | |
2391 | ||
2392 | Ideally, tests reliably pass or fail, but sometimes test fixtures must rely | |
2393 | on components that aren't 100% reliable. With flaky, instead of removing | |
2394 | those tests or marking them to @code{@@skip}, they can be automatically | |
2395 | retried.") | |
2396 | (license license:asl2.0))) | |
2397 | ||
2398 | (define-public python2-flaky | |
2399 | (package-with-python2 python-flaky)) | |
18a4d6df FT |
2400 | |
2401 | (define-public python-pyhamcrest | |
d08482f0 MB |
2402 | ;; The latest release was in 2016 and its test suite does not work with recent |
2403 | ;; versions of Pytest. Just take the master branch for now, which seems stable. | |
2404 | (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2") | |
2405 | (revision "0")) | |
2406 | (package | |
2407 | (name "python-pyhamcrest") | |
2408 | (version (git-version "1.9.0" revision commit)) | |
2409 | (source (origin | |
2410 | ;; Tests not distributed from pypi release. | |
2411 | (method git-fetch) | |
2412 | (uri (git-reference | |
2413 | (url "https://github.com/hamcrest/PyHamcrest") | |
2414 | (commit commit))) | |
2415 | (file-name (git-file-name name version)) | |
2416 | (sha256 | |
2417 | (base32 | |
2418 | "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3")))) | |
2419 | (native-inputs ;all native inputs are for tests | |
2420 | `(("python-pytest-cov" ,python-pytest-cov) | |
2421 | ("python-mock" ,python-mock) | |
2422 | ("python-pytest" ,python-pytest) | |
2423 | ("python-hypothesis" ,python-hypothesis))) | |
2424 | (propagated-inputs | |
2425 | `(("python-six" ,python-six))) | |
2426 | (build-system python-build-system) | |
2427 | (arguments | |
2428 | `(#:phases (modify-phases %standard-phases | |
2429 | (replace 'check | |
2430 | (lambda _ | |
2431 | (setenv "PYTHONPATH" | |
2432 | (string-append "build/lib:" | |
2433 | (getenv "PYTHONPATH"))) | |
2434 | (invoke "pytest" "-vv")))))) | |
2435 | (home-page "http://hamcrest.org/") | |
2436 | (synopsis "Hamcrest matchers for Python") | |
2437 | (description | |
2438 | "PyHamcrest is a framework for writing matcher objects, | |
18a4d6df | 2439 | allowing you to declaratively define \"match\" rules.") |
d08482f0 | 2440 | (license license:bsd-3)))) |
18a4d6df FT |
2441 | |
2442 | (define-public python2-pyhamcrest | |
2443 | (package-with-python2 python-pyhamcrest)) | |
bebe3a4f FT |
2444 | |
2445 | (define-public unittest-cpp | |
2446 | (package | |
2447 | (name "unittest-cpp") | |
2448 | (version "2.0.0") | |
2449 | (source (origin | |
8aedb3ad EF |
2450 | (method git-fetch) |
2451 | (uri (git-reference | |
2452 | (url "https://github.com/unittest-cpp/unittest-cpp") | |
2453 | (commit (string-append "v" version)))) | |
2454 | (file-name (git-file-name name version)) | |
bebe3a4f | 2455 | (sha256 |
8aedb3ad | 2456 | (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i")))) |
bebe3a4f FT |
2457 | (arguments |
2458 | `(#:tests? #f)) ; It's run after build automatically. | |
2459 | (build-system cmake-build-system) | |
2460 | (home-page "https://github.com/unittest-cpp/unittest-cpp") | |
2461 | (synopsis "Lightweight unit testing framework for C++") | |
2462 | (description "UnitTest++ is a lightweight unit testing framework for C++. | |
2463 | It was designed to do test-driven development on a wide variety of platforms. | |
2464 | Simplicity, portability, speed, and small footprint are all very important | |
2465 | aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use | |
2466 | of advanced library and language features, which means it should be easily | |
2467 | portable to just about any platform.") | |
2468 | (license license:expat))) | |
85b28320 LC |
2469 | |
2470 | (define-public libfaketime | |
2471 | (package | |
2472 | (name "libfaketime") | |
c021c432 | 2473 | (version "0.9.8") |
85b28320 LC |
2474 | (home-page "https://github.com/wolfcw/libfaketime") |
2475 | (source (origin | |
2476 | (method git-fetch) | |
2477 | (uri (git-reference | |
2478 | (url home-page) | |
2479 | (commit (string-append "v" version)))) | |
2480 | (sha256 | |
2481 | (base32 | |
c021c432 | 2482 | "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc")) |
85b28320 LC |
2483 | (file-name (git-file-name name version)))) |
2484 | (build-system gnu-build-system) | |
2485 | (arguments | |
2486 | '(#:phases (modify-phases %standard-phases | |
2487 | (replace 'configure | |
2488 | (lambda* (#:key outputs #:allow-other-keys) | |
2489 | (let ((out (assoc-ref outputs "out"))) | |
2490 | (setenv "CC" "gcc") | |
2491 | (setenv "PREFIX" out) | |
f09948fd MB |
2492 | |
2493 | ;; XXX: Without this flag, the CLOCK_REALTIME test hangs | |
2494 | ;; indefinitely. See README.packagers for more information. | |
2495 | ;; Try removing this for future versions of libfaketime. | |
2496 | (setenv "FAKETIME_COMPILE_CFLAGS" "-DFORCE_MONOTONIC_FIX") | |
2497 | ||
85b28320 LC |
2498 | #t))) |
2499 | (add-before 'check 'pre-check | |
2500 | (lambda _ | |
2501 | (substitute* "test/functests/test_exclude_mono.sh" | |
2502 | (("/bin/bash") (which "bash"))) | |
fedce7b2 MB |
2503 | |
2504 | ;; Do not fail due to use of 'ftime', which was deprecated in | |
2505 | ;; glibc 2.31. Remove this for later versions of libfaketime. | |
2506 | (setenv "FAKETIME_COMPILE_CFLAGS" "-Wno-deprecated-declarations") | |
85b28320 LC |
2507 | #t))) |
2508 | #:test-target "test")) | |
2509 | (native-inputs | |
2510 | `(("perl" ,perl))) ;for tests | |
2511 | (synopsis "Fake the system time for single applications") | |
2512 | (description | |
2513 | "The libfaketime library allows users to modify the system time that an | |
2514 | application \"sees\". It is meant to be loaded using the dynamic linker's | |
2515 | @code{LD_PRELOAD} environment variable. The @command{faketime} command | |
2516 | provides a simple way to achieve this.") | |
2517 | (license license:gpl2))) | |
bd9d3db6 RW |
2518 | |
2519 | (define-public umockdev | |
2520 | (package | |
2521 | (name "umockdev") | |
abab956b | 2522 | (version "0.13.2") |
bd9d3db6 RW |
2523 | (source (origin |
2524 | (method url-fetch) | |
2525 | (uri (string-append "https://github.com/martinpitt/umockdev/" | |
2526 | "releases/download/" version "/" | |
2527 | "umockdev-" version ".tar.xz")) | |
2528 | (sha256 | |
2529 | (base32 | |
abab956b | 2530 | "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74")))) |
bd9d3db6 RW |
2531 | (build-system gnu-build-system) |
2532 | (arguments | |
2533 | `(#:phases | |
2534 | (modify-phases %standard-phases | |
135c1e0e | 2535 | (add-after 'unpack 'fix-test |
bd9d3db6 RW |
2536 | (lambda _ |
2537 | (substitute* "tests/test-umockdev.c" | |
135c1e0e | 2538 | (("/run") "/tmp")) |
bd9d3db6 RW |
2539 | #t))))) |
2540 | (native-inputs | |
2541 | `(("vala" ,vala) | |
bd9d3db6 | 2542 | ("gtk-doc" ,gtk-doc) |
abab956b TGR |
2543 | ("pkg-config" ,pkg-config) |
2544 | ||
2545 | ;; For tests. | |
2546 | ("python" ,python) | |
2547 | ("which" ,which))) | |
bd9d3db6 RW |
2548 | (inputs |
2549 | `(("glib" ,glib) | |
2550 | ("eudev" ,eudev) | |
135c1e0e | 2551 | ("libgudev" ,libgudev))) |
bd9d3db6 RW |
2552 | (home-page "https://github.com/martinpitt/umockdev/") |
2553 | (synopsis "Mock hardware devices for creating unit tests") | |
2554 | (description "umockdev mocks hardware devices for creating integration | |
2555 | tests for hardware related libraries and programs. It also provides tools to | |
2556 | record the properties and behaviour of particular devices, and to run a | |
2557 | program or test suite under a test bed with the previously recorded devices | |
2558 | loaded.") | |
2559 | (license license:lgpl2.1+))) | |
968e86bd | 2560 | |
e2ba79ef MB |
2561 | (define-public virtest |
2562 | ;; No releases yet, so we take the commit that "vc" expects. | |
2563 | (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04") | |
2564 | (revision "0")) | |
2565 | (package | |
2566 | (name "virtest") | |
2567 | (version (git-version "0.0" revision commit)) | |
2568 | (home-page "https://github.com/mattkretz/virtest") | |
2569 | (source (origin | |
2570 | (method git-fetch) | |
2571 | (uri (git-reference (url home-page) (commit commit))) | |
2572 | (file-name (git-file-name name version)) | |
2573 | (sha256 | |
2574 | (base32 | |
2575 | "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l")))) | |
2576 | (build-system cmake-build-system) | |
2577 | (arguments | |
2578 | `(#:phases (modify-phases %standard-phases | |
2579 | (add-after 'unpack 'adjust-install-directory | |
2580 | (lambda _ | |
2581 | ;; Vc is the only consumer of this library, and expects | |
2582 | ;; to find it in "virtest/vir/" instead of "vir/vir/". | |
2583 | (substitute* "CMakeLists.txt" | |
2584 | (("DESTINATION include/vir") | |
2585 | "DESTINATION include/virtest")) | |
2586 | #t))))) | |
2587 | (synopsis "Header-only test framework") | |
2588 | (description | |
2589 | "@code{virtest} is a small header-only test framework for C++. It | |
2590 | grew out of the @dfn{Vc} project.") | |
2591 | (license license:bsd-3)))) | |
2592 | ||
968e86bd CM |
2593 | (define-public python-pyfakefs |
2594 | (package | |
2595 | (name "python-pyfakefs") | |
75385105 | 2596 | (version "3.7.1") |
968e86bd CM |
2597 | (source (origin |
2598 | (method url-fetch) | |
2599 | ;; We use the PyPI URL because there is no proper release | |
2600 | ;; available from GitHub. The GitHub project only provides | |
2601 | ;; autogenerated tarballs, which are known to change in place. | |
2602 | (uri (pypi-uri "pyfakefs" version)) | |
2603 | (sha256 | |
2604 | (base32 | |
75385105 | 2605 | "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy")) |
968e86bd CM |
2606 | (patches (search-patches |
2607 | "python-pyfakefs-remove-bad-test.patch")) | |
2608 | (file-name (string-append name "-" version ".tar.gz")))) | |
2609 | (arguments | |
2610 | `(#:phases | |
2611 | (modify-phases %standard-phases | |
2612 | ;; The default test suite does not run these extra tests. | |
2613 | (add-after 'check 'check-pytest-plugin | |
2614 | (lambda _ | |
2615 | (invoke | |
2616 | "python" "-m" "pytest" | |
2617 | "pyfakefs/pytest_tests/pytest_plugin_test.py") | |
2618 | #t))))) | |
2619 | (native-inputs | |
2620 | `(("python-pytest" ,python-pytest))) | |
2621 | (build-system python-build-system) | |
2622 | ;; Guix lint doesn't like that this is a permanent redirect to the GitHub | |
2623 | ;; page, but the pyfakefs documentation asks us to use this specific URL | |
2624 | ;; when linking to the project. Honor their request. | |
2625 | (home-page "http://pyfakefs.org/") | |
2626 | ;; TRANSLATORS: In the synopsis, "Mock" is a verb. | |
2627 | (synopsis "Mock file system interactions in tests") | |
2628 | (description | |
2629 | "This package provides a Python library intended for use in automated | |
2630 | tests. One difficulty when testing software is that the code under test might | |
2631 | need to read or write to files in the local file system. If the file system | |
2632 | is not set up in just the right way, it might cause a spurious error during | |
2633 | the test. The pyfakefs library provides a solution to problems like this by | |
2634 | mocking file system interactions. In other words, it arranges for the code | |
2635 | under test to interact with a fake file system instead of the real file | |
2636 | system. The code under test requires no modification to work with pyfakefs.") | |
2637 | (license license:asl2.0))) | |
2638 | ||
2639 | (define-public python2-pyfakefs | |
2640 | (package-with-python2 python-pyfakefs)) | |
fb62edfc MB |
2641 | |
2642 | ;; This minimal variant is used to avoid a circular dependency between | |
2643 | ;; python2-importlib-metadata, which requires pyfakefs for its tests, and | |
2644 | ;; python2-pytest, which requires python2-importlib-metadata. | |
2645 | (define-public python2-pyfakefs-bootstrap | |
2646 | (hidden-package | |
2647 | (package | |
2648 | (inherit python2-pyfakefs) | |
2649 | (name "python2-pyfakefs-bootstrap") | |
2650 | (native-inputs '()) | |
2651 | (arguments | |
2652 | `(#:python ,python-2 | |
2653 | #:tests? #f))))) | |
27783023 | 2654 | |
4edefc50 LDB |
2655 | (define-public python-aiounittest |
2656 | (package | |
2657 | (name "python-aiounittest") | |
2658 | (version "1.3.1") | |
2659 | (source | |
2660 | (origin | |
2661 | (method url-fetch) | |
2662 | (uri (pypi-uri "aiounittest" version)) | |
2663 | (sha256 | |
2664 | (base32 | |
2665 | "1q4bhmi80smaa1lknvdna0sx3915naczlfna1fp435nf6cjyrjl1")))) | |
2666 | (build-system python-build-system) | |
2667 | (native-inputs | |
2668 | `(("python-coverage" ,python-coverage) | |
2669 | ("python-nose" ,python-nose))) | |
2670 | (home-page | |
2671 | "https://github.com/kwarunek/aiounittest") | |
2672 | (synopsis "Test asyncio code more easily") | |
2673 | (description "Aiounittest is a library that helps write tests using | |
2674 | asynchronous code in Python (asyncio).") | |
2675 | (license license:expat))) |