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