1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
9 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
10 ;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
13 ;;; Copyright © 2016, 2017 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
15 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
16 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
17 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
18 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
20 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
22 ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
24 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
25 ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
26 ;;; Copyright © 2017 ng0 <ng0@n0.is>
27 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
28 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
29 ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
30 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
31 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
32 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
34 ;;; This file is part of GNU Guix.
36 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
41 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
46 ;;; You should have received a copy of the GNU General Public License
47 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
49 (define-module (gnu packages check)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages llvm)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages golang)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-web)
65 #:use-module (gnu packages python-xyz)
66 #:use-module (gnu packages time)
67 #:use-module (guix utils)
68 #:use-module ((guix licenses) #:prefix license:)
69 #:use-module (guix packages)
70 #:use-module (guix download)
71 #:use-module (guix git-download)
72 #:use-module (guix build-system cmake)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system go)
75 #:use-module (guix build-system python)
76 #:use-module (guix build-system trivial))
85 (uri (string-append "https://github.com/libcheck/check/releases/download/"
86 version "/check-" version ".tar.gz"))
89 "02crar51gniijrrl9p8f9maibnwc33n76kw5cqr7xk3s8hqnncy4"))))
90 (build-system gnu-build-system)
91 (home-page "https://libcheck.github.io/check/")
92 (synopsis "Unit test framework for C")
94 "Check is a unit testing framework for C. It features a simple
95 interface for defining unit tests, putting little in the way of the
96 developer. Tests are run in a separate address space, so Check can
97 catch both assertion failures and code errors that cause segmentation
98 faults or other signals. The output from unit tests can be used within
99 source code editors and IDEs.")
100 (license license:lgpl2.1+)))
109 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
110 version "/CUnit-" version ".tar.bz2"))
113 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
114 (build-system gnu-build-system)
115 (arguments '(#:phases
116 (modify-phases %standard-phases
117 ;; XXX: The "bootstrap" phase detects the "bootstrap"
118 ;; script, but fails to execute it, so we bootstrap
121 (lambda _ (invoke "autoreconf" "-vfi"))))))
123 `(("automake" ,automake)
124 ("autoconf" ,autoconf)
125 ("libtool" ,libtool)))
126 (home-page "http://cunit.sourceforge.net/")
127 (synopsis "Automated testing framework for C")
129 "CUnit is a lightweight system for writing, administering, and running
130 unit tests in C. It provides C programmers with basic testing functionality
131 with a flexible variety of user interfaces.")
132 (license license:gpl2+)))
134 (define-public cppunit
140 (uri (string-append "http://dev-www.libreoffice.org/src/"
141 name "-" version ".tar.gz"))
144 "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))
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.
150 `(#:make-flags '("LDFLAGS=-ldl")))
151 (build-system gnu-build-system)
152 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
153 (synopsis "Unit testing framework for C++")
154 (description "CppUnit is the C++ port of the famous JUnit framework for
155 unit testing. Test output is in XML for automatic testing and GUI based for
157 (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
159 ;; When dependent packages upgraded to use newer version of catch, this one should
161 (define-public catch-framework
164 (version "1.3.5") ;Sub-minor is the build number
168 (url "https://github.com/philsquared/Catch")
170 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
171 (file-name (string-append name "-" version))
174 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
175 (build-system trivial-build-system)
177 `(#:modules ((guix build utils))
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-"
185 (for-each mkdir-p (list incdir docdir))
186 (install-file (string-append source
187 "/single_include/catch.hpp")
189 (copy-recursively (string-append source "/docs")
192 (home-page "http://catch-lib.net/")
193 (synopsis "Automated test framework for C++ and Objective-C")
195 "Catch stands for C++ Automated Test Cases in Headers and is a
196 multi-paradigm automated test framework for C++ and Objective-C.")
197 (license license:boost1.0)))
199 (define-public catch-framework2-1
203 (home-page "https://github.com/catchorg/Catch2")
207 (url "https://github.com/catchorg/Catch2")
208 (commit (string-append "v" version))))
209 (file-name (git-file-name name version))
212 "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
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
216 a multi-paradigm automated test framework for C++ and Objective-C.")
217 (license license:boost1.0)))
219 (define-public catch-framework2
223 (home-page "https://github.com/catchorg/Catch2")
227 (url "https://github.com/catchorg/Catch2")
228 (commit (string-append "v" version))))
229 (file-name (git-file-name name version))
232 "14vcckqmbydjsg40ngi6iv999zimysh2l7fmrqj1d7xl990qz233"))))
233 (build-system cmake-build-system)
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
238 a multi-paradigm automated test framework for C++ and Objective-C.")
239 (license license:boost1.0)))
241 (define-public cmdtest
247 (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
248 name "-" version ".tar.gz"))
251 "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
252 (build-system python-build-system)
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,
261 (add-before 'build 'check
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")
270 (invoke "python" "setup.py" "check"))))))
272 `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
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")
280 "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
281 given a command line and input files, and the expected output, and it verifies
282 that the command line produces the expected output. If not, it reports a
283 problem, and shows the differences.")
284 (license license:gpl3+)))
286 (define-public cmocka
292 (uri (string-append "https://cmocka.org/files/"
293 (version-major+minor version) "/cmocka-"
297 "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
298 (build-system cmake-build-system)
300 `(#:tests? #f)) ; no test target
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
304 mock objects. It only requires the standard C library, and works with
305 different compilers. Cmocka supports several different message output formats
306 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
308 (license license:asl2.0)))
310 (define-public cppcheck
317 (url "https://github.com/danmar/cppcheck")
319 (file-name (git-file-name name version))
321 (base32 "0h7ir2x0k005fm586dxmaphgv5cyz25k3k4sh02p7zb78gzx398h"))))
322 (build-system cmake-build-system)
324 '(#:configure-flags '("-DBUILD_TESTS=ON")))
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
328 C/C++ compilers and many other analysis tools it does not detect syntax errors
329 in the code. Cppcheck primarily detects the types of bugs that the compilers
330 normally do not detect. The goal is to detect only real errors in the code
331 (i.e. have zero false positives).")
332 (license license:gpl3+)))
334 (define-public cxxtest
340 (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
341 version "/cxxtest-" version ".tar.gz"))
344 "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
345 (build-system python-build-system)
348 (modify-phases %standard-phases
349 (add-after 'unpack 'chdir-to-source
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"))
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"))
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
374 in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
375 a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
376 and it supports a very flexible form of test discovery.")
377 (license license:lgpl3+)))
379 (define-public doctest
383 (home-page "https://github.com/onqtam/doctest")
386 (uri (git-reference (url home-page) (commit version)))
387 (file-name (git-file-name name version))
390 "070gkwffi73i2p0azga9yxj8km32bp8bw4jvkvz1vzlpavyii5kn"))))
391 (build-system cmake-build-system)
392 (synopsis "C++ test framework")
394 "doctest is a single-header testing framework for C++11 and later. It
395 has been designed to be fast, light and unintrusive.")
396 (license license:expat)))
398 (define-public go-gopkg.in-check.v1
399 (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
402 (name "go-gopkg.in-check.v1")
403 (version (git-version "0.0.0" revision commit))
407 (url "https://github.com/go-check/check.git")
409 (file-name (git-file-name name version))
412 "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
413 (build-system go-build-system)
415 '(#:import-path "gopkg.in/check.v1"))
417 `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
418 (synopsis "Rich testing extension for Go's testing package")
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))))
424 (define-public go-github.com-smartystreets-gunit
426 (name "go-github.com-smartystreets-gunit")
431 (url "https://github.com/smartystreets/gunit")
433 (file-name (git-file-name name version))
436 "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
437 (build-system go-build-system)
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
444 #:import-path "github.com/smartystreets/gunit"))
445 (synopsis "Testing tool for Go, in the style of xUnit")
447 "@code{gunit} allows the test author to use a struct as the scope for a
448 group of related test cases, in the style of xUnit fixtures. This makes
449 extraction of setup/teardown behavior (as well as invoking the system under
450 test) much simpler.")
451 (home-page "https://github.com/smartystreets/gunit")
452 (license license:expat)))
454 (define-public go-github.com-smartystreets-assertions
456 (name "go-github.com-smartystreets-assertions")
461 (url "https://github.com/smartystreets/assertions")
463 (file-name (git-file-name name version))
466 "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
467 (build-system go-build-system)
469 '(#:import-path "github.com/smartystreets/assertions"))
471 `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
472 (synopsis "Assertions for testing with Go")
474 "The @code{assertions} package provides convenient assertion functions
475 for writing tests in Go.")
476 (home-page "https://github.com/smartystreets/assertions")
477 (license license:expat)))
479 (define-public go-github.com-smartystreets-goconvey
481 (name "go-github.com-smartystreets-goconvey")
486 (url "https://github.com/smartystreets/goconvey")
488 (file-name (git-file-name name version))
491 "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
492 (build-system go-build-system)
494 '(#:import-path "github.com/smartystreets/goconvey"))
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")
500 "GoConvey is a testing tool for Go. It integrates with go test, can show
501 test coverage and has a web user interface that will refresh automatically.")
502 (home-page "https://github.com/smartystreets/goconvey")
503 (license license:expat)))
505 (define-public googletest
513 (url "https://github.com/google/googletest.git")
514 (commit (string-append "release-" version))))
515 (file-name (git-file-name name version))
517 (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
518 (build-system cmake-build-system)
520 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
522 `(("python" ,python-wrapper)))
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
526 discovery, death tests, assertions, parameterized tests and XML test report
528 (license license:bsd-3)))
530 (define-public googletest-1.8
537 (url "https://github.com/google/googletest.git")
538 (commit (string-append "release-" version))))
539 (file-name (git-file-name "googletest" version))
542 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
544 (define-public cpputest
551 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
552 version "/cpputest-" version ".tar.gz"))
555 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
556 (build-system gnu-build-system)
558 `(("googletest" ,googletest)))
559 (home-page "https://cpputest.github.io/")
560 (synopsis "Unit testing and mocking framework for C/C++")
562 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
563 C++ but is used in C and C++ projects and frequently used in embedded systems
564 but it works for any C/C++ project.")
565 (license license:bsd-3)))
567 (define-public python-parameterized
569 (name "python-parameterized")
574 (uri (pypi-uri "parameterized" version))
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")
583 "Parameterized is a Python library that aims to fix parameterized testing
584 for every Python test framework. It supports nose, py.test, and unittest.")
585 (license license:bsd-2)))
587 (define-public python2-parameterized
588 (package-with-python2 python-parameterized))
590 (define-public python-minimock
592 (name "python-minimock")
597 (uri (pypi-uri "MiniMock" version))
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
606 (license license:expat)))
608 (define-public python2-minimock
609 (package-with-python2 python-minimock))
611 (define-public python-mock
618 (uri (pypi-uri "mock" version))
621 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
623 `(("python-pbr" ,python-pbr-minimal)
624 ("python-six" ,python-six)))
625 (build-system python-build-system)
627 `(("python-unittest2" ,python-unittest2)))
630 (modify-phases %standard-phases
633 (zero? (system* "unit2")))))))
634 (home-page "https://github.com/testing-cabal/mock")
635 (synopsis "Python mocking and patching library for testing")
637 "Mock is a library for testing in Python. It allows you to replace parts
638 of your system under test with mock objects and make assertions about how they
640 (properties `((python2-variant . ,(delay python2-mock))))
641 (license license:expat)))
643 (define-public python2-mock
644 (let ((base (package-with-python2
645 (strip-python2-variant python-mock))))
646 (package (inherit base)
648 `(("python2-functools32" ,python2-functools32)
649 ("python2-funcsigs" ,python2-funcsigs)
650 ,@(package-propagated-inputs base))))))
652 (define-public python-nose
659 (uri (pypi-uri "nose" version))
662 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
663 (build-system python-build-system)
665 '(#:tests? #f)) ; FIXME: test suite fails
666 (home-page "http://readthedocs.org/docs/nose/")
667 (synopsis "Python testing library")
669 "Nose extends the unittest library to make testing easier.")
670 (license license:lgpl2.0+)))
672 (define-public python2-nose
673 (package-with-python2 python-nose))
675 (define-public python-nose2
677 (name "python-nose2")
682 (uri (pypi-uri "nose2" version))
685 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
686 (build-system python-build-system)
687 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
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")
695 "Nose2 is the next generation of nicer testing for Python, based on the
696 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
697 better plugin api, being easier for users to configure, and simplifying internal
698 interfaces and processes.")
699 (license license:bsd-2)))
701 (define-public python2-nose2
702 (package-with-python2 python-nose2))
704 (define-public python-unittest2
706 (name "python-unittest2")
711 (uri (pypi-uri "unittest2" version))
713 (search-patches "python-unittest2-python3-compat.patch"
714 "python-unittest2-remove-argparse.patch"))
717 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
718 (build-system python-build-system)
721 (modify-phases %standard-phases
724 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
726 `(("python-six" ,python-six)
727 ("python-traceback2" ,python-traceback2)))
728 (home-page "http://pypi.python.org/pypi/unittest2")
729 (synopsis "Python unit testing library")
731 "Unittest2 is a replacement for the unittest module in the Python
733 (license license:psfl)))
735 (define-public python2-unittest2
736 (package-with-python2 python-unittest2))
738 (define-public python-pytest
740 (name "python-pytest")
745 (uri (pypi-uri "pytest" version))
748 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
749 (build-system python-build-system)
752 (modify-phases %standard-phases
755 (invoke "pytest" "-vv" "-k"
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.
762 " and not test_collection")))))))
764 `(("python-atomicwrites" ,python-atomicwrites)
765 ("python-attrs" ,python-attrs-bootstrap)
766 ("python-more-itertools" ,python-more-itertools)
767 ("python-pluggy" ,python-pluggy)
768 ("python-py" ,python-py)
769 ("python-six" ,python-six-bootstrap)))
771 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
773 ("python-hypothesis" ,python-hypothesis)
774 ("python-nose" ,python-nose)
775 ("python-mock" ,python-mock)
776 ("python-pytest" ,python-pytest-bootstrap)
777 ("python-setuptools-scm" ,python-setuptools-scm)))
778 (home-page "https://docs.pytest.org/en/latest/")
779 (synopsis "Python testing library")
781 "Pytest is a testing tool that provides auto-discovery of test modules
782 and functions, detailed info on failing assert statements, modular fixtures,
783 and many external plugins.")
784 (license license:expat)
785 (properties `((python2-variant . ,(delay python2-pytest))))))
787 (define-public python2-pytest
788 (let ((pytest (package-with-python2
789 (strip-python2-variant python-pytest))))
793 `(("python2-funcsigs" ,python2-funcsigs)
794 ("python2-pathlib2" ,python2-pathlib2)
795 ,@(package-propagated-inputs pytest))))))
797 (define-public python-pytest-bootstrap
799 (inherit (strip-python2-variant python-pytest))
800 (name "python-pytest-bootstrap")
801 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
802 (arguments `(#:tests? #f))
803 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
805 (define-public python2-pytest-bootstrap
806 (let ((pytest (package-with-python2
807 (strip-python2-variant python-pytest-bootstrap))))
808 (package (inherit pytest)
810 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
811 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
812 ,@(package-propagated-inputs pytest))))))
814 (define-public python-pytest-cov
816 (name "python-pytest-cov")
821 (uri (pypi-uri "pytest-cov" version))
823 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
824 (build-system python-build-system)
827 (modify-phases %standard-phases
830 ;; Options taken from tox.ini.
831 ;; TODO: make "--restructuredtext" tests pass. They currently fail
832 ;; with "Duplicate implicit target name".
833 (invoke "python" "./setup.py" "check"
834 "--strict" "--metadata"))))))
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")
841 "Pytest-cov produces coverage reports. It supports centralised testing and
842 distributed testing in both @code{load} and @code{each} modes. It also
843 supports coverage of subprocesses.")
844 (license license:expat)))
846 (define-public python2-pytest-cov
847 (package-with-python2 python-pytest-cov))
849 (define-public python-pytest-runner
851 (name "python-pytest-runner")
856 (uri (pypi-uri "pytest-runner" version))
859 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
860 (build-system python-build-system)
862 `(("python-pytest" ,python-pytest-bootstrap)
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")
867 "This package provides a @command{pytest-runner} command that
868 @file{setup.py} files can use to run tests.")
869 (license license:expat)))
871 (define-public python2-pytest-runner
872 (package-with-python2 python-pytest-runner))
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
882 (uri (pypi-uri "pytest-runner" version))
885 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
887 (define-public python2-pytest-runner-2
888 (package-with-python2 python-pytest-runner-2))
890 (define-public python-pytest-mock
892 (name "python-pytest-mock")
897 (uri (pypi-uri "pytest-mock" version))
900 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
901 (build-system python-build-system)
903 `(("python-setuptools-scm" ,python-setuptools-scm)))
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")
909 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
910 around the patching API provided by the @code{mock} package, but with the
911 benefit of not having to worry about undoing patches at the end of a test.
912 The mocker fixture has the same API as @code{mock.patch}, supporting the
914 (properties `((python2-variant . ,(delay python2-pytest-mock))))
915 (license license:expat)))
917 (define-public python2-pytest-mock
918 (let ((base (package-with-python2
919 (strip-python2-variant python-pytest-mock))))
920 (package (inherit base)
922 `(("python2-mock" ,python2-mock)
923 ,@(package-propagated-inputs base))))))
925 (define-public python-pytest-xdist
927 (name "python-pytest-xdist")
932 (uri (pypi-uri "pytest-xdist" version))
935 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
936 (modules '((guix build utils)))
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$"))
944 (build-system python-build-system)
946 '(#:tests? #f)) ;FIXME: Some tests are failing.
948 ;; (modify-phases %standard-phases
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")))))
955 `(("python-setuptools-scm" ,python-setuptools-scm)))
957 `(("python-execnet" ,python-execnet)
958 ("python-pytest" ,python-pytest)
959 ("python-py" ,python-py)))
961 "https://github.com/pytest-dev/pytest-xdist")
963 "Plugin for py.test with distributed testing and loop-on-failing modes")
965 "The pytest-xdist plugin extends py.test with some unique test execution
966 modes: parallelization, running tests in boxed subprocesses, the ability
967 to run tests repeatedly when failed, and the ability to run tests on multiple
968 Python interpreters or platforms. It uses rsync to copy the existing
969 program code to a remote location, executes there, and then syncs the
971 (license license:expat)))
973 (define-public python2-pytest-xdist
974 (package-with-python2 python-pytest-xdist))
976 (define-public python-pytest-timeout
978 (name "python-pytest-timeout")
983 (uri (pypi-uri "pytest-timeout" version))
986 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
987 (build-system python-build-system)
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")
993 "This package provides a py.test plugin that aborts hanging tests after a
994 timeout has been exceeded.")
995 (license license:expat)))
997 (define-public python-scripttest
999 (name "python-scripttest")
1004 (uri (pypi-uri "scripttest" version))
1007 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
1008 (build-system python-build-system)
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
1014 interactive command-line applications. With it you can run a script in a
1015 subprocess and see the output as well as any file modifications.")
1016 (license license:expat)))
1018 (define-public python2-scripttest
1019 (package-with-python2 python-scripttest))
1021 (define-public python-testtools-bootstrap
1023 (name "python-testtools-bootstrap")
1028 (uri (pypi-uri "testtools" version))
1031 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1032 (patches (search-patches "python-testtools.patch"))))
1033 (build-system python-build-system)
1034 (arguments '(#:tests? #f))
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)))
1043 (home-page "https://github.com/testing-cabal/testtools")
1045 "Extensions to the Python standard library unit testing framework")
1047 "This package is only for bootstrapping. Do not use this.")
1048 (license license:psfl)))
1050 (define-public python2-testtools-bootstrap
1051 (package-with-python2 python-testtools-bootstrap))
1053 (define-public python-testtools
1055 (inherit python-testtools-bootstrap)
1056 (name "python-testtools")
1058 `(#:phases (modify-phases %standard-phases
1061 (invoke "python" "-m" "testtools.run"
1062 "testtools.tests.test_suite"))))))
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)))
1072 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1074 "Testtools extends the Python standard library unit testing framework to
1075 provide matchers, more debugging information, and cross-Python
1078 (define-public python2-testtools
1079 (package-with-python2 python-testtools))
1081 (define-public python-testscenarios-bootstrap
1083 (name "python-testscenarios-bootstrap")
1088 (uri (pypi-uri "testscenarios" version))
1091 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1092 (build-system python-build-system)
1094 `(#:phases (modify-phases %standard-phases
1097 (invoke "python" "-m" "testtools.run"
1098 "testscenarios.test_suite"))))))
1100 `(("python-pbr" ,python-pbr-minimal)
1101 ("python-testtools" ,python-testtools-bootstrap)))
1102 (home-page "https://launchpad.net/testscenarios")
1103 (synopsis "Pyunit extension for dependency injection")
1105 "This package is only for bootstrapping. Don't use this.")
1106 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1108 (define-public python2-testscenarios-bootstrap
1109 (package-with-python2 python-testscenarios-bootstrap))
1111 (define-public python-testscenarios
1113 (inherit python-testscenarios-bootstrap)
1114 (name "python-testscenarios")
1116 `(("python-pbr" ,python-pbr)
1117 ("python-testtools" ,python-testtools)))
1119 "Testscenarios provides clean dependency injection for Python unittest
1122 (define-public python2-testscenarios
1123 (package-with-python2 python-testscenarios))
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
1129 (name "python-testresources-bootstrap")
1133 (uri (pypi-uri "testresources" version))
1136 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1137 (build-system python-build-system)
1138 (arguments '(#:tests? #f))
1140 `(("python-pbr" ,python-pbr-minimal)))
1141 (home-page "https://launchpad.net/testresources")
1143 "Pyunit extension for managing test resources")
1145 "This package is only here for bootstrapping purposes. Use the regular
1146 testresources package instead.")
1147 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1149 (define-public python2-testresources-bootstrap
1150 (package-with-python2 python-testresources-bootstrap))
1152 (define-public python-testresources
1154 (inherit python-testresources-bootstrap)
1155 (name "python-testresources")
1157 `(("python-pbr" ,python-pbr)))
1160 `(("python-fixtures" ,python-fixtures)
1161 ("python-testtols" ,python-testtools)))
1163 "Testresources is an extension to Python's unittest to allow declarative
1164 use of resources by test cases.")))
1166 (define-public python2-testresources
1167 (package-with-python2 python-testresources))
1169 (define-public python-subunit-bootstrap
1171 (name "python-subunit-bootstrap")
1176 (uri (pypi-uri "python-subunit" version))
1179 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1180 (build-system python-build-system)
1182 `(("python-extras" ,python-extras)
1183 ("python-testtools" ,python-testtools-bootstrap)))
1185 `(("python-fixtures" ,python-fixtures-bootstrap)
1186 ("python-hypothesis" ,python-hypothesis)
1187 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1188 (home-page "https://launchpad.net/subunit")
1189 (synopsis "Python implementation of the subunit protocol")
1191 "This package is here for bootstrapping purposes only. Use the regular
1192 python-subunit package instead.")
1193 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1195 (define-public python2-subunit-bootstrap
1196 (package-with-python2 python-subunit-bootstrap))
1198 (define-public python-subunit
1200 (inherit python-subunit-bootstrap)
1201 (name "python-subunit")
1203 `(("python-extras" ,python-extras)
1204 ("python-testtools" ,python-testtools)))
1206 `(("python-fixtures" ,python-fixtures)
1207 ("python-hypothesis" ,python-hypothesis)
1208 ("python-testscenarios" ,python-testscenarios)))
1210 "Python-subunit is a Python implementation of the subunit test streaming
1213 (define-public python2-subunit
1214 (package-with-python2 python-subunit))
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
1220 (name "python-fixtures-bootstrap")
1224 (uri (pypi-uri "fixtures" version))
1227 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1228 (build-system python-build-system)
1229 (arguments `(#:tests? #f))
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")
1236 "This package is only used for bootstrapping. Use the regular
1237 python-fixtures package instead.")
1238 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1240 (define-public python2-fixtures-bootstrap
1241 (package-with-python2 python-fixtures-bootstrap))
1243 (define-public python-fixtures
1245 (inherit python-fixtures-bootstrap)
1246 (name "python-fixtures")
1249 (modify-phases %standard-phases
1252 (invoke "python" "-m" "testtools.run"
1253 "fixtures.test_suite"))))))
1255 ;; Fixtures uses pbr at runtime to check versions, etc.
1256 `(("python-pbr" ,python-pbr)
1257 ("python-six" ,python-six)))
1259 `(("python-mock" ,python-mock)
1260 ("python-testtools" ,python-testtools-bootstrap)))
1262 "Fixtures provides a way to create reusable state, useful when writing
1265 (define-public python2-fixtures
1266 (package-with-python2 python-fixtures))
1268 (define-public python-testrepository-bootstrap
1270 (name "python-testrepository-bootstrap")
1275 (uri (pypi-uri "testrepository" version))
1278 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1279 (build-system python-build-system)
1280 (arguments '(#:tests? #f))
1282 `(("python-fixtures" ,python-fixtures-bootstrap)
1283 ("python-subunit" ,python-subunit-bootstrap)
1284 ("python-testtools" ,python-testtools-bootstrap)))
1286 `(("python-mimeparse" ,python-mimeparse)))
1287 (home-page "https://launchpad.net/testrepository")
1288 (synopsis "Database for Python test results")
1290 "Bootstrap package for python-testrepository. Don't use this.")
1291 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1293 (define-public python2-testrepository-bootstrap
1294 (package-with-python2 python-testrepository-bootstrap))
1296 (define-public python-testrepository
1298 (inherit python-testrepository-bootstrap)
1299 (name "python-testrepository")
1301 ;; FIXME: Many tests are failing.
1304 `(("python-fixtures" ,python-fixtures)
1305 ("python-subunit" ,python-subunit)
1306 ("python-testtools" ,python-testtools)))
1308 `(("python-mimeparse" ,python-mimeparse)))
1309 (description "Testrepository provides a database of test results which can
1310 be used as part of a developer's workflow to check things such as what tests
1311 have failed since the last commit or what tests are currently failing.")))
1313 (define-public python2-testrepository
1314 (package-with-python2 python-testrepository))
1316 (define-public python-coverage
1318 (name "python-coverage")
1323 (uri (pypi-uri "coverage" version))
1326 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1327 (build-system python-build-system)
1329 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1331 (home-page "http://nedbatchelder.com/code/coverage")
1332 (synopsis "Code coverage measurement for Python")
1334 "Coverage measures code coverage, typically during test execution. It
1335 uses the code analysis tools and tracing hooks provided in the Python standard
1336 library to determine which lines are executable, and which have been
1338 (license license:bsd-3)))
1340 (define-public python2-coverage
1341 (package-with-python2 python-coverage))
1343 (define-public python-cov-core
1345 (name "python-cov-core")
1350 (uri (pypi-uri "cov-core" version))
1353 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1354 (build-system python-build-system)
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")
1360 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1361 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1362 testing frameworks.")
1363 (license license:expat)))
1365 (define-public python2-cov-core
1366 (package-with-python2 python-cov-core))
1368 (define-public python-codecov
1370 (name "python-codecov")
1375 (uri (pypi-uri "codecov" version))
1378 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1379 (build-system python-build-system)
1381 `(("python-unittest2" ,python-unittest2)))
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}")
1388 "Codecov collects code coverage reports from code written in Python, Java,
1389 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1390 (license license:asl2.0)))
1392 (define-public python-testpath
1394 (name "python-testpath")
1400 (url "https://github.com/jupyter/testpath")
1402 (file-name (git-file-name name version))
1405 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1406 (build-system python-build-system)
1408 `(#:tests? #f ; this package does not even have a setup.py
1409 #:modules ((guix build python-build-system)
1412 #:imported-modules (,@%python-build-system-modules
1415 (modify-phases %standard-phases
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)
1424 (assoc-ref outputs "out")
1425 "/lib/python" x.y "/site-packages/testpath")))
1427 (copy-recursively "testpath" dir))
1429 (home-page "https://github.com/takluyver/testpath")
1430 (synopsis "Test utilities for code working with files and commands")
1432 "Testpath is a collection of utilities for Python code working with files
1433 and commands. It contains functions to check things on the file system, and
1434 tools for mocking system commands and recording calls to those.")
1435 (license license:expat)))
1437 (define-public python2-testpath
1438 (package-with-python2 python-testpath))
1440 (define-public python-testlib
1442 (name "python-testlib")
1447 (uri (pypi-uri "testlib" version ".zip"))
1449 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1450 (build-system python-build-system)
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)))
1458 (define-public python2-testlib
1459 (package-with-python2 python-testlib))
1461 ;;; The software provided by this package was integrated into pytest 2.8.
1462 (define-public python-pytest-cache
1464 (name "python-pytest-cache")
1468 (uri (pypi-uri "pytest-cache" version))
1471 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1472 (build-system python-build-system)
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
1480 the last py.test invocation.")
1481 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1482 (license license:expat)))
1484 (define-public python2-pytest-cache
1485 (package-with-python2 python-pytest-cache))
1487 (define-public python-pytest-localserver
1489 (name "python-pytest-localserver")
1493 (uri (pypi-uri "pytest-localserver" version))
1496 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1497 (build-system python-build-system)
1500 (modify-phases %standard-phases
1503 (invoke "py.test" "-v"))))))
1505 `(("python-pytest" ,python-pytest)
1506 ("python-requests" ,python-requests)
1507 ("python-six" ,python-six)))
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
1512 framework which enables you to test server connections locally.")
1513 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1514 (license license:expat)))
1516 (define-public python-pytest-xprocess
1518 (name "python-pytest-xprocess")
1522 (uri (pypi-uri "pytest-xprocess" version))
1525 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1526 (build-system python-build-system)
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
1533 processes across test runs.")
1534 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1535 (license license:expat)))
1537 (define-public python-pytest-subtesthack
1539 (name "python-pytest-subtesthack")
1543 (uri (pypi-uri "pytest-subtesthack" version))
1546 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1547 (build-system python-build-system)
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
1552 unit 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
1554 function multiple times, without setting up or tearing down fixture state as is
1555 normally the case.")
1556 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1557 (license license:unlicense)))
1559 (define-public python2-pytest-subtesthack
1560 (package-with-python2 python-pytest-subtesthack))
1562 (define-public python-pytest-sugar
1564 (name "python-pytest-sugar")
1569 (uri (pypi-uri "pytest-sugar" version))
1572 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1573 (build-system python-build-system)
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")
1581 "@code{pytest-sugar} is a plugin for py.test that changes the default
1582 look and feel of py.test, using a progress bar and showing failures and errors
1584 (license license:bsd-3)))
1586 (define-public python-hypothesis
1588 (name "python-hypothesis")
1592 (uri (pypi-uri "hypothesis" version))
1595 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
1596 (build-system python-build-system)
1598 `(("python-flake8" ,python-flake8)
1599 ("python-pytest" ,python-pytest-bootstrap)))
1601 `(("python-attrs" ,python-attrs-bootstrap)
1602 ("python-coverage" ,python-coverage)))
1603 (synopsis "Library for property based testing")
1604 (description "Hypothesis is a library for testing your Python code against a
1605 much larger range of examples than you would ever want to write by hand. It’s
1606 based on the Haskell library, Quickcheck, and is designed to integrate
1607 seamlessly into your existing Python unit testing work flow.")
1608 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1609 (license license:mpl2.0)
1610 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1612 (define-public python2-hypothesis
1613 (let ((hypothesis (package-with-python2
1614 (strip-python2-variant python-hypothesis))))
1615 (package (inherit hypothesis)
1617 `(("python2-enum34" ,python2-enum34)
1618 ,@(package-propagated-inputs hypothesis))))))
1620 (define-public python-lit
1627 (uri (pypi-uri "lit" version))
1630 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1631 (build-system python-build-system)
1634 (modify-phases %standard-phases
1637 (invoke "python" "lit.py" "tests"))))))
1640 (home-page "https://llvm.org/")
1641 (synopsis "LLVM Software Testing Tool")
1642 (description "@code{lit} is a portable tool for executing LLVM and Clang
1643 style test suites, summarizing their results, and providing indication of
1645 (license license:ncsa)))
1647 (define-public python2-lit
1648 (package-with-python2 python-lit))
1650 (define-public python-pytest-pep8
1652 (name "python-pytest-pep8")
1656 (uri (pypi-uri "pytest-pep8" version))
1659 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1660 (build-system python-build-system)
1662 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1664 `(("python-pytest" ,python-pytest)))
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)))
1672 (define-public python2-pytest-pep8
1673 (package-with-python2 python-pytest-pep8))
1675 (define-public python-pytest-flakes
1677 (name "python-pytest-flakes")
1681 (uri (pypi-uri "pytest-flakes" version))
1684 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1685 (build-system python-build-system)
1688 (modify-phases %standard-phases
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)
1695 (invoke "py.test" "-vv"))))))
1697 `(("python-coverage" ,python-coverage)
1698 ("python-pytest" ,python-pytest)
1699 ("python-pytest-cache" ,python-pytest-cache)
1700 ("python-pytest-pep8" ,python-pytest-pep8)))
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)))
1708 (define-public python2-pytest-flakes
1709 (package-with-python2 python-pytest-flakes))
1711 (define-public python2-coverage-test-runner
1713 (name "python2-coverage-test-runner")
1719 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1720 "coverage-test-runner/snapshot/coverage-test-runner-"
1724 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1725 (build-system python-build-system)
1727 `(#:python ,python-2
1729 (modify-phases %standard-phases
1732 (invoke "./testrun"))))))
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
1738 unit tests and failing them if the unit test module does not exercise all
1739 statements in the module it tests.")
1740 (license license:gpl3+)))
1742 ;; Further releases, up to 2.4.3, have failing unit tests. See:
1743 ;; https://github.com/PyCQA/pylint/issues/3198.
1744 (define-public python-pylint
1746 (name "python-pylint")
1752 (url "https://github.com/PyCQA/pylint")
1753 (commit (string-append "pylint-" version))))
1754 (file-name (git-file-name name version))
1757 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
1758 (build-system python-build-system)
1760 `(("python-pytest" ,python-pytest)
1761 ("python-pytest-runner" ,python-pytest-runner)
1762 ("python-tox" ,python-tox)))
1764 `(("python-astroid" ,python-astroid)
1765 ("python-isort" ,python-isort)
1766 ("python-mccabe" ,python-mccabe)
1767 ("python-six" ,python-six)))
1768 (home-page "https://github.com/PyCQA/pylint")
1769 (synopsis "Python source code analyzer which looks for coding standard
1771 (description "Pylint is a Python source code analyzer which looks
1772 for programming errors, helps enforcing a coding standard and sniffs
1773 for some code smells (as defined in Martin Fowler's Refactoring book).
1775 Pylint has many rules enabled by default, way too much to silence them
1776 all on a minimally sized program. It's highly configurable and handle
1777 pragmas to control it from within your code. Additionally, it is
1778 possible to write plugins to add your own checks.")
1779 (properties `((python2-variant . ,(delay python2-pylint))))
1780 (license license:gpl2+)))
1782 ;; Python2 is not supported anymore by Pylint. See:
1783 ;; https://github.com/PyCQA/pylint/issues/1763.
1784 (define-public python2-pylint
1785 (let ((pylint (package-with-python2
1786 (strip-python2-variant python-pylint))))
1787 (package (inherit pylint)
1793 (url "https://github.com/PyCQA/pylint")
1794 (commit (string-append "pylint-" version))))
1795 (file-name (git-file-name (package-name pylint) version))
1798 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1800 `(,@(package-arguments pylint)
1802 (modify-phases %standard-phases
1805 ;; Somehow, tests fail if run from the build directory.
1806 (let ((work "/tmp/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"))))))))
1816 `(("python2-futures" ,python2-futures)
1817 ,@(package-native-inputs pylint)))
1819 `(("python2-backports-functools-lru-cache"
1820 ,python2-backports-functools-lru-cache)
1821 ("python2-configparser" ,python2-configparser)
1822 ,@(package-propagated-inputs pylint))))))
1824 (define-public python-paramunittest
1826 (name "python-paramunittest")
1831 (uri (pypi-uri "ParamUnittest" version))
1834 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1835 (build-system python-build-system)
1837 "https://github.com/rik0/ParamUnittest")
1839 "Simple extension to have parametrized unit tests")
1841 "This package allows to create parametrized unit-tests that work with the standard
1842 unittest package. A parametrized test case is automatically converted to multiple test
1843 cases. Since they are TestCase subclasses, they work with other test suites that
1844 recognize TestCases.")
1845 (license license:bsd-2)))
1847 (define-public python2-python-paramunittest
1848 (package-with-python2 python-paramunittest))
1850 (define-public python-pytest-warnings
1852 (name "python-pytest-warnings")
1857 (uri (pypi-uri "pytest-warnings" version))
1860 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1861 (build-system python-build-system)
1863 `(("pytest" ,python-pytest)))
1864 (home-page "https://github.com/fschulze/pytest-warnings")
1865 (synopsis "Pytest plugin to list Python warnings in pytest report")
1867 "Python-pytest-warnings is a pytest plugin to list Python warnings in
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)))))
1874 (define-public python2-pytest-warnings
1875 (package (inherit (package-with-python2
1876 (strip-python2-variant python-pytest-warnings)))
1877 (properties `((superseded . ,python2-pytest)))))
1879 (define-public python-pytest-capturelog
1881 (name "python-pytest-capturelog")
1886 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1889 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1890 (build-system python-build-system)
1892 `(("pytest" ,python-pytest)))
1893 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1894 (synopsis "Pytest plugin to catch log messages")
1896 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1897 (license license:expat)))
1899 (define-public python2-pytest-capturelog
1900 (package-with-python2 python-pytest-capturelog))
1902 (define-public python-pytest-catchlog
1904 (name "python-pytest-catchlog")
1909 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1912 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1913 (build-system python-build-system)
1915 `(("unzip" ,unzip)))
1917 `(("pytest" ,python-pytest)))
1918 (home-page "https://github.com/eisensheng/pytest-catchlog")
1919 (synopsis "Pytest plugin to catch log messages")
1921 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1922 a fork of pytest-capturelog.")
1923 (license license:expat)))
1925 (define-public python2-pytest-catchlog
1926 (package-with-python2 python-pytest-catchlog))
1928 (define-public python-nosexcover
1930 (name "python-nosexcover")
1934 (uri (pypi-uri "nosexcover" version))
1937 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1938 (build-system python-build-system)
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
1946 to a file named coverage.xml.
1948 It will honor all the options you pass to the Nose coverage plugin,
1949 especially -cover-package.")
1950 (license license:expat)))
1952 (define-public python2-nosexcover
1953 (package-with-python2 python-nosexcover))
1955 (define-public python-discover
1957 (name "python-discover")
1962 (uri (pypi-uri "discover" version))
1965 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1966 (build-system python-build-system)
1967 (home-page "http://pypi.python.org/pypi/discover/")
1969 "Python test discovery for unittest")
1971 "Discover provides test discovery for unittest, a feature that has been
1972 backported from Python 2.7 for Python 2.4+.")
1973 (license license:bsd-3)))
1975 (define-public python2-discover
1976 (package-with-python2 python-discover))
1978 (define-public behave
1984 (uri (pypi-uri "behave" version))
1987 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1988 (build-system python-build-system)
1990 `(("python-mock" ,python-mock)
1991 ("python-nose" ,python-nose)
1992 ("python-pathpy" ,python-pathpy)
1993 ("python-pyhamcrest" ,python-pyhamcrest)
1994 ("python-pytest" ,python-pytest)))
1996 `(("python-importlib-metadata" ,python-importlib-metadata)
1997 ("python-six" ,python-six)
1998 ("python-parse" ,python-parse)
1999 ("python-parse-type" ,python-parse-type)))
2001 '(#:test-target "behave_test"
2003 (modify-phases %standard-phases
2004 (add-before 'check 'fix-library-loading
2006 ;; Otherwise, tests fail with no module named 'path'
2007 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
2008 (getcwd) "/tasks/_vendor"))
2010 (home-page "https://github.com/behave/behave")
2011 (synopsis "Python behavior-driven development")
2013 "Behave is a tool for behavior-driven development in python.
2014 Behavior-driven development (or BDD) is an agile software development
2015 technique that encourages collaboration between developers, QA and
2016 non-technical or business participants in a software project. Behave uses
2017 tests written in a natural language style, backed up by Python code.")
2018 (license license:x11)))
2020 (define-public python-behave-web-api
2022 (name "python-behave-web-api")
2027 (uri (pypi-uri "behave-web-api" version))
2030 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2031 (build-system python-build-system)
2034 (modify-phases %standard-phases
2035 (add-after 'unpack 'fix-dependencies
2037 (substitute* "setup.py"
2038 (("'wheel'") "") ; We don't use it.
2039 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
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
2047 JSON APIs with Behave.")
2048 (license license:expat)))
2050 (define-public python2-behave-web-api
2051 (package-with-python2 python-behave-web-api))
2053 (define-public python-rednose
2055 (name "python-rednose")
2060 (uri (pypi-uri "rednose" version))
2063 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2064 (build-system python-build-system)
2066 `(#:phases (modify-phases %standard-phases
2067 (add-after 'unpack 'patch-setup.py
2069 ;; Six is only required for tests and later versions
2071 (substitute* "setup.py"
2072 (("six==1.10.0") "six"))
2075 `(("python-colorama" ,python-colorama)
2076 ("python-termstyle" ,python-termstyle)))
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)))
2086 (define-public python2-rednose
2087 (package-with-python2 python-rednose))
2089 (define-public python-nose-randomly
2091 (name "python-nose-randomly")
2096 (uri (pypi-uri "nose-randomly" version))
2098 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2099 (build-system python-build-system)
2101 `(("python-nose" ,python-nose)
2102 ("python-numpy" ,python-numpy)))
2103 (home-page "https://github.com/adamchainz/nose-randomly")
2105 "Nose plugin to randomly order tests and control random.seed")
2107 "This is a @code{Nose} plugin to randomly order tests which can be quite
2108 powerful in discovering hidden flaws in the tests themselves, while helping to
2109 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2110 by resetting it to a repeatable number for each test, enabling the tests to
2111 create data based on random numbers and yet remain repeatable.")
2112 (license license:bsd-3)))
2114 (define-public python2-nose-randomly
2115 (package-with-python2 python-nose-randomly))
2117 (define-public python-nose-timer
2119 (name "python-nose-timer")
2124 (uri (pypi-uri "nose-timer" version))
2126 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2127 (build-system python-build-system)
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)))
2136 (define-public python2-nose-timer
2137 (package-with-python2 python-nose-timer))
2139 (define-public python-freezegun
2141 (name "python-freezegun")
2146 (uri (pypi-uri "freezegun" version))
2148 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2149 (build-system python-build-system)
2151 `(("python-mock" ,python-mock)
2152 ("python-pytest" ,python-pytest)))
2154 `(("python-six" ,python-six)
2155 ("python-dateutil" ,python-dateutil)))
2158 (modify-phases %standard-phases
2159 ;; The tests are normally executed via `make test`, but the PyPi
2160 ;; package does not include the Makefile.
2163 (invoke "pytest" "-vv"))))))
2164 (home-page "https://github.com/spulec/freezegun")
2165 (synopsis "Test utility for mocking the datetime module")
2167 "FreezeGun is a library that allows your python tests to travel through
2168 time by mocking the datetime module.")
2169 (license license:asl2.0)))
2171 (define-public python2-freezegun
2172 (package-with-python2 python-freezegun))
2174 (define-public python-flexmock
2176 (name "python-flexmock")
2180 (uri (pypi-uri "flexmock" version))
2183 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2184 (build-system python-build-system)
2185 (home-page "https://flexmock.readthedocs.org")
2186 (synopsis "Testing library for Python")
2188 "flexmock is a testing library for Python that makes it easy to create
2189 mocks, stubs and fakes.")
2190 (license license:bsd-3)))
2192 (define-public python2-flexmock
2193 (package-with-python2 python-flexmock))
2195 (define-public python-flaky
2197 (name "python-flaky")
2201 (uri (pypi-uri "flaky" version))
2204 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2205 (build-system python-build-system)
2207 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2209 (home-page "https://github.com/box/flaky")
2210 (synopsis "Automatically rerun flaky tests")
2212 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2215 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2216 on components that aren't 100% reliable. With flaky, instead of removing
2217 those tests or marking them to @code{@@skip}, they can be automatically
2219 (license license:asl2.0)))
2221 (define-public python2-flaky
2222 (package-with-python2 python-flaky))
2224 (define-public python-pyhamcrest
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")
2230 (name "python-pyhamcrest")
2231 (version (git-version "1.9.0" revision commit))
2233 ;; Tests not distributed from pypi release.
2236 (url "https://github.com/hamcrest/PyHamcrest")
2238 (file-name (git-file-name name version))
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)))
2248 `(("python-six" ,python-six)))
2249 (build-system python-build-system)
2251 `(#:phases (modify-phases %standard-phases
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")
2261 "PyHamcrest is a framework for writing matcher objects,
2262 allowing you to declaratively define \"match\" rules.")
2263 (license license:bsd-3))))
2265 (define-public python2-pyhamcrest
2266 (package-with-python2 python-pyhamcrest))
2268 (define-public unittest-cpp
2270 (name "unittest-cpp")
2275 (url "https://github.com/unittest-cpp/unittest-cpp")
2276 (commit (string-append "v" version))))
2277 (file-name (git-file-name name version))
2279 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
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++.
2286 It was designed to do test-driven development on a wide variety of platforms.
2287 Simplicity, portability, speed, and small footprint are all very important
2288 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2289 of advanced library and language features, which means it should be easily
2290 portable to just about any platform.")
2291 (license license:expat)))
2293 (define-public libfaketime
2295 (name "libfaketime")
2297 (home-page "https://github.com/wolfcw/libfaketime")
2302 (commit (string-append "v" version))))
2305 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2306 (file-name (git-file-name name version))))
2307 (build-system gnu-build-system)
2309 '(#:phases (modify-phases %standard-phases
2311 (lambda* (#:key outputs #:allow-other-keys)
2312 (let ((out (assoc-ref outputs "out")))
2314 (setenv "PREFIX" out)
2316 (add-before 'check 'pre-check
2318 (substitute* "test/functests/test_exclude_mono.sh"
2319 (("/bin/bash") (which "bash")))
2321 #:test-target "test"))
2323 `(("perl" ,perl))) ;for tests
2324 (synopsis "Fake the system time for single applications")
2326 "The libfaketime library allows users to modify the system time that an
2327 application \"sees\". It is meant to be loaded using the dynamic linker's
2328 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2329 provides a simple way to achieve this.")
2330 (license license:gpl2)))
2332 (define-public umockdev
2338 (uri (string-append "https://github.com/martinpitt/umockdev/"
2339 "releases/download/" version "/"
2340 "umockdev-" version ".tar.xz"))
2343 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2344 (build-system gnu-build-system)
2347 (modify-phases %standard-phases
2348 (add-after 'unpack 'skip-broken-test
2350 (substitute* "tests/test-umockdev.c"
2351 (("/\\* sys/ in other dir")
2352 (string-append "return; // ")))
2356 ("gtk-doc" ,gtk-doc)
2357 ("pkg-config" ,pkg-config)
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
2370 tests for hardware related libraries and programs. It also provides tools to
2371 record the properties and behaviour of particular devices, and to run a
2372 program or test suite under a test bed with the previously recorded devices
2374 (license license:lgpl2.1+)))
2376 (define-public virtest
2377 ;; No releases yet, so we take the commit that "vc" expects.
2378 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2382 (version (git-version "0.0" revision commit))
2383 (home-page "https://github.com/mattkretz/virtest")
2386 (uri (git-reference (url home-page) (commit commit)))
2387 (file-name (git-file-name name version))
2390 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2391 (build-system cmake-build-system)
2393 `(#:phases (modify-phases %standard-phases
2394 (add-after 'unpack 'adjust-install-directory
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"))
2402 (synopsis "Header-only test framework")
2404 "@code{virtest} is a small header-only test framework for C++. It
2405 grew out of the @dfn{Vc} project.")
2406 (license license:bsd-3))))
2408 (define-public python-pyfakefs
2410 (name "python-pyfakefs")
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))
2420 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2421 (patches (search-patches
2422 "python-pyfakefs-remove-bad-test.patch"))
2423 (file-name (string-append name "-" version ".tar.gz"))))
2426 (modify-phases %standard-phases
2427 ;; The default test suite does not run these extra tests.
2428 (add-after 'check 'check-pytest-plugin
2431 "python" "-m" "pytest"
2432 "pyfakefs/pytest_tests/pytest_plugin_test.py")
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")
2444 "This package provides a Python library intended for use in automated
2445 tests. One difficulty when testing software is that the code under test might
2446 need to read or write to files in the local file system. If the file system
2447 is not set up in just the right way, it might cause a spurious error during
2448 the test. The pyfakefs library provides a solution to problems like this by
2449 mocking file system interactions. In other words, it arranges for the code
2450 under test to interact with a fake file system instead of the real file
2451 system. The code under test requires no modification to work with pyfakefs.")
2452 (license license:asl2.0)))
2454 (define-public python2-pyfakefs
2455 (package-with-python2 python-pyfakefs))