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