gnu: Update pythonpaste.org home pages.
[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")
583 (version "0.6.1")
584 (source
585 (origin
586 (method url-fetch)
587 (uri (pypi-uri "parameterized" version))
588 (sha256
589 (base32
590 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
591 (build-system python-build-system)
592 (arguments '(#:tests? #f)) ; there are no tests
593 (home-page "https://github.com/wolever/parameterized")
594 (synopsis "Parameterized testing with any Python test framework")
595 (description
596 "Parameterized is a Python library that aims to fix parameterized testing
597for every Python test framework. It supports nose, py.test, and unittest.")
ac257f12 598 (license license:bsd-2)))
63aa8558
RW
599
600(define-public python2-parameterized
601 (package-with-python2 python-parameterized))
ac257f12 602
e57fb285
PL
603(define-public python-minimock
604 (package
605 (name "python-minimock")
606 (version "1.2.8")
607 (source
608 (origin
609 (method url-fetch)
610 (uri (pypi-uri "MiniMock" version))
611 (sha256
612 (base32
613 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
614 (build-system python-build-system)
615 (home-page "https://pypi.org/project/MiniMock")
616 (synopsis "Simple Python library for using mock objects")
617 (description "MiniMock is a simple library for building mock objects with
618doctest.")
619 (license license:expat)))
620
621(define-public python2-minimock
622 (package-with-python2 python-minimock))
623
ac257f12
RW
624(define-public python-mock
625 (package
626 (name "python-mock")
2dd12924 627 (version "2.0.0")
ac257f12
RW
628 (source
629 (origin
630 (method url-fetch)
631 (uri (pypi-uri "mock" version))
632 (sha256
633 (base32
2dd12924
MB
634 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
635 (propagated-inputs
636 `(("python-pbr" ,python-pbr-minimal)
637 ("python-six" ,python-six)))
ac257f12 638 (build-system python-build-system)
2dd12924
MB
639 (native-inputs
640 `(("python-unittest2" ,python-unittest2)))
641 (arguments
642 `(#:phases
643 (modify-phases %standard-phases
644 (replace 'check
645 (lambda _
646 (zero? (system* "unit2")))))))
ac257f12
RW
647 (home-page "https://github.com/testing-cabal/mock")
648 (synopsis "Python mocking and patching library for testing")
649 (description
650 "Mock is a library for testing in Python. It allows you to replace parts
651of your system under test with mock objects and make assertions about how they
652have been used.")
2dd12924 653 (properties `((python2-variant . ,(delay python2-mock))))
ac257f12
RW
654 (license license:expat)))
655
656(define-public python2-mock
2dd12924
MB
657 (let ((base (package-with-python2
658 (strip-python2-variant python-mock))))
659 (package (inherit base)
660 (propagated-inputs
661 `(("python2-functools32" ,python2-functools32)
662 ("python2-funcsigs" ,python2-funcsigs)
663 ,@(package-propagated-inputs base))))))
ac257f12
RW
664
665(define-public python-nose
666 (package
667 (name "python-nose")
668 (version "1.3.7")
669 (source
670 (origin
671 (method url-fetch)
672 (uri (pypi-uri "nose" version))
673 (sha256
674 (base32
675 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
676 (build-system python-build-system)
677 (arguments
678 '(#:tests? #f)) ; FIXME: test suite fails
679 (home-page "http://readthedocs.org/docs/nose/")
680 (synopsis "Python testing library")
681 (description
682 "Nose extends the unittest library to make testing easier.")
683 (license license:lgpl2.0+)))
684
685(define-public python2-nose
686 (package-with-python2 python-nose))
687
688(define-public python-nose2
689 (package
690 (name "python-nose2")
691 (version "0.6.5")
692 (source
693 (origin
694 (method url-fetch)
695 (uri (pypi-uri "nose2" version))
696 (sha256
697 (base32
698 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
699 (build-system python-build-system)
700 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
701 (propagated-inputs
702 `(("python-cov-core" ,python-cov-core)
703 ("python-pytest-cov" ,python-pytest-cov)
704 ("python-six" ,python-six)))
705 (home-page "https://github.com/nose-devs/nose2")
706 (synopsis "Next generation of nicer testing for Python")
707 (description
708 "Nose2 is the next generation of nicer testing for Python, based on the
709plugins branch of unittest2. Nose2 aims to improve on nose by providing a
710better plugin api, being easier for users to configure, and simplifying internal
711interfaces and processes.")
712 (license license:bsd-2)))
713
714(define-public python2-nose2
715 (package-with-python2 python-nose2))
716
717(define-public python-unittest2
718 (package
719 (name "python-unittest2")
2dd12924 720 (version "1.1.0")
ac257f12
RW
721 (source
722 (origin
723 (method url-fetch)
2dd12924
MB
724 (uri (pypi-uri "unittest2" version))
725 (patches
726 (search-patches "python-unittest2-python3-compat.patch"
727 "python-unittest2-remove-argparse.patch"))
ac257f12
RW
728 (sha256
729 (base32
2dd12924 730 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
ac257f12 731 (build-system python-build-system)
2dd12924
MB
732 (arguments
733 '(#:phases
734 (modify-phases %standard-phases
735 (replace 'check
736 (lambda _
737 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
738 (propagated-inputs
739 `(("python-six" ,python-six)
740 ("python-traceback2" ,python-traceback2)))
ac257f12
RW
741 (home-page "http://pypi.python.org/pypi/unittest2")
742 (synopsis "Python unit testing library")
743 (description
744 "Unittest2 is a replacement for the unittest module in the Python
745standard library.")
746 (license license:psfl)))
747
748(define-public python2-unittest2
2dd12924 749 (package-with-python2 python-unittest2))
ac257f12
RW
750
751(define-public python-pytest
752 (package
753 (name "python-pytest")
a7ed2d53 754 (version "4.4.2")
ac257f12
RW
755 (source
756 (origin
757 (method url-fetch)
2dd12924 758 (uri (pypi-uri "pytest" version))
ac257f12
RW
759 (sha256
760 (base32
a7ed2d53 761 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
ac257f12 762 (build-system python-build-system)
2dd12924
MB
763 (arguments
764 `(#:phases
765 (modify-phases %standard-phases
1a246c01 766 (replace 'check
2dd12924 767 (lambda _
1a246c01
MB
768 (invoke "pytest" "-vv" "-k"
769 (string-append
770 ;; These tests involve the /usr directory, and fails.
771 "not test_remove_dir_prefix"
772 " and not test_argcomplete"
773 ;; This test tries to override PYTHONPATH, and
774 ;; subsequently fails to locate the test libraries.
56e95d54 775 " and not test_collection")))))))
ac257f12 776 (propagated-inputs
a9ae30b7
MB
777 `(("python-atomicwrites" ,python-atomicwrites)
778 ("python-attrs" ,python-attrs-bootstrap)
7ad5c6dd
AI
779 ("python-more-itertools" ,python-more-itertools)
780 ("python-pluggy" ,python-pluggy)
781 ("python-py" ,python-py)
782 ("python-six" ,python-six-bootstrap)))
ac257f12
RW
783 (native-inputs
784 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
785 ("bash" ,bash)
2dd12924 786 ("python-hypothesis" ,python-hypothesis)
ac257f12 787 ("python-nose" ,python-nose)
2dd12924 788 ("python-mock" ,python-mock)
4750b3a2 789 ("python-pytest" ,python-pytest-bootstrap)
2dd12924 790 ("python-setuptools-scm" ,python-setuptools-scm)))
aefa2912 791 (home-page "https://docs.pytest.org/en/latest/")
ac257f12
RW
792 (synopsis "Python testing library")
793 (description
794 "Pytest is a testing tool that provides auto-discovery of test modules
795and functions, detailed info on failing assert statements, modular fixtures,
796and many external plugins.")
7ad5c6dd
AI
797 (license license:expat)
798 (properties `((python2-variant . ,(delay python2-pytest))))))
ac257f12
RW
799
800(define-public python2-pytest
7ad5c6dd
AI
801 (let ((pytest (package-with-python2
802 (strip-python2-variant python-pytest))))
803 (package
804 (inherit pytest)
805 (propagated-inputs
806 `(("python2-funcsigs" ,python2-funcsigs)
e2da8bcd 807 ("python2-pathlib2" ,python2-pathlib2)
7ad5c6dd 808 ,@(package-propagated-inputs pytest))))))
ac257f12 809
2dd12924 810(define-public python-pytest-bootstrap
ac257f12 811 (package
7ad5c6dd 812 (inherit (strip-python2-variant python-pytest))
2dd12924
MB
813 (name "python-pytest-bootstrap")
814 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
7ad5c6dd
AI
815 (arguments `(#:tests? #f))
816 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
ac257f12 817
2dd12924 818(define-public python2-pytest-bootstrap
7ad5c6dd
AI
819 (let ((pytest (package-with-python2
820 (strip-python2-variant python-pytest-bootstrap))))
821 (package (inherit pytest)
822 (propagated-inputs
823 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
e2da8bcd 824 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
7ad5c6dd 825 ,@(package-propagated-inputs pytest))))))
ac257f12
RW
826
827(define-public python-pytest-cov
828 (package
829 (name "python-pytest-cov")
123d92ea 830 (version "2.6.1")
ac257f12
RW
831 (source
832 (origin
833 (method url-fetch)
834 (uri (pypi-uri "pytest-cov" version))
835 (sha256
123d92ea 836 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
ac257f12
RW
837 (build-system python-build-system)
838 (arguments
839 `(#:phases
840 (modify-phases %standard-phases
841 (replace 'check
842 (lambda _
123d92ea 843 ;; Options taken from tox.ini.
ac257f12 844 ;; TODO: make "--restructuredtext" tests pass. They currently fail
123d92ea 845 ;; with "Duplicate implicit target name".
29594404
MW
846 (invoke "python" "./setup.py" "check"
847 "--strict" "--metadata"))))))
ac257f12
RW
848 (propagated-inputs
849 `(("python-coverage" ,python-coverage)
850 ("python-pytest" ,python-pytest)))
851 (home-page "https://github.com/pytest-dev/pytest-cov")
852 (synopsis "Pytest plugin for measuring coverage")
853 (description
854 "Pytest-cov produces coverage reports. It supports centralised testing and
855distributed testing in both @code{load} and @code{each} modes. It also
856supports coverage of subprocesses.")
857 (license license:expat)))
858
859(define-public python2-pytest-cov
860 (package-with-python2 python-pytest-cov))
861
862(define-public python-pytest-runner
863 (package
864 (name "python-pytest-runner")
c49c71cd 865 (version "4.4")
ac257f12
RW
866 (source
867 (origin
868 (method url-fetch)
869 (uri (pypi-uri "pytest-runner" version))
870 (sha256
871 (base32
c49c71cd 872 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
ac257f12 873 (build-system python-build-system)
ac257f12 874 (native-inputs
2dd12924 875 `(("python-pytest" ,python-pytest-bootstrap)
ac257f12
RW
876 ("python-setuptools-scm" ,python-setuptools-scm)))
877 (home-page "https://github.com/pytest-dev/pytest-runner")
878 (synopsis "Invoke py.test as a distutils command")
879 (description
880 "This package provides a @command{pytest-runner} command that
881@file{setup.py} files can use to run tests.")
882 (license license:expat)))
883
884(define-public python2-pytest-runner
885 (package-with-python2 python-pytest-runner))
886
ff0efc8f
MB
887;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
888;; Remove once no longer needed.
889(define-public python-pytest-runner-2
890 (package/inherit
891 python-pytest-runner
892 (version "2.12.2")
893 (source (origin
894 (method url-fetch)
895 (uri (pypi-uri "pytest-runner" version))
896 (sha256
897 (base32
898 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
899
900(define-public python2-pytest-runner-2
901 (package-with-python2 python-pytest-runner-2))
902
ac257f12
RW
903(define-public python-pytest-mock
904 (package
905 (name "python-pytest-mock")
71fb3263 906 (version "1.10.1")
ac257f12
RW
907 (source
908 (origin
909 (method url-fetch)
f7bd4f23 910 (uri (pypi-uri "pytest-mock" version))
ac257f12
RW
911 (sha256
912 (base32
71fb3263 913 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
ac257f12
RW
914 (build-system python-build-system)
915 (native-inputs
f7bd4f23 916 `(("python-setuptools-scm" ,python-setuptools-scm)))
ac257f12
RW
917 (propagated-inputs
918 `(("python-pytest" ,python-pytest)))
919 (home-page "https://github.com/pytest-dev/pytest-mock/")
920 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
921 (description
922 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
923around the patching API provided by the @code{mock} package, but with the
924benefit of not having to worry about undoing patches at the end of a test.
925The mocker fixture has the same API as @code{mock.patch}, supporting the
926same arguments.")
927 (properties `((python2-variant . ,(delay python2-pytest-mock))))
928 (license license:expat)))
929
930(define-public python2-pytest-mock
931 (let ((base (package-with-python2
932 (strip-python2-variant python-pytest-mock))))
933 (package (inherit base)
934 (propagated-inputs
935 `(("python2-mock" ,python2-mock)
936 ,@(package-propagated-inputs base))))))
937
938(define-public python-pytest-xdist
939 (package
940 (name "python-pytest-xdist")
d70cb3e0 941 (version "1.25.0")
ac257f12
RW
942 (source
943 (origin
944 (method url-fetch)
d70cb3e0 945 (uri (pypi-uri "pytest-xdist" version))
ac257f12
RW
946 (sha256
947 (base32
d70cb3e0 948 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
ac257f12
RW
949 (modules '((guix build utils)))
950 (snippet
951 '(begin
952 ;; Remove pre-compiled .pyc files from source.
953 (for-each delete-file-recursively
954 (find-files "." "__pycache__" #:directories? #t))
955 (for-each delete-file (find-files "." "\\.pyc$"))
956 #t))))
957 (build-system python-build-system)
958 (arguments
959 '(#:tests? #f)) ;FIXME: Some tests are failing.
960 ;; #:phases
961 ;; (modify-phases %standard-phases
962 ;; (delete 'check)
963 ;; (add-after 'install 'check
964 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
965 ;; (add-installed-pythonpath inputs outputs)
966 ;; (zero? (system* "py.test" "-v")))))
967 (native-inputs
d70cb3e0 968 `(("python-setuptools-scm" ,python-setuptools-scm)))
ac257f12
RW
969 (propagated-inputs
970 `(("python-execnet" ,python-execnet)
971 ("python-pytest" ,python-pytest)
972 ("python-py" ,python-py)))
973 (home-page
974 "https://github.com/pytest-dev/pytest-xdist")
975 (synopsis
976 "Plugin for py.test with distributed testing and loop-on-failing modes")
977 (description
978 "The pytest-xdist plugin extends py.test with some unique test execution
979modes: parallelization, running tests in boxed subprocesses, the ability
980to run tests repeatedly when failed, and the ability to run tests on multiple
981Python interpreters or platforms. It uses rsync to copy the existing
982program code to a remote location, executes there, and then syncs the
983result back.")
984 (license license:expat)))
985
986(define-public python2-pytest-xdist
987 (package-with-python2 python-pytest-xdist))
988
90afa80d
RW
989(define-public python-pytest-timeout
990 (package
991 (name "python-pytest-timeout")
992 (version "1.3.3")
993 (source
994 (origin
995 (method url-fetch)
996 (uri (pypi-uri "pytest-timeout" version))
997 (sha256
998 (base32
999 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
1000 (build-system python-build-system)
1001 (propagated-inputs
1002 `(("python-pytest" ,python-pytest)))
1003 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
1004 (synopsis "Plugin for py.test to abort hanging tests")
1005 (description
1006 "This package provides a py.test plugin that aborts hanging tests after a
1007timeout has been exceeded.")
1008 (license license:expat)))
1009
ac257f12
RW
1010(define-public python-scripttest
1011 (package
1012 (name "python-scripttest")
1013 (version "1.3")
1014 (source
1015 (origin
1016 (method url-fetch)
5af020bb 1017 (uri (pypi-uri "scripttest" version))
ac257f12
RW
1018 (sha256
1019 (base32
1020 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1021 (build-system python-build-system)
1022 (native-inputs
1023 `(("python-pytest" ,python-pytest)))
63b06670
TGR
1024 (home-page (string-append "https://web.archive.org/web/20161029233413/"
1025 "http://pythonpaste.org/scripttest/"))
ac257f12
RW
1026 (synopsis "Python library to test command-line scripts")
1027 (description "Scripttest is a Python helper library for testing
1028interactive command-line applications. With it you can run a script in a
1029subprocess and see the output as well as any file modifications.")
1030 (license license:expat)))
1031
1032(define-public python2-scripttest
1033 (package-with-python2 python-scripttest))
1034
8b93f7e4 1035(define-public python-testtools-bootstrap
ac257f12 1036 (package
8b93f7e4
MB
1037 (name "python-testtools-bootstrap")
1038 (version "2.3.0")
ac257f12
RW
1039 (source
1040 (origin
1041 (method url-fetch)
1042 (uri (pypi-uri "testtools" version))
1043 (sha256
1044 (base32
0ea6af99
EF
1045 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1046 (patches (search-patches "python-testtools.patch"))))
ac257f12 1047 (build-system python-build-system)
8b93f7e4 1048 (arguments '(#:tests? #f))
ac257f12 1049 (propagated-inputs
8b93f7e4
MB
1050 `(("python-extras" ,python-extras)
1051 ("python-fixtures" ,python-fixtures-bootstrap)
1052 ("python-mimeparse" ,python-mimeparse)
1053 ("python-pbr" ,python-pbr-minimal)
1054 ("python-six" ,python-six)
1055 ("python-traceback2" ,python-traceback2)
1056 ("python-unittest2" ,python-unittest2)))
ac257f12
RW
1057 (home-page "https://github.com/testing-cabal/testtools")
1058 (synopsis
1059 "Extensions to the Python standard library unit testing framework")
8b93f7e4
MB
1060 (description
1061 "This package is only for bootstrapping. Do not use this.")
1062 (license license:psfl)))
1063
1064(define-public python2-testtools-bootstrap
1065 (package-with-python2 python-testtools-bootstrap))
1066
1067(define-public python-testtools
1068 (package
1069 (inherit python-testtools-bootstrap)
1070 (name "python-testtools")
1071 (arguments
1072 `(#:phases (modify-phases %standard-phases
1073 (replace 'check
1074 (lambda _
1075 (invoke "python" "-m" "testtools.run"
1076 "testtools.tests.test_suite"))))))
1077 (propagated-inputs
1078 `(("python-extras" ,python-extras)
1079 ("python-fixtures" ,python-fixtures)
1080 ("python-mimeparse" ,python-mimeparse)
1081 ("python-pbr" ,python-pbr)
1082 ("python-six" ,python-six)
1083 ("python-traceback2" ,python-traceback2)
1084 ("python-unittest2" ,python-unittest2)))
1085 (native-inputs
1086 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
ac257f12
RW
1087 (description
1088 "Testtools extends the Python standard library unit testing framework to
1089provide matchers, more debugging information, and cross-Python
8b93f7e4 1090compatibility.")))
ac257f12
RW
1091
1092(define-public python2-testtools
1093 (package-with-python2 python-testtools))
1094
8b93f7e4 1095(define-public python-testscenarios-bootstrap
ac257f12 1096 (package
8b93f7e4 1097 (name "python-testscenarios-bootstrap")
ae565a9a 1098 (version "0.5.0")
ac257f12
RW
1099 (source
1100 (origin
1101 (method url-fetch)
ae565a9a 1102 (uri (pypi-uri "testscenarios" version))
ac257f12
RW
1103 (sha256
1104 (base32
ae565a9a 1105 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
ac257f12 1106 (build-system python-build-system)
ae565a9a
MB
1107 (arguments
1108 `(#:phases (modify-phases %standard-phases
1109 (replace 'check
1110 (lambda _
1111 (invoke "python" "-m" "testtools.run"
1112 "testscenarios.test_suite"))))))
ac257f12 1113 (propagated-inputs
ae565a9a
MB
1114 `(("python-pbr" ,python-pbr-minimal)
1115 ("python-testtools" ,python-testtools-bootstrap)))
ac257f12
RW
1116 (home-page "https://launchpad.net/testscenarios")
1117 (synopsis "Pyunit extension for dependency injection")
1118 (description
8b93f7e4 1119 "This package is only for bootstrapping. Don't use this.")
ac257f12
RW
1120 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1121
8b93f7e4
MB
1122(define-public python2-testscenarios-bootstrap
1123 (package-with-python2 python-testscenarios-bootstrap))
1124
1125(define-public python-testscenarios
1126 (package
1127 (inherit python-testscenarios-bootstrap)
1128 (name "python-testscenarios")
1129 (propagated-inputs
ae565a9a
MB
1130 `(("python-pbr" ,python-pbr)
1131 ("python-testtools" ,python-testtools)))
8b93f7e4
MB
1132 (description
1133 "Testscenarios provides clean dependency injection for Python unittest
1134style tests.")))
1135
ac257f12
RW
1136(define-public python2-testscenarios
1137 (package-with-python2 python-testscenarios))
1138
bc69104a
MB
1139;; Testresources requires python-pbr at runtime, but pbr needs it for its
1140;; own tests. Hence this bootstrap variant.
1141(define-public python-testresources-bootstrap
ac257f12 1142 (package
bc69104a
MB
1143 (name "python-testresources-bootstrap")
1144 (version "2.0.1")
1145 (source (origin
1146 (method url-fetch)
1147 (uri (pypi-uri "testresources" version))
1148 (sha256
1149 (base32
1150 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
ac257f12 1151 (build-system python-build-system)
bc69104a
MB
1152 (arguments '(#:tests? #f))
1153 (propagated-inputs
1154 `(("python-pbr" ,python-pbr-minimal)))
ac257f12
RW
1155 (home-page "https://launchpad.net/testresources")
1156 (synopsis
1157 "Pyunit extension for managing test resources")
1158 (description
bc69104a
MB
1159 "This package is only here for bootstrapping purposes. Use the regular
1160testresources package instead.")
ac257f12
RW
1161 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1162
bc69104a
MB
1163(define-public python2-testresources-bootstrap
1164 (package-with-python2 python-testresources-bootstrap))
1165
1166(define-public python-testresources
1167 (package
1168 (inherit python-testresources-bootstrap)
1169 (name "python-testresources")
1170 (propagated-inputs
1171 `(("python-pbr" ,python-pbr)))
1172 (arguments '())
1173 (native-inputs
1174 `(("python-fixtures" ,python-fixtures)
1175 ("python-testtols" ,python-testtools)))
1176 (description
1177 "Testresources is an extension to Python's unittest to allow declarative
1178use of resources by test cases.")))
1179
ac257f12
RW
1180(define-public python2-testresources
1181 (package-with-python2 python-testresources))
1182
8b93f7e4 1183(define-public python-subunit-bootstrap
ac257f12 1184 (package
8b93f7e4 1185 (name "python-subunit-bootstrap")
4df24531 1186 (version "1.3.0")
ac257f12
RW
1187 (source
1188 (origin
1189 (method url-fetch)
8b93f7e4 1190 (uri (pypi-uri "python-subunit" version))
ac257f12
RW
1191 (sha256
1192 (base32
4df24531 1193 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
ac257f12
RW
1194 (build-system python-build-system)
1195 (propagated-inputs
1196 `(("python-extras" ,python-extras)
8b93f7e4 1197 ("python-testtools" ,python-testtools-bootstrap)))
ac257f12 1198 (native-inputs
151f32a7
MB
1199 `(("python-fixtures" ,python-fixtures-bootstrap)
1200 ("python-hypothesis" ,python-hypothesis)
8b93f7e4 1201 ("python-testscenarios" ,python-testscenarios-bootstrap)))
4df24531 1202 (home-page "https://launchpad.net/subunit")
ac257f12
RW
1203 (synopsis "Python implementation of the subunit protocol")
1204 (description
8b93f7e4
MB
1205 "This package is here for bootstrapping purposes only. Use the regular
1206python-subunit package instead.")
ac257f12
RW
1207 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1208
8b93f7e4
MB
1209(define-public python2-subunit-bootstrap
1210 (package-with-python2 python-subunit-bootstrap))
1211
1212(define-public python-subunit
1213 (package
1214 (inherit python-subunit-bootstrap)
1215 (name "python-subunit")
1216 (propagated-inputs
1217 `(("python-extras" ,python-extras)
1218 ("python-testtools" ,python-testtools)))
1219 (native-inputs
1220 `(("python-fixtures" ,python-fixtures)
1221 ("python-hypothesis" ,python-hypothesis)
1222 ("python-testscenarios" ,python-testscenarios)))
1223 (description
1224 "Python-subunit is a Python implementation of the subunit test streaming
1225protocol.")))
1226
ac257f12
RW
1227(define-public python2-subunit
1228 (package-with-python2 python-subunit))
1229
335c9e39
MB
1230;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1231;; own tests. Hence this bootstrap variant.
1232(define-public python-fixtures-bootstrap
ac257f12 1233 (package
335c9e39 1234 (name "python-fixtures-bootstrap")
9c77852e 1235 (version "3.0.0")
335c9e39
MB
1236 (source (origin
1237 (method url-fetch)
1238 (uri (pypi-uri "fixtures" version))
1239 (sha256
1240 (base32
9c77852e 1241 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
ac257f12 1242 (build-system python-build-system)
335c9e39
MB
1243 (arguments `(#:tests? #f))
1244 (propagated-inputs
1245 `(("python-pbr-minimal" ,python-pbr-minimal)
1246 ("python-six" ,python-six)))
1247 (home-page "https://launchpad.net/python-fixtures")
1248 (synopsis "Python test fixture library")
1249 (description
1250 "This package is only used for bootstrapping. Use the regular
1251python-fixtures package instead.")
1252 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1253
1254(define-public python2-fixtures-bootstrap
1255 (package-with-python2 python-fixtures-bootstrap))
1256
1257(define-public python-fixtures
1258 (package
1259 (inherit python-fixtures-bootstrap)
1260 (name "python-fixtures")
ac257f12
RW
1261 (arguments
1262 '(#:phases
1263 (modify-phases %standard-phases
1264 (replace 'check
1265 (lambda _
29594404
MW
1266 (invoke "python" "-m" "testtools.run"
1267 "fixtures.test_suite"))))))
ac257f12 1268 (propagated-inputs
335c9e39
MB
1269 ;; Fixtures uses pbr at runtime to check versions, etc.
1270 `(("python-pbr" ,python-pbr)
1271 ("python-six" ,python-six)))
ac257f12
RW
1272 (native-inputs
1273 `(("python-mock" ,python-mock)
8b93f7e4 1274 ("python-testtools" ,python-testtools-bootstrap)))
ac257f12
RW
1275 (description
1276 "Fixtures provides a way to create reusable state, useful when writing
335c9e39 1277Python tests.")))
ac257f12
RW
1278
1279(define-public python2-fixtures
1280 (package-with-python2 python-fixtures))
1281
335c9e39 1282(define-public python-testrepository-bootstrap
ac257f12 1283 (package
335c9e39
MB
1284 (name "python-testrepository-bootstrap")
1285 (version "0.0.20")
ac257f12
RW
1286 (source
1287 (origin
1288 (method url-fetch)
9fcedf07 1289 (uri (pypi-uri "testrepository" version))
ac257f12
RW
1290 (sha256
1291 (base32
1292 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1293 (build-system python-build-system)
335c9e39
MB
1294 (arguments '(#:tests? #f))
1295 (propagated-inputs
1296 `(("python-fixtures" ,python-fixtures-bootstrap)
8b93f7e4
MB
1297 ("python-subunit" ,python-subunit-bootstrap)
1298 ("python-testtools" ,python-testtools-bootstrap)))
335c9e39
MB
1299 (native-inputs
1300 `(("python-mimeparse" ,python-mimeparse)))
1301 (home-page "https://launchpad.net/testrepository")
1302 (synopsis "Database for Python test results")
1303 (description
1304 "Bootstrap package for python-testrepository. Don't use this.")
1305 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1306
1307(define-public python2-testrepository-bootstrap
1308 (package-with-python2 python-testrepository-bootstrap))
1309
1310(define-public python-testrepository
1311 (package
1312 (inherit python-testrepository-bootstrap)
1313 (name "python-testrepository")
ac257f12
RW
1314 (arguments
1315 ;; FIXME: Many tests are failing.
1316 '(#:tests? #f))
1317 (propagated-inputs
1318 `(("python-fixtures" ,python-fixtures)
1319 ("python-subunit" ,python-subunit)
1320 ("python-testtools" ,python-testtools)))
1321 (native-inputs
335c9e39 1322 `(("python-mimeparse" ,python-mimeparse)))
ac257f12
RW
1323 (description "Testrepository provides a database of test results which can
1324be used as part of a developer's workflow to check things such as what tests
335c9e39 1325have failed since the last commit or what tests are currently failing.")))
ac257f12
RW
1326
1327(define-public python2-testrepository
1328 (package-with-python2 python-testrepository))
1329
1330(define-public python-coverage
1331 (package
1332 (name "python-coverage")
d80dcf2b 1333 (version "4.5.3")
ac257f12
RW
1334 (source
1335 (origin
1336 (method url-fetch)
1337 (uri (pypi-uri "coverage" version))
1338 (sha256
1339 (base32
d80dcf2b 1340 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
ac257f12
RW
1341 (build-system python-build-system)
1342 (arguments
1343 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1344 '(#:tests? #f))
1345 (home-page "http://nedbatchelder.com/code/coverage")
1346 (synopsis "Code coverage measurement for Python")
1347 (description
1348 "Coverage measures code coverage, typically during test execution. It
1349uses the code analysis tools and tracing hooks provided in the Python standard
1350library to determine which lines are executable, and which have been
1351executed.")
1352 (license license:bsd-3)))
1353
1354(define-public python2-coverage
1355 (package-with-python2 python-coverage))
1356
1357(define-public python-cov-core
1358 (package
1359 (name "python-cov-core")
1360 (version "1.15.0")
1361 (source
1362 (origin
1363 (method url-fetch)
1364 (uri (pypi-uri "cov-core" version))
1365 (sha256
1366 (base32
1367 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1368 (build-system python-build-system)
1369 (propagated-inputs
1370 `(("python-coverage" ,python-coverage)))
1371 (home-page "https://github.com/schlamar/cov-core")
1372 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1373 (description
1374 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1375and @code{nose2-cov}. It is useful for developing coverage plugins for these
1376testing frameworks.")
1377 (license license:expat)))
1378
1379(define-public python2-cov-core
1380 (package-with-python2 python-cov-core))
1381
c3f9a6ce
EF
1382(define-public python-codecov
1383 (package
1384 (name "python-codecov")
1385 (version "2.0.15")
1386 (source
1387 (origin
1388 (method url-fetch)
1389 (uri (pypi-uri "codecov" version))
1390 (sha256
1391 (base32
1392 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1393 (build-system python-build-system)
1394 (native-inputs
1395 `(("python-unittest2" ,python-unittest2)))
1396 (propagated-inputs
1397 `(("python-coverage" ,python-coverage)
1398 ("python-requests" ,python-requests)))
1399 (home-page "http://github.com/codecov/codecov-python")
1400 (synopsis "Upload code coverage reports to @code{codecov.io}")
1401 (description
1402 "Codecov collects code coverage reports from code written in Python, Java,
1403C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1404 (license license:asl2.0)))
1405
ac257f12
RW
1406(define-public python-testpath
1407 (package
1408 (name "python-testpath")
1409 (version "0.2")
1410 (source
1411 (origin
52305b0a
EF
1412 (method git-fetch)
1413 (uri (git-reference
1414 (url "https://github.com/jupyter/testpath")
1415 (commit version)))
1416 (file-name (git-file-name name version))
ac257f12
RW
1417 (sha256
1418 (base32
52305b0a 1419 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
ac257f12
RW
1420 (build-system python-build-system)
1421 (arguments
1422 `(#:tests? #f ; this package does not even have a setup.py
1423 #:modules ((guix build python-build-system)
1424 (guix build utils)
1425 (srfi srfi-1))
1426 #:imported-modules (,@%python-build-system-modules
1427 (srfi srfi-1))
1428 #:phases
1429 (modify-phases %standard-phases
1430 (delete 'install)
1431 (replace 'build
1432 (lambda* (#:key inputs outputs #:allow-other-keys)
1433 (let* ((version (last
1434 (string-split (assoc-ref inputs "python") #\-)))
1435 (x.y (string-join (take (string-split version #\.) 2)
1436 "."))
1437 (dir (string-append
1438 (assoc-ref outputs "out")
1439 "/lib/python" x.y "/site-packages/testpath")))
1440 (mkdir-p dir)
1441 (copy-recursively "testpath" dir))
1442 #t)))))
1443 (home-page "https://github.com/takluyver/testpath")
1444 (synopsis "Test utilities for code working with files and commands")
1445 (description
1446 "Testpath is a collection of utilities for Python code working with files
162a1374 1447and commands. It contains functions to check things on the file system, and
ac257f12
RW
1448tools for mocking system commands and recording calls to those.")
1449 (license license:expat)))
1450
1451(define-public python2-testpath
1452 (package-with-python2 python-testpath))
1453
1454(define-public python-testlib
1455 (package
1456 (name "python-testlib")
1457 (version "0.6.5")
1458 (source
1459 (origin
1460 (method url-fetch)
cb539b7c 1461 (uri (pypi-uri "testlib" version ".zip"))
ac257f12
RW
1462 (sha256
1463 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1464 (build-system python-build-system)
1465 (native-inputs
1466 `(("unzip" ,unzip))) ; for unpacking the source
1467 (synopsis "Python micro test suite harness")
1468 (description "A micro unittest suite harness for Python.")
1469 (home-page "https://github.com/trentm/testlib")
1470 (license license:expat)))
1471
1472(define-public python2-testlib
1473 (package-with-python2 python-testlib))
1474
1475;;; The software provided by this package was integrated into pytest 2.8.
1476(define-public python-pytest-cache
1477 (package
1478 (name "python-pytest-cache")
1479 (version "1.0")
1480 (source (origin
1481 (method url-fetch)
1482 (uri (pypi-uri "pytest-cache" version))
1483 (sha256
1484 (base32
1485 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1486 (build-system python-build-system)
1487 (propagated-inputs
1488 `(("python-apipkg" ,python-apipkg)
1489 ("python-execnet" ,python-execnet)
1490 ("python-py" ,python-py)
1491 ("python-pytest" ,python-pytest)))
1492 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1493 (description "The pytest-cache plugin provides tools to rerun failures from
1494the last py.test invocation.")
1495 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1496 (license license:expat)))
1497
1498(define-public python2-pytest-cache
1499 (package-with-python2 python-pytest-cache))
1500
1501(define-public python-pytest-localserver
1502 (package
1503 (name "python-pytest-localserver")
74854d11 1504 (version "0.5.0")
ac257f12 1505 (source (origin
74854d11
EF
1506 (method url-fetch)
1507 (uri (pypi-uri "pytest-localserver" version))
1508 (sha256
1509 (base32
1510 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
ac257f12
RW
1511 (build-system python-build-system)
1512 (arguments
45a2346f
EF
1513 '(#:phases
1514 (modify-phases %standard-phases
ac257f12
RW
1515 (replace 'check
1516 (lambda _
45a2346f 1517 (invoke "py.test" "-v"))))))
ac257f12
RW
1518 (native-inputs
1519 `(("python-pytest" ,python-pytest)
1520 ("python-requests" ,python-requests)
1521 ("python-six" ,python-six)))
1522 (propagated-inputs
1523 `(("python-werkzeug" ,python-werkzeug)))
1524 (synopsis "Py.test plugin to test server connections locally")
1525 (description "Pytest-localserver is a plugin for the pytest testing
1526framework which enables you to test server connections locally.")
1527 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1528 (license license:expat)))
1529
1530(define-public python-pytest-xprocess
1531 (package
1532 (name "python-pytest-xprocess")
1533 (version "0.9.1")
1534 (source (origin
1535 (method url-fetch)
1536 (uri (pypi-uri "pytest-xprocess" version))
1537 (sha256
1538 (base32
1539 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1540 (build-system python-build-system)
1541 (propagated-inputs
1542 `(("python-pytest" ,python-pytest)
1543 ("python-pytest-cache" ,python-pytest-cache)
1544 ("python-psutil" ,python-psutil)))
1545 (synopsis "Pytest plugin to manage external processes across test runs")
1546 (description "Pytest-xprocess is an experimental py.test plugin for managing
1547processes across test runs.")
1548 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1549 (license license:expat)))
1550
1551(define-public python-pytest-subtesthack
1552 (package
1553 (name "python-pytest-subtesthack")
1554 (version "0.1.1")
1555 (source (origin
1556 (method url-fetch)
1557 (uri (pypi-uri "pytest-subtesthack" version))
1558 (sha256
1559 (base32
1560 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1561 (build-system python-build-system)
1562 (propagated-inputs
1563 `(("python-pytest" ,python-pytest)))
1564 (synopsis "Set-up and tear-down fixtures for unit tests")
1565 (description "This plugin allows you to set up and tear down fixtures within
1566unit test functions that use @code{py.test}. This is useful for using
1567@command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1568function multiple times, without setting up or tearing down fixture state as is
1569normally the case.")
1570 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1571 (license license:unlicense)))
1572
1573(define-public python2-pytest-subtesthack
1574 (package-with-python2 python-pytest-subtesthack))
1575
7600513a
CB
1576(define-public python-pytest-sugar
1577 (package
1578 (name "python-pytest-sugar")
1579 (version "0.9.2")
1580 (source
1581 (origin
1582 (method url-fetch)
1583 (uri (pypi-uri "pytest-sugar" version))
1584 (sha256
1585 (base32
1586 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1587 (build-system python-build-system)
1588 (propagated-inputs
1589 `(("python-packaging" ,python-packaging)
1590 ("python-pytest" ,python-pytest)
1591 ("python-termcolor" ,python-termcolor)))
1592 (home-page "https://pivotfinland.com/pytest-sugar/")
1593 (synopsis "Plugin for pytest that changes the default look and feel")
1594 (description
1595 "@code{pytest-sugar} is a plugin for py.test that changes the default
1596look and feel of py.test, using a progress bar and showing failures and errors
1597instantly.")
1598 (license license:bsd-3)))
1599
ac257f12
RW
1600(define-public python-hypothesis
1601 (package
1602 (name "python-hypothesis")
123bba72 1603 (version "4.18.3")
ac257f12
RW
1604 (source (origin
1605 (method url-fetch)
1606 (uri (pypi-uri "hypothesis" version))
1607 (sha256
1608 (base32
123bba72 1609 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
ac257f12
RW
1610 (build-system python-build-system)
1611 (native-inputs
ac63cf0a 1612 `(("python-flake8" ,python-flake8)
2dd12924 1613 ("python-pytest" ,python-pytest-bootstrap)))
b19a960f
AI
1614 (propagated-inputs
1615 `(("python-attrs" ,python-attrs-bootstrap)
1616 ("python-coverage" ,python-coverage)))
ac257f12
RW
1617 (synopsis "Library for property based testing")
1618 (description "Hypothesis is a library for testing your Python code against a
1619much larger range of examples than you would ever want to write by hand. It’s
1620based on the Haskell library, Quickcheck, and is designed to integrate
1621seamlessly into your existing Python unit testing work flow.")
b19a960f 1622 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
ac257f12
RW
1623 (license license:mpl2.0)
1624 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1625
1626(define-public python2-hypothesis
1627 (let ((hypothesis (package-with-python2
1628 (strip-python2-variant python-hypothesis))))
1629 (package (inherit hypothesis)
1630 (propagated-inputs
1631 `(("python2-enum34" ,python2-enum34)
1632 ,@(package-propagated-inputs hypothesis))))))
1633
1634(define-public python-lit
1635 (package
1636 (name "python-lit")
8c2781f0 1637 (version "0.5.1")
ac257f12
RW
1638 (source
1639 (origin
1640 (method url-fetch)
1641 (uri (pypi-uri "lit" version))
1642 (sha256
1643 (base32
8c2781f0 1644 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
ac257f12 1645 (build-system python-build-system)
39afd2a8
DM
1646 (arguments
1647 `(#:phases
1648 (modify-phases %standard-phases
1649 (replace 'check
1650 (lambda _
40899635 1651 (invoke "python" "lit.py" "tests"))))))
39afd2a8 1652 (native-inputs
40899635 1653 `(("llvm" ,llvm)))
ac97dce1 1654 (home-page "https://llvm.org/")
ac257f12
RW
1655 (synopsis "LLVM Software Testing Tool")
1656 (description "@code{lit} is a portable tool for executing LLVM and Clang
1657style test suites, summarizing their results, and providing indication of
1658failures.")
1659 (license license:ncsa)))
1660
1661(define-public python2-lit
1662 (package-with-python2 python-lit))
1663
1664(define-public python-pytest-pep8
1665 (package
1666 (name "python-pytest-pep8")
1667 (version "1.0.6")
1668 (source (origin
1669 (method url-fetch)
1670 (uri (pypi-uri "pytest-pep8" version))
1671 (sha256
1672 (base32
1673 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1674 (build-system python-build-system)
1675 (arguments
1676 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1677 (native-inputs
1678 `(("python-pytest" ,python-pytest)))
1679 (propagated-inputs
1680 `(("python-pep8" ,python-pep8)))
1681 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1682 (synopsis "Py.test plugin to check PEP8 requirements")
1683 (description "Pytest plugin for checking PEP8 compliance.")
1684 (license license:expat)))
1685
1686(define-public python2-pytest-pep8
1687 (package-with-python2 python-pytest-pep8))
1688
1689(define-public python-pytest-flakes
1690 (package
1691 (name "python-pytest-flakes")
1692 (version "1.0.1")
1693 (source (origin
1694 (method url-fetch)
1695 (uri (pypi-uri "pytest-flakes" version))
1696 (sha256
1697 (base32
1698 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1699 (build-system python-build-system)
1700 (arguments
1701 `(#:phases
1702 (modify-phases %standard-phases
1703 (delete 'check)
1704 (add-after 'install 'check
1705 (lambda* (#:key outputs inputs #:allow-other-keys)
1706 ;; It's easier to run tests after install.
1707 ;; Make installed package available for running the tests
1708 (add-installed-pythonpath inputs outputs)
29594404 1709 (invoke "py.test" "-vv"))))))
ac257f12
RW
1710 (native-inputs
1711 `(("python-coverage" ,python-coverage)
1712 ("python-pytest" ,python-pytest)
1713 ("python-pytest-cache" ,python-pytest-cache)
1714 ("python-pytest-pep8" ,python-pytest-pep8)))
1715 (propagated-inputs
1716 `(("python-pyflakes" ,python-pyflakes)))
1717 (home-page "https://github.com/fschulze/pytest-flakes")
1718 (synopsis "Py.test plugin to check source code with pyflakes")
1719 (description "Pytest plugin for checking Python source code with pyflakes.")
1720 (license license:expat)))
1721
1722(define-public python2-pytest-flakes
1723 (package-with-python2 python-pytest-flakes))
1724
1725(define-public python2-coverage-test-runner
1726 (package
1727 (name "python2-coverage-test-runner")
6a46a06c 1728 (version "1.15")
ac257f12
RW
1729 (source
1730 (origin
1731 (method url-fetch)
1732 (uri (string-append
1733 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1734 "coverage-test-runner/snapshot/coverage-test-runner-"
1735 version ".tar.gz"))
1736 (sha256
1737 (base32
6a46a06c 1738 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
ac257f12
RW
1739 (build-system python-build-system)
1740 (arguments
1741 `(#:python ,python-2
1742 #:phases
1743 (modify-phases %standard-phases
1744 (replace 'check
1745 (lambda _
29594404 1746 (invoke "./testrun"))))))
ac257f12
RW
1747 (propagated-inputs
1748 `(("python2-coverage" ,python2-coverage)))
1749 (home-page "https://liw.fi/coverage-test-runner/")
1750 (synopsis "Python module for running unit tests")
1751 (description "@code{CoverageTestRunner} is a python module for running
1752unit tests and failing them if the unit test module does not exercise all
1753statements in the module it tests.")
1754 (license license:gpl3+)))
1755
10511c41
MO
1756;; Further releases, up to 2.4.3, have failing unit tests. See:
1757;; https://github.com/PyCQA/pylint/issues/3198.
ac257f12
RW
1758(define-public python-pylint
1759 (package
1760 (name "python-pylint")
10511c41 1761 (version "2.3.1")
ac257f12
RW
1762 (source
1763 (origin
10511c41
MO
1764 (method git-fetch)
1765 (uri (git-reference
1766 (url "https://github.com/PyCQA/pylint")
1767 (commit (string-append "pylint-" version))))
1768 (file-name (git-file-name name version))
ac257f12
RW
1769 (sha256
1770 (base32
10511c41 1771 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
ac257f12
RW
1772 (build-system python-build-system)
1773 (native-inputs
1774 `(("python-pytest" ,python-pytest)
1775 ("python-pytest-runner" ,python-pytest-runner)
1776 ("python-tox" ,python-tox)))
1777 (propagated-inputs
1778 `(("python-astroid" ,python-astroid)
1779 ("python-isort" ,python-isort)
1780 ("python-mccabe" ,python-mccabe)
1781 ("python-six" ,python-six)))
ac257f12
RW
1782 (home-page "https://github.com/PyCQA/pylint")
1783 (synopsis "Python source code analyzer which looks for coding standard
1784errors")
1785 (description "Pylint is a Python source code analyzer which looks
1786for programming errors, helps enforcing a coding standard and sniffs
1787for some code smells (as defined in Martin Fowler's Refactoring book).
1788
1789Pylint has many rules enabled by default, way too much to silence them
1790all on a minimally sized program. It's highly configurable and handle
1791pragmas to control it from within your code. Additionally, it is
1792possible to write plugins to add your own checks.")
1793 (properties `((python2-variant . ,(delay python2-pylint))))
1794 (license license:gpl2+)))
1795
74c1a561
MO
1796;; Python2 is not supported anymore by Pylint. See:
1797;; https://github.com/PyCQA/pylint/issues/1763.
ac257f12
RW
1798(define-public python2-pylint
1799 (let ((pylint (package-with-python2
74c1a561 1800 (strip-python2-variant python-pylint))))
ac257f12 1801 (package (inherit pylint)
06323c8e 1802 (version "1.9.5")
74c1a561
MO
1803 (source
1804 (origin
1805 (method git-fetch)
1806 (uri (git-reference
1807 (url "https://github.com/PyCQA/pylint")
1808 (commit (string-append "pylint-" version))))
1809 (file-name (git-file-name (package-name pylint) version))
1810 (sha256
1811 (base32
06323c8e 1812 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
74c1a561
MO
1813 (arguments
1814 `(,@(package-arguments pylint)
1815 #:phases
1816 (modify-phases %standard-phases
1817 (replace 'check
1818 (lambda _
1819 ;; Somehow, tests fail if run from the build directory.
1820 (let ((work "/tmp/work"))
1821 (mkdir-p work)
1822 (setenv "PYTHONPATH"
1823 (string-append (getenv "PYTHONPATH") ":" work))
1824 (copy-recursively "." work)
1825 (with-directory-excursion "/tmp"
1826 (invoke "python" "-m" "unittest" "discover"
1827 "-s" (string-append work "/pylint/test")
1828 "-p" "*test_*.py"))))))))
1829 (native-inputs
1830 `(("python2-futures" ,python2-futures)
1831 ,@(package-native-inputs pylint)))
ac257f12
RW
1832 (propagated-inputs
1833 `(("python2-backports-functools-lru-cache"
1834 ,python2-backports-functools-lru-cache)
1835 ("python2-configparser" ,python2-configparser)
1836 ,@(package-propagated-inputs pylint))))))
1837
1838(define-public python-paramunittest
1839 (package
1840 (name "python-paramunittest")
1841 (version "0.2")
1842 (source
1843 (origin
1844 (method url-fetch)
1845 (uri (pypi-uri "ParamUnittest" version))
1846 (sha256
1847 (base32
1848 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1849 (build-system python-build-system)
1850 (home-page
1851 "https://github.com/rik0/ParamUnittest")
1852 (synopsis
1853 "Simple extension to have parametrized unit tests")
1854 (description
1855 "This package allows to create parametrized unit-tests that work with the standard
1856unittest package. A parametrized test case is automatically converted to multiple test
1857cases. Since they are TestCase subclasses, they work with other test suites that
1858recognize TestCases.")
1859 (license license:bsd-2)))
1860
1861(define-public python2-python-paramunittest
1862 (package-with-python2 python-paramunittest))
1863
1864(define-public python-pytest-warnings
1865 (package
1866 (name "python-pytest-warnings")
1867 (version "0.2.0")
1868 (source
1869 (origin
1870 (method url-fetch)
1871 (uri (pypi-uri "pytest-warnings" version))
1872 (sha256
1873 (base32
1874 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1875 (build-system python-build-system)
1876 (propagated-inputs
2dd12924 1877 `(("pytest" ,python-pytest)))
ac257f12
RW
1878 (home-page "https://github.com/fschulze/pytest-warnings")
1879 (synopsis "Pytest plugin to list Python warnings in pytest report")
1880 (description
1881 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1882pytest report.")
29f25f29
MB
1883 (license license:expat)
1884 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1885 ;; This package is part of pytest as of version 3.1.0.
1886 (superseded . ,python-pytest)))))
ac257f12
RW
1887
1888(define-public python2-pytest-warnings
29f25f29
MB
1889 (package (inherit (package-with-python2
1890 (strip-python2-variant python-pytest-warnings)))
1891 (properties `((superseded . ,python2-pytest)))))
ac257f12
RW
1892
1893(define-public python-pytest-capturelog
1894 (package
1895 (name "python-pytest-capturelog")
1896 (version "0.7")
1897 (source
1898 (origin
1899 (method url-fetch)
1900 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1901 (sha256
1902 (base32
1903 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1904 (build-system python-build-system)
1905 (propagated-inputs
2dd12924 1906 `(("pytest" ,python-pytest)))
a7f27da7 1907 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
ac257f12
RW
1908 (synopsis "Pytest plugin to catch log messages")
1909 (description
1910 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1911 (license license:expat)))
1912
1913(define-public python2-pytest-capturelog
1914 (package-with-python2 python-pytest-capturelog))
1915
1916(define-public python-pytest-catchlog
1917 (package
1918 (name "python-pytest-catchlog")
1919 (version "1.2.2")
1920 (source
1921 (origin
1922 (method url-fetch)
1923 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1924 (sha256
1925 (base32
1926 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1927 (build-system python-build-system)
1928 (native-inputs
1929 `(("unzip" ,unzip)))
1930 (propagated-inputs
2dd12924 1931 `(("pytest" ,python-pytest)))
ac257f12
RW
1932 (home-page "https://github.com/eisensheng/pytest-catchlog")
1933 (synopsis "Pytest plugin to catch log messages")
1934 (description
1935 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1936a fork of pytest-capturelog.")
1937 (license license:expat)))
1938
1939(define-public python2-pytest-catchlog
1940 (package-with-python2 python-pytest-catchlog))
1941
1942(define-public python-nosexcover
1943 (package
1944 (name "python-nosexcover")
1945 (version "1.0.11")
1946 (source (origin
1947 (method url-fetch)
1948 (uri (pypi-uri "nosexcover" version))
1949 (sha256
1950 (base32
1951 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1952 (build-system python-build-system)
1953 (propagated-inputs
1954 `(("python-coverage" ,python-coverage)
1955 ("python-nose" ,python-nose)))
1956 (home-page "http://github.com/cmheisel/nose-xcover")
1957 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1958 (description "Nose-xcover is a companion to the built-in
1959@code{nose.plugins.cover}. This plugin will write out an XML coverage report
1960to a file named coverage.xml.
1961
1962It will honor all the options you pass to the Nose coverage plugin,
1963especially -cover-package.")
1964 (license license:expat)))
1965
1966(define-public python2-nosexcover
1967 (package-with-python2 python-nosexcover))
1968
1969(define-public python-discover
1970 (package
1971 (name "python-discover")
1972 (version "0.4.0")
1973 (source
1974 (origin
1975 (method url-fetch)
415ae330 1976 (uri (pypi-uri "discover" version))
ac257f12
RW
1977 (sha256
1978 (base32
1979 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1980 (build-system python-build-system)
1981 (home-page "http://pypi.python.org/pypi/discover/")
1982 (synopsis
1983 "Python test discovery for unittest")
1984 (description
1985 "Discover provides test discovery for unittest, a feature that has been
1986backported from Python 2.7 for Python 2.4+.")
1987 (license license:bsd-3)))
1988
1989(define-public python2-discover
1990 (package-with-python2 python-discover))
1991
1992(define-public behave
1993 (package
1994 (name "behave")
eddb9dac 1995 (version "1.2.6")
ac257f12
RW
1996 (source (origin
1997 (method url-fetch)
eddb9dac 1998 (uri (pypi-uri "behave" version))
ac257f12
RW
1999 (sha256
2000 (base32
eddb9dac 2001 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
ac257f12 2002 (build-system python-build-system)
1e257d3d
KK
2003 (native-inputs
2004 `(("python-mock" ,python-mock)
2005 ("python-nose" ,python-nose)
eddb9dac
MB
2006 ("python-pathpy" ,python-pathpy)
2007 ("python-pyhamcrest" ,python-pyhamcrest)
2008 ("python-pytest" ,python-pytest)))
ac257f12 2009 (propagated-inputs
037bef7d
DM
2010 `(("python-importlib-metadata" ,python-importlib-metadata)
2011 ("python-six" ,python-six)
ac257f12
RW
2012 ("python-parse" ,python-parse)
2013 ("python-parse-type" ,python-parse-type)))
1e257d3d 2014 (arguments
74471036
JL
2015 '(#:test-target "behave_test"
2016 #:phases
2017 (modify-phases %standard-phases
2018 (add-before 'check 'fix-library-loading
2019 (lambda _
2020 ;; Otherwise, tests fail with no module named 'path'
2021 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2022 (getcwd) "/tasks/_vendor"))
2023 #t)))))
ac257f12
RW
2024 (home-page "https://github.com/behave/behave")
2025 (synopsis "Python behavior-driven development")
2026 (description
2027 "Behave is a tool for behavior-driven development in python.
2028Behavior-driven development (or BDD) is an agile software development
2029technique that encourages collaboration between developers, QA and
2030non-technical or business participants in a software project. Behave uses
2031tests written in a natural language style, backed up by Python code.")
2032 (license license:x11)))
2033
2034(define-public python-behave-web-api
2035 (package
2036 (name "python-behave-web-api")
2037 (version "1.0.6")
2038 (source
2039 (origin
2040 (method url-fetch)
2041 (uri (pypi-uri "behave-web-api" version))
2042 (sha256
2043 (base32
2044 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2045 (build-system python-build-system)
2046 (arguments
2047 `(#:phases
2048 (modify-phases %standard-phases
2049 (add-after 'unpack 'fix-dependencies
2050 (lambda _
2051 (substitute* "setup.py"
2052 (("'wheel'") "") ; We don't use it.
29594404
MW
2053 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2054 #t)))))
ac257f12
RW
2055 (propagated-inputs
2056 `(("behave" ,behave)
2057 ("python-requests" ,python-requests)))
2058 (home-page "https://github.com/jefersondaniel/behave-web-api")
2059 (synopsis "Provides testing for JSON APIs with Behave for Python")
2060 (description "This package provides testing utility modules for testing
2061JSON APIs with Behave.")
2062 (license license:expat)))
2063
2064(define-public python2-behave-web-api
2065 (package-with-python2 python-behave-web-api))
2066
2067(define-public python-rednose
2068 (package
2069 (name "python-rednose")
a431b035 2070 (version "1.2.3")
ac257f12
RW
2071 (source
2072 (origin
2073 (method url-fetch)
2074 (uri (pypi-uri "rednose" version))
2075 (sha256
2076 (base32
a431b035 2077 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
ac257f12 2078 (build-system python-build-system)
c2f0e5a4
MB
2079 (arguments
2080 `(#:phases (modify-phases %standard-phases
2081 (add-after 'unpack 'patch-setup.py
2082 (lambda _
2083 ;; Six is only required for tests and later versions
2084 ;; work fine.
2085 (substitute* "setup.py"
2086 (("six==1.10.0") "six"))
2087 #t)))))
ac257f12
RW
2088 (propagated-inputs
2089 `(("python-colorama" ,python-colorama)
2090 ("python-termstyle" ,python-termstyle)))
2091 (native-inputs
2092 `(("python-six" ,python-six)
2093 ("python-nose" ,python-nose)))
2094 (home-page "https://github.com/JBKahn/rednose")
2095 (synopsis "Colored output for Python nosetests")
2096 (description "This package provides colored output for the
2097@command{nosetests} command of the Python Nose unit test framework.")
2098 (license license:bsd-3)))
2099
2100(define-public python2-rednose
2101 (package-with-python2 python-rednose))
2102
2103(define-public python-nose-randomly
2104 (package
2105 (name "python-nose-randomly")
9a0765aa 2106 (version "1.2.6")
ac257f12
RW
2107 (source
2108 (origin
2109 (method url-fetch)
2110 (uri (pypi-uri "nose-randomly" version))
2111 (sha256
9a0765aa 2112 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
ac257f12
RW
2113 (build-system python-build-system)
2114 (native-inputs
2115 `(("python-nose" ,python-nose)
2116 ("python-numpy" ,python-numpy)))
2117 (home-page "https://github.com/adamchainz/nose-randomly")
2118 (synopsis
2119 "Nose plugin to randomly order tests and control random.seed")
2120 (description
2121 "This is a @code{Nose} plugin to randomly order tests which can be quite
2122powerful in discovering hidden flaws in the tests themselves, while helping to
2123reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2124by resetting it to a repeatable number for each test, enabling the tests to
2125create data based on random numbers and yet remain repeatable.")
2126 (license license:bsd-3)))
2127
2128(define-public python2-nose-randomly
2129 (package-with-python2 python-nose-randomly))
2130
2131(define-public python-nose-timer
2132 (package
2133 (name "python-nose-timer")
9b241d4c 2134 (version "0.7.5")
ac257f12
RW
2135 (source
2136 (origin
2137 (method url-fetch)
2138 (uri (pypi-uri "nose-timer" version))
ac257f12 2139 (sha256
9b241d4c 2140 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
ac257f12
RW
2141 (build-system python-build-system)
2142 (propagated-inputs
2143 `(("python-nose" ,python-nose)
2144 ("python-termcolor" ,python-termcolor)))
2145 (home-page "https://github.com/mahmoudimus/nose-timer")
2146 (synopsis "Timer plugin for nosetests")
2147 (description "Shows how much time was needed to run individual tests.")
2148 (license license:expat)))
2149
2150(define-public python2-nose-timer
2151 (package-with-python2 python-nose-timer))
762b5a89
RW
2152
2153(define-public python-freezegun
2154 (package
2155 (name "python-freezegun")
4e24e442 2156 (version "0.3.12")
762b5a89
RW
2157 (source
2158 (origin
2159 (method url-fetch)
2160 (uri (pypi-uri "freezegun" version))
2161 (sha256
4e24e442 2162 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
762b5a89
RW
2163 (build-system python-build-system)
2164 (native-inputs
2165 `(("python-mock" ,python-mock)
4e24e442 2166 ("python-pytest" ,python-pytest)))
762b5a89
RW
2167 (propagated-inputs
2168 `(("python-six" ,python-six)
2169 ("python-dateutil" ,python-dateutil)))
2170 (arguments
2171 `(#:phases
2172 (modify-phases %standard-phases
2173 ;; The tests are normally executed via `make test`, but the PyPi
2174 ;; package does not include the Makefile.
2175 (replace 'check
2176 (lambda _
4e24e442 2177 (invoke "pytest" "-vv"))))))
762b5a89
RW
2178 (home-page "https://github.com/spulec/freezegun")
2179 (synopsis "Test utility for mocking the datetime module")
2180 (description
2181 "FreezeGun is a library that allows your python tests to travel through
2182time by mocking the datetime module.")
2183 (license license:asl2.0)))
2184
2185(define-public python2-freezegun
2186 (package-with-python2 python-freezegun))
2187
2188(define-public python-flexmock
2189 (package
2190 (name "python-flexmock")
9bec3ba4 2191 (version "0.10.4")
762b5a89
RW
2192 (source (origin
2193 (method url-fetch)
2194 (uri (pypi-uri "flexmock" version))
2195 (sha256
2196 (base32
9bec3ba4 2197 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
762b5a89
RW
2198 (build-system python-build-system)
2199 (home-page "https://flexmock.readthedocs.org")
2200 (synopsis "Testing library for Python")
2201 (description
2202 "flexmock is a testing library for Python that makes it easy to create
2203mocks, stubs and fakes.")
2204 (license license:bsd-3)))
2205
2206(define-public python2-flexmock
2207 (package-with-python2 python-flexmock))
2208
2209(define-public python-flaky
2210 (package
2211 (name "python-flaky")
eba8a00d 2212 (version "3.5.3")
762b5a89
RW
2213 (source (origin
2214 (method url-fetch)
2215 (uri (pypi-uri "flaky" version))
2216 (sha256
2217 (base32
eba8a00d 2218 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
762b5a89
RW
2219 (build-system python-build-system)
2220 (arguments
2221 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2222 '(#:tests? #f))
2223 (home-page "https://github.com/box/flaky")
2224 (synopsis "Automatically rerun flaky tests")
2225 (description
2226 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2227reruns flaky tests.
2228
2229Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2230on components that aren't 100% reliable. With flaky, instead of removing
2231those tests or marking them to @code{@@skip}, they can be automatically
2232retried.")
2233 (license license:asl2.0)))
2234
2235(define-public python2-flaky
2236 (package-with-python2 python-flaky))
18a4d6df
FT
2237
2238(define-public python-pyhamcrest
d08482f0
MB
2239 ;; The latest release was in 2016 and its test suite does not work with recent
2240 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2241 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2242 (revision "0"))
2243 (package
2244 (name "python-pyhamcrest")
2245 (version (git-version "1.9.0" revision commit))
2246 (source (origin
2247 ;; Tests not distributed from pypi release.
2248 (method git-fetch)
2249 (uri (git-reference
2250 (url "https://github.com/hamcrest/PyHamcrest")
2251 (commit commit)))
2252 (file-name (git-file-name name version))
2253 (sha256
2254 (base32
2255 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2256 (native-inputs ;all native inputs are for tests
2257 `(("python-pytest-cov" ,python-pytest-cov)
2258 ("python-mock" ,python-mock)
2259 ("python-pytest" ,python-pytest)
2260 ("python-hypothesis" ,python-hypothesis)))
2261 (propagated-inputs
2262 `(("python-six" ,python-six)))
2263 (build-system python-build-system)
2264 (arguments
2265 `(#:phases (modify-phases %standard-phases
2266 (replace 'check
2267 (lambda _
2268 (setenv "PYTHONPATH"
2269 (string-append "build/lib:"
2270 (getenv "PYTHONPATH")))
2271 (invoke "pytest" "-vv"))))))
2272 (home-page "http://hamcrest.org/")
2273 (synopsis "Hamcrest matchers for Python")
2274 (description
2275 "PyHamcrest is a framework for writing matcher objects,
18a4d6df 2276 allowing you to declaratively define \"match\" rules.")
d08482f0 2277 (license license:bsd-3))))
18a4d6df
FT
2278
2279(define-public python2-pyhamcrest
2280 (package-with-python2 python-pyhamcrest))
bebe3a4f
FT
2281
2282(define-public unittest-cpp
2283 (package
2284 (name "unittest-cpp")
2285 (version "2.0.0")
2286 (source (origin
8aedb3ad
EF
2287 (method git-fetch)
2288 (uri (git-reference
2289 (url "https://github.com/unittest-cpp/unittest-cpp")
2290 (commit (string-append "v" version))))
2291 (file-name (git-file-name name version))
bebe3a4f 2292 (sha256
8aedb3ad 2293 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
bebe3a4f
FT
2294 (arguments
2295 `(#:tests? #f)) ; It's run after build automatically.
2296 (build-system cmake-build-system)
2297 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2298 (synopsis "Lightweight unit testing framework for C++")
2299 (description "UnitTest++ is a lightweight unit testing framework for C++.
2300It was designed to do test-driven development on a wide variety of platforms.
2301Simplicity, portability, speed, and small footprint are all very important
2302aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2303of advanced library and language features, which means it should be easily
2304portable to just about any platform.")
2305 (license license:expat)))
85b28320
LC
2306
2307(define-public libfaketime
2308 (package
2309 (name "libfaketime")
c021c432 2310 (version "0.9.8")
85b28320
LC
2311 (home-page "https://github.com/wolfcw/libfaketime")
2312 (source (origin
2313 (method git-fetch)
2314 (uri (git-reference
2315 (url home-page)
2316 (commit (string-append "v" version))))
2317 (sha256
2318 (base32
c021c432 2319 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
85b28320
LC
2320 (file-name (git-file-name name version))))
2321 (build-system gnu-build-system)
2322 (arguments
2323 '(#:phases (modify-phases %standard-phases
2324 (replace 'configure
2325 (lambda* (#:key outputs #:allow-other-keys)
2326 (let ((out (assoc-ref outputs "out")))
2327 (setenv "CC" "gcc")
2328 (setenv "PREFIX" out)
2329 #t)))
2330 (add-before 'check 'pre-check
2331 (lambda _
2332 (substitute* "test/functests/test_exclude_mono.sh"
2333 (("/bin/bash") (which "bash")))
2334 #t)))
2335 #:test-target "test"))
2336 (native-inputs
2337 `(("perl" ,perl))) ;for tests
2338 (synopsis "Fake the system time for single applications")
2339 (description
2340 "The libfaketime library allows users to modify the system time that an
2341application \"sees\". It is meant to be loaded using the dynamic linker's
2342@code{LD_PRELOAD} environment variable. The @command{faketime} command
2343provides a simple way to achieve this.")
2344 (license license:gpl2)))
bd9d3db6
RW
2345
2346(define-public umockdev
2347 (package
2348 (name "umockdev")
abab956b 2349 (version "0.13.2")
bd9d3db6
RW
2350 (source (origin
2351 (method url-fetch)
2352 (uri (string-append "https://github.com/martinpitt/umockdev/"
2353 "releases/download/" version "/"
2354 "umockdev-" version ".tar.xz"))
2355 (sha256
2356 (base32
abab956b 2357 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
bd9d3db6
RW
2358 (build-system gnu-build-system)
2359 (arguments
2360 `(#:phases
2361 (modify-phases %standard-phases
2362 (add-after 'unpack 'skip-broken-test
2363 (lambda _
2364 (substitute* "tests/test-umockdev.c"
2365 (("/\\* sys/ in other dir")
2366 (string-append "return; // ")))
2367 #t)))))
2368 (native-inputs
2369 `(("vala" ,vala)
bd9d3db6 2370 ("gtk-doc" ,gtk-doc)
abab956b
TGR
2371 ("pkg-config" ,pkg-config)
2372
2373 ;; For tests.
2374 ("python" ,python)
2375 ("which" ,which)))
bd9d3db6
RW
2376 (inputs
2377 `(("glib" ,glib)
2378 ("eudev" ,eudev)
2379 ("libgudev" ,libgudev)
2380 ("gobject-introspection" ,gobject-introspection)))
2381 (home-page "https://github.com/martinpitt/umockdev/")
2382 (synopsis "Mock hardware devices for creating unit tests")
2383 (description "umockdev mocks hardware devices for creating integration
2384tests for hardware related libraries and programs. It also provides tools to
2385record the properties and behaviour of particular devices, and to run a
2386program or test suite under a test bed with the previously recorded devices
2387loaded.")
2388 (license license:lgpl2.1+)))
968e86bd 2389
e2ba79ef
MB
2390(define-public virtest
2391 ;; No releases yet, so we take the commit that "vc" expects.
2392 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2393 (revision "0"))
2394 (package
2395 (name "virtest")
2396 (version (git-version "0.0" revision commit))
2397 (home-page "https://github.com/mattkretz/virtest")
2398 (source (origin
2399 (method git-fetch)
2400 (uri (git-reference (url home-page) (commit commit)))
2401 (file-name (git-file-name name version))
2402 (sha256
2403 (base32
2404 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2405 (build-system cmake-build-system)
2406 (arguments
2407 `(#:phases (modify-phases %standard-phases
2408 (add-after 'unpack 'adjust-install-directory
2409 (lambda _
2410 ;; Vc is the only consumer of this library, and expects
2411 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2412 (substitute* "CMakeLists.txt"
2413 (("DESTINATION include/vir")
2414 "DESTINATION include/virtest"))
2415 #t)))))
2416 (synopsis "Header-only test framework")
2417 (description
2418 "@code{virtest} is a small header-only test framework for C++. It
2419grew out of the @dfn{Vc} project.")
2420 (license license:bsd-3))))
2421
968e86bd
CM
2422(define-public python-pyfakefs
2423 (package
2424 (name "python-pyfakefs")
2425 (version "3.5.8")
2426 (source (origin
2427 (method url-fetch)
2428 ;; We use the PyPI URL because there is no proper release
2429 ;; available from GitHub. The GitHub project only provides
2430 ;; autogenerated tarballs, which are known to change in place.
2431 (uri (pypi-uri "pyfakefs" version))
2432 (sha256
2433 (base32
2434 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2435 (patches (search-patches
2436 "python-pyfakefs-remove-bad-test.patch"))
2437 (file-name (string-append name "-" version ".tar.gz"))))
2438 (arguments
2439 `(#:phases
2440 (modify-phases %standard-phases
2441 ;; The default test suite does not run these extra tests.
2442 (add-after 'check 'check-pytest-plugin
2443 (lambda _
2444 (invoke
2445 "python" "-m" "pytest"
2446 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2447 #t)))))
2448 (native-inputs
2449 `(("python-pytest" ,python-pytest)))
2450 (build-system python-build-system)
2451 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2452 ;; page, but the pyfakefs documentation asks us to use this specific URL
2453 ;; when linking to the project. Honor their request.
2454 (home-page "http://pyfakefs.org/")
2455 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2456 (synopsis "Mock file system interactions in tests")
2457 (description
2458 "This package provides a Python library intended for use in automated
2459tests. One difficulty when testing software is that the code under test might
2460need to read or write to files in the local file system. If the file system
2461is not set up in just the right way, it might cause a spurious error during
2462the test. The pyfakefs library provides a solution to problems like this by
2463mocking file system interactions. In other words, it arranges for the code
2464under test to interact with a fake file system instead of the real file
2465system. The code under test requires no modification to work with pyfakefs.")
2466 (license license:asl2.0)))
2467
2468(define-public python2-pyfakefs
2469 (package-with-python2 python-pyfakefs))