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