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