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