1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
9 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
10 ;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
15 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
16 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
17 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
18 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
22 ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
24 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
27 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
32 ;;; This file is part of GNU Guix.
34 ;;; GNU Guix is free software; you can redistribute it and/or modify it
35 ;;; under the terms of the GNU General Public License as published by
36 ;;; the Free Software Foundation; either version 3 of the License, or (at
37 ;;; your option) any later version.
39 ;;; GNU Guix is distributed in the hope that it will be useful, but
40 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 ;;; GNU General Public License for more details.
44 ;;; You should have received a copy of the GNU General Public License
45 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47 (define-module (gnu packages check)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bash)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages llvm)
55 #:use-module (gnu packages glib)
56 #:use-module (gnu packages gnome)
57 #:use-module (gnu packages golang)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages python-web)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages time)
65 #:use-module (guix utils)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix packages)
68 #:use-module (guix download)
69 #:use-module (guix git-download)
70 #:use-module (guix build-system cmake)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system go)
73 #:use-module (guix build-system python)
74 #:use-module (guix build-system trivial))
83 (uri (string-append "https://github.com/libcheck/check/releases/download/"
84 version "/check-" version ".tar.gz"))
87 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
88 (build-system gnu-build-system)
89 (home-page "https://libcheck.github.io/check/")
90 (synopsis "Unit test framework for C")
92 "Check is a unit testing framework for C. It features a simple
93 interface for defining unit tests, putting little in the way of the
94 developer. Tests are run in a separate address space, so Check can
95 catch both assertion failures and code errors that cause segmentation
96 faults or other signals. The output from unit tests can be used within
97 source code editors and IDEs.")
98 (license license:lgpl2.1+)))
107 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
108 version "/CUnit-" version ".tar.bz2"))
111 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
112 (build-system gnu-build-system)
113 (arguments '(#:phases
114 (modify-phases %standard-phases
115 ;; XXX: The "bootstrap" phase detects the "bootstrap"
116 ;; script, but fails to execute it, so we bootstrap
119 (lambda _ (invoke "autoreconf" "-vfi"))))))
121 `(("automake" ,automake)
122 ("autoconf" ,autoconf)
123 ("libtool" ,libtool)))
124 (home-page "http://cunit.sourceforge.net/")
125 (synopsis "Automated testing framework for C")
127 "CUnit is a lightweight system for writing, administering, and running
128 unit tests in C. It provides C programmers with basic testing functionality
129 with a flexible variety of user interfaces.")
130 (license license:gpl2+)))
132 (define-public cppunit
138 (uri (string-append "http://dev-www.libreoffice.org/src/"
139 name "-" version ".tar.gz"))
142 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
143 ;; Explicitly link with libdl. This is expected to be done by packages
144 ;; relying on cppunit for their tests. However, not all of them do.
145 ;; If we added the linker flag to such packages, we would pollute all
146 ;; binaries, not only those used for testing.
148 `(#:make-flags '("LDFLAGS=-ldl")))
149 (build-system gnu-build-system)
150 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
151 (synopsis "Unit testing framework for C++")
152 (description "CppUnit is the C++ port of the famous JUnit framework for
153 unit testing. Test output is in XML for automatic testing and GUI based for
155 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
157 ;; Some packages require this newer version of cppunit. However, it needs
158 ;; C++11 support, which is not enabled by default in our current GCC, and
159 ;; updating in-place would require adding CXXFLAGS to many dependent packages.
160 ;; Thus, keep as a separate variable for now.
161 ;; TODO: Remove this when our default GCC is updated to 6 or higher.
162 (define-public cppunit-1.14
168 (uri (string-append "https://dev-www.libreoffice.org/src/"
169 "cppunit-" version ".tar.gz"))
172 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
174 ;; When dependent packages upgraded to use newer version of catch, this one should
176 (define-public catch-framework
179 (version "1.3.5") ;Sub-minor is the build number
183 (url "https://github.com/philsquared/Catch")
185 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
186 (file-name (string-append name "-" version))
189 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
190 (build-system trivial-build-system)
192 `(#:modules ((guix build utils))
194 (use-modules (guix build utils))
195 (let* ((source (assoc-ref %build-inputs "source"))
196 (output (assoc-ref %outputs "out"))
197 (incdir (string-append output "/include"))
198 (docdir (string-append output "/share/doc/catch-"
200 (for-each mkdir-p (list incdir docdir))
201 (install-file (string-append source
202 "/single_include/catch.hpp")
204 (copy-recursively (string-append source "/docs")
207 (home-page "http://catch-lib.net/")
208 (synopsis "Automated test framework for C++ and Objective-C")
210 "Catch stands for C++ Automated Test Cases in Headers and is a
211 multi-paradigm automated test framework for C++ and Objective-C.")
212 (license license:boost1.0)))
214 (define-public catch-framework2
218 (home-page "https://github.com/catchorg/Catch2")
222 (url "https://github.com/catchorg/Catch2")
223 (commit (string-append "v" version))))
224 (file-name (git-file-name name version))
227 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
228 (build-system cmake-build-system)
229 (synopsis "Automated test framework for C++ and Objective-C")
230 (description "Catch2 stands for C++ Automated Test Cases in Headers and is
231 a multi-paradigm automated test framework for C++ and Objective-C.")
232 (license license:boost1.0)))
234 (define-public cmdtest
240 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
241 name "-" version ".tar.gz"))
244 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
245 (build-system python-build-system)
249 (modify-phases %standard-phases
250 ;; check phase needs to be run before the build phase. If not, the
251 ;; coverage test runner looks for tests for the built source files,
254 (add-before 'build 'check
257 (("/bin/sh") (which "sh")))
258 ;; yarn uses python2-ttystatus to print messages.
259 ;; python2-ttystatus requires /dev/tty which is not present in
260 ;; the build environment. Hence assuming-failure test fails.
261 (delete-file "yarn.tests/assuming-failure.script")
262 (delete-file "yarn.tests/assuming-failure.stdout")
263 (invoke "python" "setup.py" "check"))))))
265 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
267 `(("python2-cliapp" ,python2-cliapp)
268 ("python2-markdown" ,python2-markdown)
269 ("python2-ttystatus" ,python2-ttystatus)))
270 (home-page "https://liw.fi/cmdtest/")
271 (synopsis "Black box Unix program tester")
273 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
274 given a command line and input files, and the expected output, and it verifies
275 that the command line produces the expected output. If not, it reports a
276 problem, and shows the differences.")
277 (license license:gpl3+)))
279 (define-public cmocka
285 (uri (string-append "https://cmocka.org/files/"
286 (version-major+minor version) "/cmocka-"
290 "1p9b6ccv939wjsgapn7wx24xw278awsw9h81lm0g4zw257hx276i"))))
291 (build-system cmake-build-system)
293 `(#:tests? #f)) ; no test target
294 (home-page "https://cmocka.org/")
295 (synopsis "Unit testing framework for C")
296 (description "Cmocka is a unit testing framework for C with support for
297 mock objects. It only requires the standard C library, and works with
298 different compilers. Cmocka supports several different message output formats
299 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
301 (license license:asl2.0)))
303 (define-public cppcheck
310 (url "https://github.com/danmar/cppcheck")
312 (file-name (git-file-name name version))
314 (base32 "0jr4aah72c7wy94a8vlj3k050rx6pmc7m9nvmll1jwbscxj5f7ff"))))
315 (build-system cmake-build-system)
317 '(#:configure-flags '("-DBUILD_TESTS=ON")))
318 (home-page "http://cppcheck.sourceforge.net")
319 (synopsis "Static C/C++ code analyzer")
320 (description "Cppcheck is a static code analyzer for C and C++. Unlike
321 C/C++ compilers and many other analysis tools it does not detect syntax errors
322 in the code. Cppcheck primarily detects the types of bugs that the compilers
323 normally do not detect. The goal is to detect only real errors in the code
324 (i.e. have zero false positives).")
325 (license license:gpl3+)))
327 (define-public go-gopkg.in-check.v1
328 (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
331 (name "go-gopkg.in-check.v1")
332 (version (git-version "0.0.0" revision commit))
336 (url "https://github.com/go-check/check.git")
338 (file-name (git-file-name name version))
341 "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
342 (build-system go-build-system)
344 '(#:import-path "gopkg.in/check.v1"))
345 (synopsis "Rich testing extension for Go's testing package")
347 "@code{check} is a rich testing extension for Go's testing package.")
348 (home-page "https://github.com/go-check/check")
349 (license license:bsd-2))))
351 (define-public go-github.com-smartystreets-gunit
353 (name "go-github.com-smartystreets-gunit")
358 (url "https://github.com/smartystreets/gunit")
360 (file-name (git-file-name name version))
363 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
364 (build-system go-build-system)
366 '(;; TODO: This package depends on go-github.com-smartystreets-assertions
367 ;; for running the tests, but go-github.com-smartystreets-assertions
368 ;; depends on this package, so break this loop by not running the tests
371 #:import-path "github.com/smartystreets/gunit"))
372 (synopsis "Testing tool for Go, in the style of xUnit")
374 "@code{gunit} allows the test author to use a struct as the scope for a
375 group of related test cases, in the style of xUnit fixtures. This makes
376 extraction of setup/teardown behavior (as well as invoking the system under
377 test) much simpler.")
378 (home-page "https://github.com/smartystreets/gunit")
379 (license license:expat)))
381 (define-public go-github.com-smartystreets-assertions
383 (name "go-github.com-smartystreets-assertions")
388 (url "https://github.com/smartystreets/assertions")
390 (file-name (git-file-name name version))
393 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
394 (build-system go-build-system)
396 '(#:import-path "github.com/smartystreets/assertions"))
398 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
399 (synopsis "Assertions for testing with Go")
401 "The @code{assertions} package provides convinient assertion functions
402 for writing tests in Go.")
403 (home-page "https://github.com/smartystreets/assertions")
404 (license license:expat)))
406 (define-public go-github.com-smartystreets-goconvey
408 (name "go-github.com-smartystreets-goconvey")
413 (url "https://github.com/smartystreets/goconvey")
415 (file-name (git-file-name name version))
418 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
419 (build-system go-build-system)
421 '(#:import-path "github.com/smartystreets/goconvey"))
423 `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
424 ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
425 (synopsis "Go testing tool with both a web and terminal user interface")
427 "GoConvey is a testing tool for Go. It integrates with go test, can show
428 test coverage and has a web user interface that will refresh automatically.")
429 (home-page "https://github.com/smartystreets/goconvey")
430 (license license:expat)))
432 ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
433 ;; switched back to simply using (PACKAGE-SOURCE ...).
434 (define-public googletest
441 (uri (string-append "https://github.com/google/googletest/archive/"
442 "release-" version ".tar.gz"))
443 (file-name (string-append name "-" version ".tar.gz"))
446 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
447 (build-system cmake-build-system)
449 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
451 `(("python-2" ,python-2)))
452 (home-page "https://github.com/google/googletest/")
453 (synopsis "Test discovery and XUnit test framework")
454 (description "Google Test features an XUnit test framework, automated test
455 discovery, death tests, assertions, parameterized tests and XML test report
457 (license license:bsd-3)))
459 (define-public cpputest
466 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
467 version "/cpputest-" version ".tar.gz"))
470 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
471 (build-system gnu-build-system)
473 `(("googletest" ,googletest)))
474 (home-page "https://cpputest.github.io/")
475 (synopsis "Unit testing and mocking framework for C/C++")
477 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
478 C++ but is used in C and C++ projects and frequently used in embedded systems
479 but it works for any C/C++ project.")
480 (license license:bsd-3)))
482 (define-public python-parameterized
484 (name "python-parameterized")
489 (uri (pypi-uri "parameterized" version))
492 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
493 (build-system python-build-system)
494 (arguments '(#:tests? #f)) ; there are no tests
495 (home-page "https://github.com/wolever/parameterized")
496 (synopsis "Parameterized testing with any Python test framework")
498 "Parameterized is a Python library that aims to fix parameterized testing
499 for every Python test framework. It supports nose, py.test, and unittest.")
500 (license license:bsd-2)))
502 (define-public python2-parameterized
503 (package-with-python2 python-parameterized))
505 (define-public python-mock
512 (uri (pypi-uri "mock" version))
515 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
517 `(("python-pbr" ,python-pbr-minimal)
518 ("python-six" ,python-six)))
519 (build-system python-build-system)
521 `(("python-unittest2" ,python-unittest2)))
524 (modify-phases %standard-phases
527 (zero? (system* "unit2")))))))
528 (home-page "https://github.com/testing-cabal/mock")
529 (synopsis "Python mocking and patching library for testing")
531 "Mock is a library for testing in Python. It allows you to replace parts
532 of your system under test with mock objects and make assertions about how they
534 (properties `((python2-variant . ,(delay python2-mock))))
535 (license license:expat)))
537 (define-public python2-mock
538 (let ((base (package-with-python2
539 (strip-python2-variant python-mock))))
540 (package (inherit base)
542 `(("python2-functools32" ,python2-functools32)
543 ("python2-funcsigs" ,python2-funcsigs)
544 ,@(package-propagated-inputs base))))))
546 (define-public python-nose
553 (uri (pypi-uri "nose" version))
556 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
557 (build-system python-build-system)
559 '(#:tests? #f)) ; FIXME: test suite fails
560 (home-page "http://readthedocs.org/docs/nose/")
561 (synopsis "Python testing library")
563 "Nose extends the unittest library to make testing easier.")
564 (license license:lgpl2.0+)))
566 (define-public python2-nose
567 (package-with-python2 python-nose))
569 (define-public python-nose2
571 (name "python-nose2")
576 (uri (pypi-uri "nose2" version))
579 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
580 (build-system python-build-system)
581 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
583 `(("python-cov-core" ,python-cov-core)
584 ("python-pytest-cov" ,python-pytest-cov)
585 ("python-six" ,python-six)))
586 (home-page "https://github.com/nose-devs/nose2")
587 (synopsis "Next generation of nicer testing for Python")
589 "Nose2 is the next generation of nicer testing for Python, based on the
590 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
591 better plugin api, being easier for users to configure, and simplifying internal
592 interfaces and processes.")
593 (license license:bsd-2)))
595 (define-public python2-nose2
596 (package-with-python2 python-nose2))
598 (define-public python-unittest2
600 (name "python-unittest2")
605 (uri (pypi-uri "unittest2" version))
607 (search-patches "python-unittest2-python3-compat.patch"
608 "python-unittest2-remove-argparse.patch"))
611 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
612 (build-system python-build-system)
615 (modify-phases %standard-phases
618 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
620 `(("python-six" ,python-six)
621 ("python-traceback2" ,python-traceback2)))
622 (home-page "http://pypi.python.org/pypi/unittest2")
623 (synopsis "Python unit testing library")
625 "Unittest2 is a replacement for the unittest module in the Python
627 (license license:psfl)))
629 (define-public python2-unittest2
630 (package-with-python2 python-unittest2))
632 (define-public python-pytest
634 (name "python-pytest")
639 (uri (pypi-uri "pytest" version))
642 "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
643 (build-system python-build-system)
646 (modify-phases %standard-phases
647 (add-before 'check 'disable-invalid-tests
649 ;; Some tests involves the /usr directory, and fails.
650 (substitute* "testing/test_argcomplete.py"
651 (("def test_remove_dir_prefix\\(self\\):")
652 "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
653 (substitute* "testing/test_argcomplete.py"
654 (("def test_remove_dir_prefix" line)
655 (string-append "@pytest.mark.skip"
656 "(reason=\"Assumes that /usr exists.\")\n "
659 (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
661 `(("python-atomicwrites" ,python-atomicwrites)
662 ("python-attrs" ,python-attrs-bootstrap)
663 ("python-more-itertools" ,python-more-itertools)
664 ("python-pluggy" ,python-pluggy)
665 ("python-py" ,python-py)
666 ("python-six" ,python-six-bootstrap)))
668 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
670 ("python-hypothesis" ,python-hypothesis)
671 ("python-nose" ,python-nose)
672 ("python-mock" ,python-mock)
673 ("python-pytest" ,python-pytest-bootstrap)
674 ("python-setuptools-scm" ,python-setuptools-scm)))
675 (home-page "http://pytest.org")
676 (synopsis "Python testing library")
678 "Pytest is a testing tool that provides auto-discovery of test modules
679 and functions, detailed info on failing assert statements, modular fixtures,
680 and many external plugins.")
681 (license license:expat)
682 (properties `((python2-variant . ,(delay python2-pytest))))))
684 (define-public python2-pytest
685 (let ((pytest (package-with-python2
686 (strip-python2-variant python-pytest))))
690 `(("python2-funcsigs" ,python2-funcsigs)
691 ("python2-pathlib2" ,python2-pathlib2)
692 ,@(package-propagated-inputs pytest))))))
694 (define-public python-pytest-bootstrap
696 (inherit (strip-python2-variant python-pytest))
697 (name "python-pytest-bootstrap")
698 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
699 (arguments `(#:tests? #f))
700 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
702 (define-public python2-pytest-bootstrap
703 (let ((pytest (package-with-python2
704 (strip-python2-variant python-pytest-bootstrap))))
705 (package (inherit pytest)
707 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
708 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
709 ,@(package-propagated-inputs pytest))))))
711 (define-public python-pytest-cov
713 (name "python-pytest-cov")
718 (uri (pypi-uri "pytest-cov" version))
721 "0qnpp9y3ygx4jk4pf5ad71fh2skbvnr6gl54m7rg5qysnx4g0q73"))))
722 (build-system python-build-system)
725 (modify-phases %standard-phases
728 ;; options taken from tox.ini
729 ;; TODO: make "--restructuredtext" tests pass. They currently fail
730 ;; with "Duplicate implicit target name"
731 (invoke "python" "./setup.py" "check"
732 "--strict" "--metadata"))))))
734 `(("python-coverage" ,python-coverage)
735 ("python-pytest" ,python-pytest)))
736 (home-page "https://github.com/pytest-dev/pytest-cov")
737 (synopsis "Pytest plugin for measuring coverage")
739 "Pytest-cov produces coverage reports. It supports centralised testing and
740 distributed testing in both @code{load} and @code{each} modes. It also
741 supports coverage of subprocesses.")
742 (license license:expat)))
744 (define-public python2-pytest-cov
745 (package-with-python2 python-pytest-cov))
747 (define-public python-pytest-runner
749 (name "python-pytest-runner")
754 (uri (pypi-uri "pytest-runner" version))
757 "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
758 (build-system python-build-system)
760 `(("python-pytest" ,python-pytest-bootstrap)
761 ("python-setuptools-scm" ,python-setuptools-scm)))
762 (home-page "https://github.com/pytest-dev/pytest-runner")
763 (synopsis "Invoke py.test as a distutils command")
765 "This package provides a @command{pytest-runner} command that
766 @file{setup.py} files can use to run tests.")
767 (license license:expat)))
769 (define-public python2-pytest-runner
770 (package-with-python2 python-pytest-runner))
772 (define-public python-pytest-mock
774 (name "python-pytest-mock")
779 (uri (pypi-uri "pytest-mock" version))
782 "1h6lgpmsvs9s8j2s80v06f9f3iaw1n1rc51mbrxk1f12sw4q56nq"))))
783 (build-system python-build-system)
785 `(("python-setuptools-scm" ,python-setuptools-scm)))
787 `(("python-pytest" ,python-pytest)))
788 (home-page "https://github.com/pytest-dev/pytest-mock/")
789 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
791 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
792 around the patching API provided by the @code{mock} package, but with the
793 benefit of not having to worry about undoing patches at the end of a test.
794 The mocker fixture has the same API as @code{mock.patch}, supporting the
796 (properties `((python2-variant . ,(delay python2-pytest-mock))))
797 (license license:expat)))
799 (define-public python2-pytest-mock
800 (let ((base (package-with-python2
801 (strip-python2-variant python-pytest-mock))))
802 (package (inherit base)
804 `(("python2-mock" ,python2-mock)
805 ,@(package-propagated-inputs base))))))
807 (define-public python-pytest-xdist
809 (name "python-pytest-xdist")
814 (uri (pypi-uri "pytest-xdist" version))
817 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
818 (modules '((guix build utils)))
821 ;; Remove pre-compiled .pyc files from source.
822 (for-each delete-file-recursively
823 (find-files "." "__pycache__" #:directories? #t))
824 (for-each delete-file (find-files "." "\\.pyc$"))
826 (build-system python-build-system)
828 '(#:tests? #f)) ;FIXME: Some tests are failing.
830 ;; (modify-phases %standard-phases
832 ;; (add-after 'install 'check
833 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
834 ;; (add-installed-pythonpath inputs outputs)
835 ;; (zero? (system* "py.test" "-v")))))
837 `(("python-setuptools-scm" ,python-setuptools-scm)))
839 `(("python-execnet" ,python-execnet)
840 ("python-pytest" ,python-pytest)
841 ("python-py" ,python-py)))
843 "https://github.com/pytest-dev/pytest-xdist")
845 "Plugin for py.test with distributed testing and loop-on-failing modes")
847 "The pytest-xdist plugin extends py.test with some unique test execution
848 modes: parallelization, running tests in boxed subprocesses, the ability
849 to run tests repeatedly when failed, and the ability to run tests on multiple
850 Python interpreters or platforms. It uses rsync to copy the existing
851 program code to a remote location, executes there, and then syncs the
853 (license license:expat)))
855 (define-public python2-pytest-xdist
856 (package-with-python2 python-pytest-xdist))
858 (define-public python-scripttest
860 (name "python-scripttest")
865 (uri (pypi-uri "scripttest" version))
868 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
869 (build-system python-build-system)
871 `(("python-pytest" ,python-pytest)))
872 (home-page "http://pythonpaste.org/scripttest/")
873 (synopsis "Python library to test command-line scripts")
874 (description "Scripttest is a Python helper library for testing
875 interactive command-line applications. With it you can run a script in a
876 subprocess and see the output as well as any file modifications.")
877 (license license:expat)))
879 (define-public python2-scripttest
880 (package-with-python2 python-scripttest))
882 (define-public python-testtools-bootstrap
884 (name "python-testtools-bootstrap")
889 (uri (pypi-uri "testtools" version))
892 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
893 (patches (search-patches "python-testtools.patch"))))
894 (build-system python-build-system)
895 (arguments '(#:tests? #f))
897 `(("python-extras" ,python-extras)
898 ("python-fixtures" ,python-fixtures-bootstrap)
899 ("python-mimeparse" ,python-mimeparse)
900 ("python-pbr" ,python-pbr-minimal)
901 ("python-six" ,python-six)
902 ("python-traceback2" ,python-traceback2)
903 ("python-unittest2" ,python-unittest2)))
904 (home-page "https://github.com/testing-cabal/testtools")
906 "Extensions to the Python standard library unit testing framework")
908 "This package is only for bootstrapping. Do not use this.")
909 (license license:psfl)))
911 (define-public python2-testtools-bootstrap
912 (package-with-python2 python-testtools-bootstrap))
914 (define-public python-testtools
916 (inherit python-testtools-bootstrap)
917 (name "python-testtools")
919 `(#:phases (modify-phases %standard-phases
922 (invoke "python" "-m" "testtools.run"
923 "testtools.tests.test_suite"))))))
925 `(("python-extras" ,python-extras)
926 ("python-fixtures" ,python-fixtures)
927 ("python-mimeparse" ,python-mimeparse)
928 ("python-pbr" ,python-pbr)
929 ("python-six" ,python-six)
930 ("python-traceback2" ,python-traceback2)
931 ("python-unittest2" ,python-unittest2)))
933 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
935 "Testtools extends the Python standard library unit testing framework to
936 provide matchers, more debugging information, and cross-Python
939 (define-public python2-testtools
940 (package-with-python2 python-testtools))
942 (define-public python-testscenarios-bootstrap
944 (name "python-testscenarios-bootstrap")
949 (uri (pypi-uri "testscenarios" version))
952 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
953 (build-system python-build-system)
955 `(#:phases (modify-phases %standard-phases
958 (invoke "python" "-m" "testtools.run"
959 "testscenarios.test_suite"))))))
961 `(("python-pbr" ,python-pbr-minimal)
962 ("python-testtools" ,python-testtools-bootstrap)))
963 (home-page "https://launchpad.net/testscenarios")
964 (synopsis "Pyunit extension for dependency injection")
966 "This package is only for bootstrapping. Don't use this.")
967 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
969 (define-public python2-testscenarios-bootstrap
970 (package-with-python2 python-testscenarios-bootstrap))
972 (define-public python-testscenarios
974 (inherit python-testscenarios-bootstrap)
975 (name "python-testscenarios")
977 `(("python-pbr" ,python-pbr)
978 ("python-testtools" ,python-testtools)))
980 "Testscenarios provides clean dependency injection for Python unittest
983 (define-public python2-testscenarios
984 (package-with-python2 python-testscenarios))
986 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
987 ;; own tests. Hence this bootstrap variant.
988 (define-public python-testresources-bootstrap
990 (name "python-testresources-bootstrap")
994 (uri (pypi-uri "testresources" version))
997 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
998 (build-system python-build-system)
999 (arguments '(#:tests? #f))
1001 `(("python-pbr" ,python-pbr-minimal)))
1002 (home-page "https://launchpad.net/testresources")
1004 "Pyunit extension for managing test resources")
1006 "This package is only here for bootstrapping purposes. Use the regular
1007 testresources package instead.")
1008 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1010 (define-public python2-testresources-bootstrap
1011 (package-with-python2 python-testresources-bootstrap))
1013 (define-public python-testresources
1015 (inherit python-testresources-bootstrap)
1016 (name "python-testresources")
1018 `(("python-pbr" ,python-pbr)))
1021 `(("python-fixtures" ,python-fixtures)
1022 ("python-testtols" ,python-testtools)))
1024 "Testresources is an extension to Python's unittest to allow declarative
1025 use of resources by test cases.")))
1027 (define-public python2-testresources
1028 (package-with-python2 python-testresources))
1030 (define-public python-subunit-bootstrap
1032 (name "python-subunit-bootstrap")
1037 (uri (pypi-uri "python-subunit" version))
1040 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1041 (build-system python-build-system)
1043 `(("python-extras" ,python-extras)
1044 ("python-testtools" ,python-testtools-bootstrap)))
1046 `(("python-fixtures" ,python-fixtures-bootstrap)
1047 ("python-hypothesis" ,python-hypothesis)
1048 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1049 (home-page "https://launchpad.net/subunit")
1050 (synopsis "Python implementation of the subunit protocol")
1052 "This package is here for bootstrapping purposes only. Use the regular
1053 python-subunit package instead.")
1054 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1056 (define-public python2-subunit-bootstrap
1057 (package-with-python2 python-subunit-bootstrap))
1059 (define-public python-subunit
1061 (inherit python-subunit-bootstrap)
1062 (name "python-subunit")
1064 `(("python-extras" ,python-extras)
1065 ("python-testtools" ,python-testtools)))
1067 `(("python-fixtures" ,python-fixtures)
1068 ("python-hypothesis" ,python-hypothesis)
1069 ("python-testscenarios" ,python-testscenarios)))
1071 "Python-subunit is a Python implementation of the subunit test streaming
1074 (define-public python2-subunit
1075 (package-with-python2 python-subunit))
1077 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1078 ;; own tests. Hence this bootstrap variant.
1079 (define-public python-fixtures-bootstrap
1081 (name "python-fixtures-bootstrap")
1085 (uri (pypi-uri "fixtures" version))
1088 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1089 (build-system python-build-system)
1090 (arguments `(#:tests? #f))
1092 `(("python-pbr-minimal" ,python-pbr-minimal)
1093 ("python-six" ,python-six)))
1094 (home-page "https://launchpad.net/python-fixtures")
1095 (synopsis "Python test fixture library")
1097 "This package is only used for bootstrapping. Use the regular
1098 python-fixtures package instead.")
1099 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1101 (define-public python2-fixtures-bootstrap
1102 (package-with-python2 python-fixtures-bootstrap))
1104 (define-public python-fixtures
1106 (inherit python-fixtures-bootstrap)
1107 (name "python-fixtures")
1110 (modify-phases %standard-phases
1113 (invoke "python" "-m" "testtools.run"
1114 "fixtures.test_suite"))))))
1116 ;; Fixtures uses pbr at runtime to check versions, etc.
1117 `(("python-pbr" ,python-pbr)
1118 ("python-six" ,python-six)))
1120 `(("python-mock" ,python-mock)
1121 ("python-testtools" ,python-testtools-bootstrap)))
1123 "Fixtures provides a way to create reusable state, useful when writing
1126 (define-public python2-fixtures
1127 (package-with-python2 python-fixtures))
1129 (define-public python-testrepository-bootstrap
1131 (name "python-testrepository-bootstrap")
1136 (uri (pypi-uri "testrepository" version))
1139 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1140 (build-system python-build-system)
1141 (arguments '(#:tests? #f))
1143 `(("python-fixtures" ,python-fixtures-bootstrap)
1144 ("python-subunit" ,python-subunit-bootstrap)
1145 ("python-testtools" ,python-testtools-bootstrap)))
1147 `(("python-mimeparse" ,python-mimeparse)))
1148 (home-page "https://launchpad.net/testrepository")
1149 (synopsis "Database for Python test results")
1151 "Bootstrap package for python-testrepository. Don't use this.")
1152 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1154 (define-public python2-testrepository-bootstrap
1155 (package-with-python2 python-testrepository-bootstrap))
1157 (define-public python-testrepository
1159 (inherit python-testrepository-bootstrap)
1160 (name "python-testrepository")
1162 ;; FIXME: Many tests are failing.
1165 `(("python-fixtures" ,python-fixtures)
1166 ("python-subunit" ,python-subunit)
1167 ("python-testtools" ,python-testtools)))
1169 `(("python-mimeparse" ,python-mimeparse)))
1170 (description "Testrepository provides a database of test results which can
1171 be used as part of a developer's workflow to check things such as what tests
1172 have failed since the last commit or what tests are currently failing.")))
1174 (define-public python2-testrepository
1175 (package-with-python2 python-testrepository))
1177 (define-public python-coverage
1179 (name "python-coverage")
1184 (uri (pypi-uri "coverage" version))
1187 "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
1188 (build-system python-build-system)
1190 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1192 (home-page "http://nedbatchelder.com/code/coverage")
1193 (synopsis "Code coverage measurement for Python")
1195 "Coverage measures code coverage, typically during test execution. It
1196 uses the code analysis tools and tracing hooks provided in the Python standard
1197 library to determine which lines are executable, and which have been
1199 (license license:bsd-3)))
1201 (define-public python2-coverage
1202 (package-with-python2 python-coverage))
1204 (define-public python-cov-core
1206 (name "python-cov-core")
1211 (uri (pypi-uri "cov-core" version))
1214 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1215 (build-system python-build-system)
1217 `(("python-coverage" ,python-coverage)))
1218 (home-page "https://github.com/schlamar/cov-core")
1219 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1221 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1222 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1223 testing frameworks.")
1224 (license license:expat)))
1226 (define-public python2-cov-core
1227 (package-with-python2 python-cov-core))
1229 (define-public python-codecov
1231 (name "python-codecov")
1236 (uri (pypi-uri "codecov" version))
1239 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1240 (build-system python-build-system)
1242 `(("python-unittest2" ,python-unittest2)))
1244 `(("python-coverage" ,python-coverage)
1245 ("python-requests" ,python-requests)))
1246 (home-page "http://github.com/codecov/codecov-python")
1247 (synopsis "Upload code coverage reports to @code{codecov.io}")
1249 "Codecov collects code coverage reports from code written in Python, Java,
1250 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1251 (license license:asl2.0)))
1253 (define-public python-testpath
1255 (name "python-testpath")
1261 (url "https://github.com/jupyter/testpath")
1263 (file-name (git-file-name name version))
1266 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1267 (build-system python-build-system)
1269 `(#:tests? #f ; this package does not even have a setup.py
1270 #:modules ((guix build python-build-system)
1273 #:imported-modules (,@%python-build-system-modules
1276 (modify-phases %standard-phases
1279 (lambda* (#:key inputs outputs #:allow-other-keys)
1280 (let* ((version (last
1281 (string-split (assoc-ref inputs "python") #\-)))
1282 (x.y (string-join (take (string-split version #\.) 2)
1285 (assoc-ref outputs "out")
1286 "/lib/python" x.y "/site-packages/testpath")))
1288 (copy-recursively "testpath" dir))
1290 (home-page "https://github.com/takluyver/testpath")
1291 (synopsis "Test utilities for code working with files and commands")
1293 "Testpath is a collection of utilities for Python code working with files
1294 and commands. It contains functions to check things on the file system, and
1295 tools for mocking system commands and recording calls to those.")
1296 (license license:expat)))
1298 (define-public python2-testpath
1299 (package-with-python2 python-testpath))
1301 (define-public python-testlib
1303 (name "python-testlib")
1308 (uri (pypi-uri "testlib" version ".zip"))
1310 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1311 (build-system python-build-system)
1313 `(("unzip" ,unzip))) ; for unpacking the source
1314 (synopsis "Python micro test suite harness")
1315 (description "A micro unittest suite harness for Python.")
1316 (home-page "https://github.com/trentm/testlib")
1317 (license license:expat)))
1319 (define-public python2-testlib
1320 (package-with-python2 python-testlib))
1322 ;;; The software provided by this package was integrated into pytest 2.8.
1323 (define-public python-pytest-cache
1325 (name "python-pytest-cache")
1329 (uri (pypi-uri "pytest-cache" version))
1332 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1333 (build-system python-build-system)
1335 `(("python-apipkg" ,python-apipkg)
1336 ("python-execnet" ,python-execnet)
1337 ("python-py" ,python-py)
1338 ("python-pytest" ,python-pytest)))
1339 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1340 (description "The pytest-cache plugin provides tools to rerun failures from
1341 the last py.test invocation.")
1342 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1343 (license license:expat)))
1345 (define-public python2-pytest-cache
1346 (package-with-python2 python-pytest-cache))
1348 (define-public python-pytest-localserver
1350 (name "python-pytest-localserver")
1354 (uri (pypi-uri "pytest-localserver" version))
1357 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1358 (build-system python-build-system)
1361 (modify-phases %standard-phases
1364 (invoke "py.test" "-v"))))))
1366 `(("python-pytest" ,python-pytest)
1367 ("python-requests" ,python-requests)
1368 ("python-six" ,python-six)))
1370 `(("python-werkzeug" ,python-werkzeug)))
1371 (synopsis "Py.test plugin to test server connections locally")
1372 (description "Pytest-localserver is a plugin for the pytest testing
1373 framework which enables you to test server connections locally.")
1374 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1375 (license license:expat)))
1377 (define-public python-pytest-xprocess
1379 (name "python-pytest-xprocess")
1383 (uri (pypi-uri "pytest-xprocess" version))
1386 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1387 (build-system python-build-system)
1389 `(("python-pytest" ,python-pytest)
1390 ("python-pytest-cache" ,python-pytest-cache)
1391 ("python-psutil" ,python-psutil)))
1392 (synopsis "Pytest plugin to manage external processes across test runs")
1393 (description "Pytest-xprocess is an experimental py.test plugin for managing
1394 processes across test runs.")
1395 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1396 (license license:expat)))
1398 (define-public python-pytest-subtesthack
1400 (name "python-pytest-subtesthack")
1404 (uri (pypi-uri "pytest-subtesthack" version))
1407 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1408 (build-system python-build-system)
1410 `(("python-pytest" ,python-pytest)))
1411 (synopsis "Set-up and tear-down fixtures for unit tests")
1412 (description "This plugin allows you to set up and tear down fixtures within
1413 unit test functions that use @code{py.test}. This is useful for using
1414 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1415 function multiple times, without setting up or tearing down fixture state as is
1416 normally the case.")
1417 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1418 (license license:unlicense)))
1420 (define-public python2-pytest-subtesthack
1421 (package-with-python2 python-pytest-subtesthack))
1423 (define-public python-pytest-sugar
1425 (name "python-pytest-sugar")
1430 (uri (pypi-uri "pytest-sugar" version))
1433 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1434 (build-system python-build-system)
1436 `(("python-packaging" ,python-packaging)
1437 ("python-pytest" ,python-pytest)
1438 ("python-termcolor" ,python-termcolor)))
1439 (home-page "https://pivotfinland.com/pytest-sugar/")
1440 (synopsis "Plugin for pytest that changes the default look and feel")
1442 "@code{pytest-sugar} is a plugin for py.test that changes the default
1443 look and feel of py.test, using a progress bar and showing failures and errors
1445 (license license:bsd-3)))
1447 (define-public python-hypothesis
1449 (name "python-hypothesis")
1453 (uri (pypi-uri "hypothesis" version))
1456 "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
1457 (build-system python-build-system)
1459 `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
1460 ("python-flake8" ,python-flake8-3.5)
1461 ("python-pytest" ,python-pytest-bootstrap)))
1463 `(("python-attrs" ,python-attrs-bootstrap)
1464 ("python-coverage" ,python-coverage)))
1465 (synopsis "Library for property based testing")
1466 (description "Hypothesis is a library for testing your Python code against a
1467 much larger range of examples than you would ever want to write by hand. It’s
1468 based on the Haskell library, Quickcheck, and is designed to integrate
1469 seamlessly into your existing Python unit testing work flow.")
1470 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1471 (license license:mpl2.0)
1472 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1474 (define-public python2-hypothesis
1475 (let ((hypothesis (package-with-python2
1476 (strip-python2-variant python-hypothesis))))
1477 (package (inherit hypothesis)
1479 `(("python2-enum34" ,python2-enum34)
1480 ,@(package-propagated-inputs hypothesis))))))
1482 (define-public python-lit
1489 (uri (pypi-uri "lit" version))
1492 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1493 (build-system python-build-system)
1496 (modify-phases %standard-phases
1499 (invoke "python" "lit.py" "tests"))))))
1502 (home-page "https://llvm.org/")
1503 (synopsis "LLVM Software Testing Tool")
1504 (description "@code{lit} is a portable tool for executing LLVM and Clang
1505 style test suites, summarizing their results, and providing indication of
1507 (license license:ncsa)))
1509 (define-public python2-lit
1510 (package-with-python2 python-lit))
1512 (define-public python-pytest-pep8
1514 (name "python-pytest-pep8")
1518 (uri (pypi-uri "pytest-pep8" version))
1521 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1522 (build-system python-build-system)
1524 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1526 `(("python-pytest" ,python-pytest)))
1528 `(("python-pep8" ,python-pep8)))
1529 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1530 (synopsis "Py.test plugin to check PEP8 requirements")
1531 (description "Pytest plugin for checking PEP8 compliance.")
1532 (license license:expat)))
1534 (define-public python2-pytest-pep8
1535 (package-with-python2 python-pytest-pep8))
1537 (define-public python-pytest-flakes
1539 (name "python-pytest-flakes")
1543 (uri (pypi-uri "pytest-flakes" version))
1546 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1547 (build-system python-build-system)
1550 (modify-phases %standard-phases
1552 (add-after 'install 'check
1553 (lambda* (#:key outputs inputs #:allow-other-keys)
1554 ;; It's easier to run tests after install.
1555 ;; Make installed package available for running the tests
1556 (add-installed-pythonpath inputs outputs)
1557 (invoke "py.test" "-vv"))))))
1559 `(("python-coverage" ,python-coverage)
1560 ("python-pytest" ,python-pytest)
1561 ("python-pytest-cache" ,python-pytest-cache)
1562 ("python-pytest-pep8" ,python-pytest-pep8)))
1564 `(("python-pyflakes" ,python-pyflakes)))
1565 (home-page "https://github.com/fschulze/pytest-flakes")
1566 (synopsis "Py.test plugin to check source code with pyflakes")
1567 (description "Pytest plugin for checking Python source code with pyflakes.")
1568 (license license:expat)))
1570 (define-public python2-pytest-flakes
1571 (package-with-python2 python-pytest-flakes))
1573 (define-public python2-coverage-test-runner
1575 (name "python2-coverage-test-runner")
1581 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1582 "coverage-test-runner/snapshot/coverage-test-runner-"
1586 "0y1m7z3dl63kmhcmydl1mwg0hacnf6ghrx9dah17j9iasssfa3g7"))))
1587 (build-system python-build-system)
1589 `(#:python ,python-2
1591 (modify-phases %standard-phases
1594 (invoke "./testrun"))))))
1596 `(("python2-coverage" ,python2-coverage)))
1597 (home-page "https://liw.fi/coverage-test-runner/")
1598 (synopsis "Python module for running unit tests")
1599 (description "@code{CoverageTestRunner} is a python module for running
1600 unit tests and failing them if the unit test module does not exercise all
1601 statements in the module it tests.")
1602 (license license:gpl3+)))
1604 (define-public python-pylint
1606 (name "python-pylint")
1612 "https://github.com/PyCQA/pylint/archive/pylint-"
1616 "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
1617 (build-system python-build-system)
1619 `(("python-pytest" ,python-pytest)
1620 ("python-pytest-runner" ,python-pytest-runner)
1621 ("python-tox" ,python-tox)))
1623 `(("python-astroid" ,python-astroid)
1624 ("python-isort" ,python-isort)
1625 ("python-mccabe" ,python-mccabe)
1626 ("python-six" ,python-six)))
1629 (modify-phases %standard-phases
1632 ;; Somehow, tests for python2-pylint
1633 ;; fail if run from the build directory
1634 (let ((work "/tmp/work"))
1636 (setenv "PYTHONPATH"
1637 (string-append (getenv "PYTHONPATH") ":" work))
1638 (copy-recursively "." work)
1639 (with-directory-excursion "/tmp"
1640 (invoke "python" "-m" "unittest" "discover"
1641 "-s" (string-append work "/pylint/test")
1642 "-p" "*test_*.py"))))))))
1643 (home-page "https://github.com/PyCQA/pylint")
1644 (synopsis "Python source code analyzer which looks for coding standard
1646 (description "Pylint is a Python source code analyzer which looks
1647 for programming errors, helps enforcing a coding standard and sniffs
1648 for some code smells (as defined in Martin Fowler's Refactoring book).
1650 Pylint has many rules enabled by default, way too much to silence them
1651 all on a minimally sized program. It's highly configurable and handle
1652 pragmas to control it from within your code. Additionally, it is
1653 possible to write plugins to add your own checks.")
1654 (properties `((python2-variant . ,(delay python2-pylint))))
1655 (license license:gpl2+)))
1657 (define-public python2-pylint
1658 (let ((pylint (package-with-python2
1659 (strip-python2-variant python-pylint))))
1660 (package (inherit pylint)
1662 `(("python2-backports-functools-lru-cache"
1663 ,python2-backports-functools-lru-cache)
1664 ("python2-configparser" ,python2-configparser)
1665 ,@(package-propagated-inputs pylint))))))
1667 (define-public python-paramunittest
1669 (name "python-paramunittest")
1674 (uri (pypi-uri "ParamUnittest" version))
1677 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1678 (build-system python-build-system)
1680 "https://github.com/rik0/ParamUnittest")
1682 "Simple extension to have parametrized unit tests")
1684 "This package allows to create parametrized unit-tests that work with the standard
1685 unittest package. A parametrized test case is automatically converted to multiple test
1686 cases. Since they are TestCase subclasses, they work with other test suites that
1687 recognize TestCases.")
1688 (license license:bsd-2)))
1690 (define-public python2-python-paramunittest
1691 (package-with-python2 python-paramunittest))
1693 (define-public python-pytest-warnings
1695 (name "python-pytest-warnings")
1700 (uri (pypi-uri "pytest-warnings" version))
1703 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1704 (build-system python-build-system)
1706 `(("pytest" ,python-pytest)))
1707 (home-page "https://github.com/fschulze/pytest-warnings")
1708 (synopsis "Pytest plugin to list Python warnings in pytest report")
1710 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1712 (license license:expat)
1713 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1714 ;; This package is part of pytest as of version 3.1.0.
1715 (superseded . ,python-pytest)))))
1717 (define-public python2-pytest-warnings
1718 (package (inherit (package-with-python2
1719 (strip-python2-variant python-pytest-warnings)))
1720 (properties `((superseded . ,python2-pytest)))))
1722 (define-public python-pytest-capturelog
1724 (name "python-pytest-capturelog")
1729 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1732 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1733 (build-system python-build-system)
1735 `(("pytest" ,python-pytest)))
1736 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1737 (synopsis "Pytest plugin to catch log messages")
1739 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1740 (license license:expat)))
1742 (define-public python2-pytest-capturelog
1743 (package-with-python2 python-pytest-capturelog))
1745 (define-public python-pytest-catchlog
1747 (name "python-pytest-catchlog")
1752 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1755 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1756 (build-system python-build-system)
1758 `(("unzip" ,unzip)))
1760 `(("pytest" ,python-pytest)))
1761 (home-page "https://github.com/eisensheng/pytest-catchlog")
1762 (synopsis "Pytest plugin to catch log messages")
1764 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1765 a fork of pytest-capturelog.")
1766 (license license:expat)))
1768 (define-public python2-pytest-catchlog
1769 (package-with-python2 python-pytest-catchlog))
1771 (define-public python-nosexcover
1773 (name "python-nosexcover")
1777 (uri (pypi-uri "nosexcover" version))
1780 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1781 (build-system python-build-system)
1783 `(("python-coverage" ,python-coverage)
1784 ("python-nose" ,python-nose)))
1785 (home-page "http://github.com/cmheisel/nose-xcover")
1786 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1787 (description "Nose-xcover is a companion to the built-in
1788 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1789 to a file named coverage.xml.
1791 It will honor all the options you pass to the Nose coverage plugin,
1792 especially -cover-package.")
1793 (license license:expat)))
1795 (define-public python2-nosexcover
1796 (package-with-python2 python-nosexcover))
1798 (define-public python-discover
1800 (name "python-discover")
1805 (uri (pypi-uri "discover" version))
1808 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1809 (build-system python-build-system)
1810 (home-page "http://pypi.python.org/pypi/discover/")
1812 "Python test discovery for unittest")
1814 "Discover provides test discovery for unittest, a feature that has been
1815 backported from Python 2.7 for Python 2.4+.")
1816 (license license:bsd-3)))
1818 (define-public python2-discover
1819 (package-with-python2 python-discover))
1821 (define-public behave
1827 (uri (pypi-uri "behave" version))
1830 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1831 (build-system python-build-system)
1833 `(("python-mock" ,python-mock)
1834 ("python-nose" ,python-nose)
1835 ("python-pathpy" ,python-pathpy)
1836 ("python-pyhamcrest" ,python-pyhamcrest)
1837 ("python-pytest" ,python-pytest)))
1839 `(("python-six" ,python-six)
1840 ("python-parse" ,python-parse)
1841 ("python-parse-type" ,python-parse-type)))
1843 '(#:test-target "behave_test"))
1844 (home-page "https://github.com/behave/behave")
1845 (synopsis "Python behavior-driven development")
1847 "Behave is a tool for behavior-driven development in python.
1848 Behavior-driven development (or BDD) is an agile software development
1849 technique that encourages collaboration between developers, QA and
1850 non-technical or business participants in a software project. Behave uses
1851 tests written in a natural language style, backed up by Python code.")
1852 (license license:x11)))
1854 (define-public python-behave-web-api
1856 (name "python-behave-web-api")
1861 (uri (pypi-uri "behave-web-api" version))
1864 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
1865 (build-system python-build-system)
1868 (modify-phases %standard-phases
1869 (add-after 'unpack 'fix-dependencies
1871 (substitute* "setup.py"
1872 (("'wheel'") "") ; We don't use it.
1873 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
1876 `(("behave" ,behave)
1877 ("python-requests" ,python-requests)))
1878 (home-page "https://github.com/jefersondaniel/behave-web-api")
1879 (synopsis "Provides testing for JSON APIs with Behave for Python")
1880 (description "This package provides testing utility modules for testing
1881 JSON APIs with Behave.")
1882 (license license:expat)))
1884 (define-public python2-behave-web-api
1885 (package-with-python2 python-behave-web-api))
1887 (define-public python-rednose
1889 (name "python-rednose")
1894 (uri (pypi-uri "rednose" version))
1897 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
1898 (build-system python-build-system)
1900 `(#:phases (modify-phases %standard-phases
1901 (add-after 'unpack 'patch-setup.py
1903 ;; Six is only required for tests and later versions
1905 (substitute* "setup.py"
1906 (("six==1.10.0") "six"))
1909 `(("python-colorama" ,python-colorama)
1910 ("python-termstyle" ,python-termstyle)))
1912 `(("python-six" ,python-six)
1913 ("python-nose" ,python-nose)))
1914 (home-page "https://github.com/JBKahn/rednose")
1915 (synopsis "Colored output for Python nosetests")
1916 (description "This package provides colored output for the
1917 @command{nosetests} command of the Python Nose unit test framework.")
1918 (license license:bsd-3)))
1920 (define-public python2-rednose
1921 (package-with-python2 python-rednose))
1923 (define-public python-nose-randomly
1925 (name "python-nose-randomly")
1930 (uri (pypi-uri "nose-randomly" version))
1933 "1cw9dlr1zh3w4i438kin7z0rm8092ki52hayisyc43h9pcplq7rn"))))
1934 (build-system python-build-system)
1936 `(("python-nose" ,python-nose)
1937 ("python-numpy" ,python-numpy)))
1938 (home-page "https://github.com/adamchainz/nose-randomly")
1940 "Nose plugin to randomly order tests and control random.seed")
1942 "This is a @code{Nose} plugin to randomly order tests which can be quite
1943 powerful in discovering hidden flaws in the tests themselves, while helping to
1944 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
1945 by resetting it to a repeatable number for each test, enabling the tests to
1946 create data based on random numbers and yet remain repeatable.")
1947 (license license:bsd-3)))
1949 (define-public python2-nose-randomly
1950 (package-with-python2 python-nose-randomly))
1952 (define-public python-nose-timer
1954 (name "python-nose-timer")
1959 (uri (pypi-uri "nose-timer" version))
1962 "0hfz5aqnhf493i9kyb6prm4zm8vx7wmfsyg3nvsnh24lzh2kwx44"))))
1963 (build-system python-build-system)
1965 `(("python-nose" ,python-nose)
1966 ("python-termcolor" ,python-termcolor)))
1967 (home-page "https://github.com/mahmoudimus/nose-timer")
1968 (synopsis "Timer plugin for nosetests")
1969 (description "Shows how much time was needed to run individual tests.")
1970 (license license:expat)))
1972 (define-public python2-nose-timer
1973 (package-with-python2 python-nose-timer))
1975 (define-public python-freezegun
1977 (name "python-freezegun")
1982 (uri (pypi-uri "freezegun" version))
1985 "08m6b42yxb9hk5lv747v9n2qsxyadmkb0k6yg0gxdanwap0slg3h"))))
1986 (build-system python-build-system)
1988 `(("python-mock" ,python-mock)
1989 ("python-nose" ,python-nose)
1990 ("python-coverage" ,python-coverage)))
1992 `(("python-six" ,python-six)
1993 ("python-dateutil" ,python-dateutil)))
1996 (modify-phases %standard-phases
1997 ;; The tests are normally executed via `make test`, but the PyPi
1998 ;; package does not include the Makefile.
2001 (invoke "nosetests" "./tests/"))))))
2002 (home-page "https://github.com/spulec/freezegun")
2003 (synopsis "Test utility for mocking the datetime module")
2005 "FreezeGun is a library that allows your python tests to travel through
2006 time by mocking the datetime module.")
2007 (license license:asl2.0)))
2009 (define-public python2-freezegun
2010 (package-with-python2 python-freezegun))
2012 (define-public python-flexmock
2014 (name "python-flexmock")
2018 (uri (pypi-uri "flexmock" version))
2021 "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
2022 (build-system python-build-system)
2023 (home-page "https://flexmock.readthedocs.org")
2024 (synopsis "Testing library for Python")
2026 "flexmock is a testing library for Python that makes it easy to create
2027 mocks, stubs and fakes.")
2028 (license license:bsd-3)))
2030 (define-public python2-flexmock
2031 (package-with-python2 python-flexmock))
2033 (define-public python-flaky
2035 (name "python-flaky")
2039 (uri (pypi-uri "flaky" version))
2042 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2043 (build-system python-build-system)
2045 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2047 (home-page "https://github.com/box/flaky")
2048 (synopsis "Automatically rerun flaky tests")
2050 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2053 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2054 on components that aren't 100% reliable. With flaky, instead of removing
2055 those tests or marking them to @code{@@skip}, they can be automatically
2057 (license license:asl2.0)))
2059 (define-public python2-flaky
2060 (package-with-python2 python-flaky))
2062 (define-public python-pyhamcrest
2064 (name "python-pyhamcrest")
2067 ;; Tests not distributed from pypi release.
2070 (url "https://github.com/hamcrest/PyHamcrest")
2071 (commit (string-append "V" version))))
2072 (file-name (git-file-name name version))
2075 "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
2076 (native-inputs ; All native inputs are for tests
2077 `(("python-pytest-cov" ,python-pytest-cov)
2078 ("python-mock" ,python-mock)
2079 ("python-pytest" ,python-pytest)
2080 ("python-hypothesis" ,python-hypothesis)))
2082 `(("python-six" ,python-six)))
2083 (build-system python-build-system)
2084 (home-page "http://hamcrest.org/")
2085 (synopsis "Hamcrest matchers for Python")
2087 "PyHamcrest is a framework for writing matcher objects,
2088 allowing you to declaratively define \"match\" rules.")
2089 (license license:bsd-3)))
2091 (define-public python2-pyhamcrest
2092 (package-with-python2 python-pyhamcrest))
2094 (define-public unittest-cpp
2096 (name "unittest-cpp")
2101 (url "https://github.com/unittest-cpp/unittest-cpp")
2102 (commit (string-append "v" version))))
2103 (file-name (git-file-name name version))
2105 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2107 `(#:tests? #f)) ; It's run after build automatically.
2108 (build-system cmake-build-system)
2109 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2110 (synopsis "Lightweight unit testing framework for C++")
2111 (description "UnitTest++ is a lightweight unit testing framework for C++.
2112 It was designed to do test-driven development on a wide variety of platforms.
2113 Simplicity, portability, speed, and small footprint are all very important
2114 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2115 of advanced library and language features, which means it should be easily
2116 portable to just about any platform.")
2117 (license license:expat)))
2119 (define-public libfaketime
2121 (name "libfaketime")
2123 (home-page "https://github.com/wolfcw/libfaketime")
2128 (commit (string-append "v" version))))
2131 "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
2132 (file-name (git-file-name name version))))
2133 (build-system gnu-build-system)
2135 '(#:phases (modify-phases %standard-phases
2137 (lambda* (#:key outputs #:allow-other-keys)
2138 (let ((out (assoc-ref outputs "out")))
2140 (setenv "PREFIX" out)
2142 (add-before 'check 'pre-check
2144 (substitute* "test/functests/test_exclude_mono.sh"
2145 (("/bin/bash") (which "bash")))
2147 #:test-target "test"))
2149 `(("perl" ,perl))) ;for tests
2150 (synopsis "Fake the system time for single applications")
2152 "The libfaketime library allows users to modify the system time that an
2153 application \"sees\". It is meant to be loaded using the dynamic linker's
2154 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2155 provides a simple way to achieve this.")
2156 (license license:gpl2)))
2158 (define-public umockdev
2164 (uri (string-append "https://github.com/martinpitt/umockdev/"
2165 "releases/download/" version "/"
2166 "umockdev-" version ".tar.xz"))
2169 "1in2hdan1g62wpvgjlj8mci85551ipr1964j2b9j06gm3blpihcx"))))
2170 (build-system gnu-build-system)
2173 (modify-phases %standard-phases
2174 (add-after 'unpack 'skip-broken-test
2176 (substitute* "tests/test-umockdev.c"
2177 (("/\\* sys/ in other dir")
2178 (string-append "return; // ")))
2182 ("python" ,python) ; for tests
2183 ("which" ,which) ; for tests
2184 ("gtk-doc" ,gtk-doc)
2185 ("pkg-config" ,pkg-config)))
2189 ("libgudev" ,libgudev)
2190 ("gobject-introspection" ,gobject-introspection)))
2191 (home-page "https://github.com/martinpitt/umockdev/")
2192 (synopsis "Mock hardware devices for creating unit tests")
2193 (description "umockdev mocks hardware devices for creating integration
2194 tests for hardware related libraries and programs. It also provides tools to
2195 record the properties and behaviour of particular devices, and to run a
2196 program or test suite under a test bed with the previously recorded devices
2198 (license license:lgpl2.1+)))