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 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 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 "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
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 "07yn1zycsb7sn1v7fprihbl0ih4n2zkd7l9jvmkjcskvwn4n21h0"))))
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 "0rddlzhnv0f5036q0m0p019pismka7sx6x8cnzk65sk77b1dsbhg"))))
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 "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))
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 cpputest
537 (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
538 version "/cpputest-" version ".tar.gz"))
541 "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
542 (build-system gnu-build-system)
544 `(("googletest" ,googletest)))
545 (home-page "https://cpputest.github.io/")
546 (synopsis "Unit testing and mocking framework for C/C++")
548 "CppUTest is a C/C++ based unit xUnit test framework. It is written in
549 C++ but is used in C and C++ projects and frequently used in embedded systems
550 but it works for any C/C++ project.")
551 (license license:bsd-3)))
553 (define-public python-parameterized
555 (name "python-parameterized")
560 (uri (pypi-uri "parameterized" version))
563 "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
564 (build-system python-build-system)
565 (arguments '(#:tests? #f)) ; there are no tests
566 (home-page "https://github.com/wolever/parameterized")
567 (synopsis "Parameterized testing with any Python test framework")
569 "Parameterized is a Python library that aims to fix parameterized testing
570 for every Python test framework. It supports nose, py.test, and unittest.")
571 (license license:bsd-2)))
573 (define-public python2-parameterized
574 (package-with-python2 python-parameterized))
576 (define-public python-minimock
578 (name "python-minimock")
583 (uri (pypi-uri "MiniMock" version))
586 "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
587 (build-system python-build-system)
588 (home-page "https://pypi.org/project/MiniMock")
589 (synopsis "Simple Python library for using mock objects")
590 (description "MiniMock is a simple library for building mock objects with
592 (license license:expat)))
594 (define-public python2-minimock
595 (package-with-python2 python-minimock))
597 (define-public python-mock
604 (uri (pypi-uri "mock" version))
607 "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
609 `(("python-pbr" ,python-pbr-minimal)
610 ("python-six" ,python-six)))
611 (build-system python-build-system)
613 `(("python-unittest2" ,python-unittest2)))
616 (modify-phases %standard-phases
619 (zero? (system* "unit2")))))))
620 (home-page "https://github.com/testing-cabal/mock")
621 (synopsis "Python mocking and patching library for testing")
623 "Mock is a library for testing in Python. It allows you to replace parts
624 of your system under test with mock objects and make assertions about how they
626 (properties `((python2-variant . ,(delay python2-mock))))
627 (license license:expat)))
629 (define-public python2-mock
630 (let ((base (package-with-python2
631 (strip-python2-variant python-mock))))
632 (package (inherit base)
634 `(("python2-functools32" ,python2-functools32)
635 ("python2-funcsigs" ,python2-funcsigs)
636 ,@(package-propagated-inputs base))))))
638 (define-public python-nose
645 (uri (pypi-uri "nose" version))
648 "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
649 (build-system python-build-system)
651 '(#:tests? #f)) ; FIXME: test suite fails
652 (home-page "http://readthedocs.org/docs/nose/")
653 (synopsis "Python testing library")
655 "Nose extends the unittest library to make testing easier.")
656 (license license:lgpl2.0+)))
658 (define-public python2-nose
659 (package-with-python2 python-nose))
661 (define-public python-nose2
663 (name "python-nose2")
668 (uri (pypi-uri "nose2" version))
671 "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
672 (build-system python-build-system)
673 (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
675 `(("python-cov-core" ,python-cov-core)
676 ("python-pytest-cov" ,python-pytest-cov)
677 ("python-six" ,python-six)))
678 (home-page "https://github.com/nose-devs/nose2")
679 (synopsis "Next generation of nicer testing for Python")
681 "Nose2 is the next generation of nicer testing for Python, based on the
682 plugins branch of unittest2. Nose2 aims to improve on nose by providing a
683 better plugin api, being easier for users to configure, and simplifying internal
684 interfaces and processes.")
685 (license license:bsd-2)))
687 (define-public python2-nose2
688 (package-with-python2 python-nose2))
690 (define-public python-unittest2
692 (name "python-unittest2")
697 (uri (pypi-uri "unittest2" version))
699 (search-patches "python-unittest2-python3-compat.patch"
700 "python-unittest2-remove-argparse.patch"))
703 "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
704 (build-system python-build-system)
707 (modify-phases %standard-phases
710 (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
712 `(("python-six" ,python-six)
713 ("python-traceback2" ,python-traceback2)))
714 (home-page "http://pypi.python.org/pypi/unittest2")
715 (synopsis "Python unit testing library")
717 "Unittest2 is a replacement for the unittest module in the Python
719 (license license:psfl)))
721 (define-public python2-unittest2
722 (package-with-python2 python-unittest2))
724 (define-public python-pytest
726 (name "python-pytest")
731 (uri (pypi-uri "pytest" version))
734 "18w38kjnffdcrlbw6ny6dksgxai6x9bxpjs2m6klqmb8hfzjkcb2"))))
735 (build-system python-build-system)
738 (modify-phases %standard-phases
741 (invoke "pytest" "-vv" "-k"
743 ;; These tests involve the /usr directory, and fails.
744 "not test_remove_dir_prefix"
745 " and not test_argcomplete"
746 ;; This test tries to override PYTHONPATH, and
747 ;; subsequently fails to locate the test libraries.
748 " and not test_collection")))))))
750 `(("python-atomicwrites" ,python-atomicwrites)
751 ("python-attrs" ,python-attrs-bootstrap)
752 ("python-more-itertools" ,python-more-itertools)
753 ("python-pluggy" ,python-pluggy)
754 ("python-py" ,python-py)
755 ("python-six" ,python-six-bootstrap)))
757 `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
759 ("python-hypothesis" ,python-hypothesis)
760 ("python-nose" ,python-nose)
761 ("python-mock" ,python-mock)
762 ("python-pytest" ,python-pytest-bootstrap)
763 ("python-setuptools-scm" ,python-setuptools-scm)))
764 (home-page "https://docs.pytest.org/en/latest/")
765 (synopsis "Python testing library")
767 "Pytest is a testing tool that provides auto-discovery of test modules
768 and functions, detailed info on failing assert statements, modular fixtures,
769 and many external plugins.")
770 (license license:expat)
771 (properties `((python2-variant . ,(delay python2-pytest))))))
773 (define-public python2-pytest
774 (let ((pytest (package-with-python2
775 (strip-python2-variant python-pytest))))
779 `(("python2-funcsigs" ,python2-funcsigs)
780 ("python2-pathlib2" ,python2-pathlib2)
781 ,@(package-propagated-inputs pytest))))))
783 (define-public python-pytest-bootstrap
785 (inherit (strip-python2-variant python-pytest))
786 (name "python-pytest-bootstrap")
787 (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
788 (arguments `(#:tests? #f))
789 (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
791 (define-public python2-pytest-bootstrap
792 (let ((pytest (package-with-python2
793 (strip-python2-variant python-pytest-bootstrap))))
794 (package (inherit pytest)
796 `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
797 ("python2-pathlib2" ,python2-pathlib2-bootstrap)
798 ,@(package-propagated-inputs pytest))))))
800 (define-public python-pytest-cov
802 (name "python-pytest-cov")
807 (uri (pypi-uri "pytest-cov" version))
809 (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
810 (build-system python-build-system)
813 (modify-phases %standard-phases
816 ;; Options taken from tox.ini.
817 ;; TODO: make "--restructuredtext" tests pass. They currently fail
818 ;; with "Duplicate implicit target name".
819 (invoke "python" "./setup.py" "check"
820 "--strict" "--metadata"))))))
822 `(("python-coverage" ,python-coverage)
823 ("python-pytest" ,python-pytest)))
824 (home-page "https://github.com/pytest-dev/pytest-cov")
825 (synopsis "Pytest plugin for measuring coverage")
827 "Pytest-cov produces coverage reports. It supports centralised testing and
828 distributed testing in both @code{load} and @code{each} modes. It also
829 supports coverage of subprocesses.")
830 (license license:expat)))
832 (define-public python2-pytest-cov
833 (package-with-python2 python-pytest-cov))
835 (define-public python-pytest-runner
837 (name "python-pytest-runner")
842 (uri (pypi-uri "pytest-runner" version))
845 "1x0d9n40lsiphblbs61rdc0d5r31f6vh0vcahqdv0mffakbnrb80"))))
846 (build-system python-build-system)
848 `(("python-pytest" ,python-pytest-bootstrap)
849 ("python-setuptools-scm" ,python-setuptools-scm)))
850 (home-page "https://github.com/pytest-dev/pytest-runner")
851 (synopsis "Invoke py.test as a distutils command")
853 "This package provides a @command{pytest-runner} command that
854 @file{setup.py} files can use to run tests.")
855 (license license:expat)))
857 (define-public python2-pytest-runner
858 (package-with-python2 python-pytest-runner))
860 ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
861 ;; Remove once no longer needed.
862 (define-public python-pytest-runner-2
868 (uri (pypi-uri "pytest-runner" version))
871 "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
873 (define-public python2-pytest-runner-2
874 (package-with-python2 python-pytest-runner-2))
876 (define-public python-pytest-mock
878 (name "python-pytest-mock")
883 (uri (pypi-uri "pytest-mock" version))
886 "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
887 (build-system python-build-system)
889 `(("python-setuptools-scm" ,python-setuptools-scm)))
891 `(("python-pytest" ,python-pytest)))
892 (home-page "https://github.com/pytest-dev/pytest-mock/")
893 (synopsis "Thin-wrapper around the mock package for easier use with py.test")
895 "This plugin installs a @code{mocker} fixture which is a thin-wrapper
896 around the patching API provided by the @code{mock} package, but with the
897 benefit of not having to worry about undoing patches at the end of a test.
898 The mocker fixture has the same API as @code{mock.patch}, supporting the
900 (properties `((python2-variant . ,(delay python2-pytest-mock))))
901 (license license:expat)))
903 (define-public python2-pytest-mock
904 (let ((base (package-with-python2
905 (strip-python2-variant python-pytest-mock))))
906 (package (inherit base)
908 `(("python2-mock" ,python2-mock)
909 ,@(package-propagated-inputs base))))))
911 (define-public python-pytest-xdist
913 (name "python-pytest-xdist")
918 (uri (pypi-uri "pytest-xdist" version))
921 "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
922 (modules '((guix build utils)))
925 ;; Remove pre-compiled .pyc files from source.
926 (for-each delete-file-recursively
927 (find-files "." "__pycache__" #:directories? #t))
928 (for-each delete-file (find-files "." "\\.pyc$"))
930 (build-system python-build-system)
932 '(#:tests? #f)) ;FIXME: Some tests are failing.
934 ;; (modify-phases %standard-phases
936 ;; (add-after 'install 'check
937 ;; (lambda* (#:key inputs outputs #:allow-other-keys)
938 ;; (add-installed-pythonpath inputs outputs)
939 ;; (zero? (system* "py.test" "-v")))))
941 `(("python-setuptools-scm" ,python-setuptools-scm)))
943 `(("python-execnet" ,python-execnet)
944 ("python-pytest" ,python-pytest)
945 ("python-py" ,python-py)))
947 "https://github.com/pytest-dev/pytest-xdist")
949 "Plugin for py.test with distributed testing and loop-on-failing modes")
951 "The pytest-xdist plugin extends py.test with some unique test execution
952 modes: parallelization, running tests in boxed subprocesses, the ability
953 to run tests repeatedly when failed, and the ability to run tests on multiple
954 Python interpreters or platforms. It uses rsync to copy the existing
955 program code to a remote location, executes there, and then syncs the
957 (license license:expat)))
959 (define-public python2-pytest-xdist
960 (package-with-python2 python-pytest-xdist))
962 (define-public python-pytest-timeout
964 (name "python-pytest-timeout")
969 (uri (pypi-uri "pytest-timeout" version))
972 "1cczcjhw4xx5sjkhxlhc5c1bkr7x6fcyx12wrnvwfckshdvblc2a"))))
973 (build-system python-build-system)
975 `(("python-pytest" ,python-pytest)))
976 (home-page "http://bitbucket.org/pytest-dev/pytest-timeout/")
977 (synopsis "Plugin for py.test to abort hanging tests")
979 "This package provides a py.test plugin that aborts hanging tests after a
980 timeout has been exceeded.")
981 (license license:expat)))
983 (define-public python-scripttest
985 (name "python-scripttest")
990 (uri (pypi-uri "scripttest" version))
993 "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
994 (build-system python-build-system)
996 `(("python-pytest" ,python-pytest)))
997 (home-page "http://pythonpaste.org/scripttest/")
998 (synopsis "Python library to test command-line scripts")
999 (description "Scripttest is a Python helper library for testing
1000 interactive command-line applications. With it you can run a script in a
1001 subprocess and see the output as well as any file modifications.")
1002 (license license:expat)))
1004 (define-public python2-scripttest
1005 (package-with-python2 python-scripttest))
1007 (define-public python-testtools-bootstrap
1009 (name "python-testtools-bootstrap")
1014 (uri (pypi-uri "testtools" version))
1017 "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
1018 (patches (search-patches "python-testtools.patch"))))
1019 (build-system python-build-system)
1020 (arguments '(#:tests? #f))
1022 `(("python-extras" ,python-extras)
1023 ("python-fixtures" ,python-fixtures-bootstrap)
1024 ("python-mimeparse" ,python-mimeparse)
1025 ("python-pbr" ,python-pbr-minimal)
1026 ("python-six" ,python-six)
1027 ("python-traceback2" ,python-traceback2)
1028 ("python-unittest2" ,python-unittest2)))
1029 (home-page "https://github.com/testing-cabal/testtools")
1031 "Extensions to the Python standard library unit testing framework")
1033 "This package is only for bootstrapping. Do not use this.")
1034 (license license:psfl)))
1036 (define-public python2-testtools-bootstrap
1037 (package-with-python2 python-testtools-bootstrap))
1039 (define-public python-testtools
1041 (inherit python-testtools-bootstrap)
1042 (name "python-testtools")
1044 `(#:phases (modify-phases %standard-phases
1047 (invoke "python" "-m" "testtools.run"
1048 "testtools.tests.test_suite"))))))
1050 `(("python-extras" ,python-extras)
1051 ("python-fixtures" ,python-fixtures)
1052 ("python-mimeparse" ,python-mimeparse)
1053 ("python-pbr" ,python-pbr)
1054 ("python-six" ,python-six)
1055 ("python-traceback2" ,python-traceback2)
1056 ("python-unittest2" ,python-unittest2)))
1058 `(("python-testscenarios" ,python-testscenarios-bootstrap)))
1060 "Testtools extends the Python standard library unit testing framework to
1061 provide matchers, more debugging information, and cross-Python
1064 (define-public python2-testtools
1065 (package-with-python2 python-testtools))
1067 (define-public python-testscenarios-bootstrap
1069 (name "python-testscenarios-bootstrap")
1074 (uri (pypi-uri "testscenarios" version))
1077 "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
1078 (build-system python-build-system)
1080 `(#:phases (modify-phases %standard-phases
1083 (invoke "python" "-m" "testtools.run"
1084 "testscenarios.test_suite"))))))
1086 `(("python-pbr" ,python-pbr-minimal)
1087 ("python-testtools" ,python-testtools-bootstrap)))
1088 (home-page "https://launchpad.net/testscenarios")
1089 (synopsis "Pyunit extension for dependency injection")
1091 "This package is only for bootstrapping. Don't use this.")
1092 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1094 (define-public python2-testscenarios-bootstrap
1095 (package-with-python2 python-testscenarios-bootstrap))
1097 (define-public python-testscenarios
1099 (inherit python-testscenarios-bootstrap)
1100 (name "python-testscenarios")
1102 `(("python-pbr" ,python-pbr)
1103 ("python-testtools" ,python-testtools)))
1105 "Testscenarios provides clean dependency injection for Python unittest
1108 (define-public python2-testscenarios
1109 (package-with-python2 python-testscenarios))
1111 ;; Testresources requires python-pbr at runtime, but pbr needs it for its
1112 ;; own tests. Hence this bootstrap variant.
1113 (define-public python-testresources-bootstrap
1115 (name "python-testresources-bootstrap")
1119 (uri (pypi-uri "testresources" version))
1122 "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
1123 (build-system python-build-system)
1124 (arguments '(#:tests? #f))
1126 `(("python-pbr" ,python-pbr-minimal)))
1127 (home-page "https://launchpad.net/testresources")
1129 "Pyunit extension for managing test resources")
1131 "This package is only here for bootstrapping purposes. Use the regular
1132 testresources package instead.")
1133 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1135 (define-public python2-testresources-bootstrap
1136 (package-with-python2 python-testresources-bootstrap))
1138 (define-public python-testresources
1140 (inherit python-testresources-bootstrap)
1141 (name "python-testresources")
1143 `(("python-pbr" ,python-pbr)))
1146 `(("python-fixtures" ,python-fixtures)
1147 ("python-testtols" ,python-testtools)))
1149 "Testresources is an extension to Python's unittest to allow declarative
1150 use of resources by test cases.")))
1152 (define-public python2-testresources
1153 (package-with-python2 python-testresources))
1155 (define-public python-subunit-bootstrap
1157 (name "python-subunit-bootstrap")
1162 (uri (pypi-uri "python-subunit" version))
1165 "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
1166 (build-system python-build-system)
1168 `(("python-extras" ,python-extras)
1169 ("python-testtools" ,python-testtools-bootstrap)))
1171 `(("python-fixtures" ,python-fixtures-bootstrap)
1172 ("python-hypothesis" ,python-hypothesis)
1173 ("python-testscenarios" ,python-testscenarios-bootstrap)))
1174 (home-page "https://launchpad.net/subunit")
1175 (synopsis "Python implementation of the subunit protocol")
1177 "This package is here for bootstrapping purposes only. Use the regular
1178 python-subunit package instead.")
1179 (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
1181 (define-public python2-subunit-bootstrap
1182 (package-with-python2 python-subunit-bootstrap))
1184 (define-public python-subunit
1186 (inherit python-subunit-bootstrap)
1187 (name "python-subunit")
1189 `(("python-extras" ,python-extras)
1190 ("python-testtools" ,python-testtools)))
1192 `(("python-fixtures" ,python-fixtures)
1193 ("python-hypothesis" ,python-hypothesis)
1194 ("python-testscenarios" ,python-testscenarios)))
1196 "Python-subunit is a Python implementation of the subunit test streaming
1199 (define-public python2-subunit
1200 (package-with-python2 python-subunit))
1202 ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
1203 ;; own tests. Hence this bootstrap variant.
1204 (define-public python-fixtures-bootstrap
1206 (name "python-fixtures-bootstrap")
1210 (uri (pypi-uri "fixtures" version))
1213 "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
1214 (build-system python-build-system)
1215 (arguments `(#:tests? #f))
1217 `(("python-pbr-minimal" ,python-pbr-minimal)
1218 ("python-six" ,python-six)))
1219 (home-page "https://launchpad.net/python-fixtures")
1220 (synopsis "Python test fixture library")
1222 "This package is only used for bootstrapping. Use the regular
1223 python-fixtures package instead.")
1224 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1226 (define-public python2-fixtures-bootstrap
1227 (package-with-python2 python-fixtures-bootstrap))
1229 (define-public python-fixtures
1231 (inherit python-fixtures-bootstrap)
1232 (name "python-fixtures")
1235 (modify-phases %standard-phases
1238 (invoke "python" "-m" "testtools.run"
1239 "fixtures.test_suite"))))))
1241 ;; Fixtures uses pbr at runtime to check versions, etc.
1242 `(("python-pbr" ,python-pbr)
1243 ("python-six" ,python-six)))
1245 `(("python-mock" ,python-mock)
1246 ("python-testtools" ,python-testtools-bootstrap)))
1248 "Fixtures provides a way to create reusable state, useful when writing
1251 (define-public python2-fixtures
1252 (package-with-python2 python-fixtures))
1254 (define-public python-testrepository-bootstrap
1256 (name "python-testrepository-bootstrap")
1261 (uri (pypi-uri "testrepository" version))
1264 "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
1265 (build-system python-build-system)
1266 (arguments '(#:tests? #f))
1268 `(("python-fixtures" ,python-fixtures-bootstrap)
1269 ("python-subunit" ,python-subunit-bootstrap)
1270 ("python-testtools" ,python-testtools-bootstrap)))
1272 `(("python-mimeparse" ,python-mimeparse)))
1273 (home-page "https://launchpad.net/testrepository")
1274 (synopsis "Database for Python test results")
1276 "Bootstrap package for python-testrepository. Don't use this.")
1277 (license (list license:bsd-3 license:asl2.0)))) ; at user's option
1279 (define-public python2-testrepository-bootstrap
1280 (package-with-python2 python-testrepository-bootstrap))
1282 (define-public python-testrepository
1284 (inherit python-testrepository-bootstrap)
1285 (name "python-testrepository")
1287 ;; FIXME: Many tests are failing.
1290 `(("python-fixtures" ,python-fixtures)
1291 ("python-subunit" ,python-subunit)
1292 ("python-testtools" ,python-testtools)))
1294 `(("python-mimeparse" ,python-mimeparse)))
1295 (description "Testrepository provides a database of test results which can
1296 be used as part of a developer's workflow to check things such as what tests
1297 have failed since the last commit or what tests are currently failing.")))
1299 (define-public python2-testrepository
1300 (package-with-python2 python-testrepository))
1302 (define-public python-coverage
1304 (name "python-coverage")
1309 (uri (pypi-uri "coverage" version))
1312 "02f6m073qdispn96rc616hg0rnmw1pgqzw3bgxwiwza4zf9hirlx"))))
1313 (build-system python-build-system)
1315 ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
1317 (home-page "http://nedbatchelder.com/code/coverage")
1318 (synopsis "Code coverage measurement for Python")
1320 "Coverage measures code coverage, typically during test execution. It
1321 uses the code analysis tools and tracing hooks provided in the Python standard
1322 library to determine which lines are executable, and which have been
1324 (license license:bsd-3)))
1326 (define-public python2-coverage
1327 (package-with-python2 python-coverage))
1329 (define-public python-cov-core
1331 (name "python-cov-core")
1336 (uri (pypi-uri "cov-core" version))
1339 "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
1340 (build-system python-build-system)
1342 `(("python-coverage" ,python-coverage)))
1343 (home-page "https://github.com/schlamar/cov-core")
1344 (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
1346 "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
1347 and @code{nose2-cov}. It is useful for developing coverage plugins for these
1348 testing frameworks.")
1349 (license license:expat)))
1351 (define-public python2-cov-core
1352 (package-with-python2 python-cov-core))
1354 (define-public python-codecov
1356 (name "python-codecov")
1361 (uri (pypi-uri "codecov" version))
1364 "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
1365 (build-system python-build-system)
1367 `(("python-unittest2" ,python-unittest2)))
1369 `(("python-coverage" ,python-coverage)
1370 ("python-requests" ,python-requests)))
1371 (home-page "http://github.com/codecov/codecov-python")
1372 (synopsis "Upload code coverage reports to @code{codecov.io}")
1374 "Codecov collects code coverage reports from code written in Python, Java,
1375 C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
1376 (license license:asl2.0)))
1378 (define-public python-testpath
1380 (name "python-testpath")
1386 (url "https://github.com/jupyter/testpath")
1388 (file-name (git-file-name name version))
1391 "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
1392 (build-system python-build-system)
1394 `(#:tests? #f ; this package does not even have a setup.py
1395 #:modules ((guix build python-build-system)
1398 #:imported-modules (,@%python-build-system-modules
1401 (modify-phases %standard-phases
1404 (lambda* (#:key inputs outputs #:allow-other-keys)
1405 (let* ((version (last
1406 (string-split (assoc-ref inputs "python") #\-)))
1407 (x.y (string-join (take (string-split version #\.) 2)
1410 (assoc-ref outputs "out")
1411 "/lib/python" x.y "/site-packages/testpath")))
1413 (copy-recursively "testpath" dir))
1415 (home-page "https://github.com/takluyver/testpath")
1416 (synopsis "Test utilities for code working with files and commands")
1418 "Testpath is a collection of utilities for Python code working with files
1419 and commands. It contains functions to check things on the file system, and
1420 tools for mocking system commands and recording calls to those.")
1421 (license license:expat)))
1423 (define-public python2-testpath
1424 (package-with-python2 python-testpath))
1426 (define-public python-testlib
1428 (name "python-testlib")
1433 (uri (pypi-uri "testlib" version ".zip"))
1435 (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
1436 (build-system python-build-system)
1438 `(("unzip" ,unzip))) ; for unpacking the source
1439 (synopsis "Python micro test suite harness")
1440 (description "A micro unittest suite harness for Python.")
1441 (home-page "https://github.com/trentm/testlib")
1442 (license license:expat)))
1444 (define-public python2-testlib
1445 (package-with-python2 python-testlib))
1447 ;;; The software provided by this package was integrated into pytest 2.8.
1448 (define-public python-pytest-cache
1450 (name "python-pytest-cache")
1454 (uri (pypi-uri "pytest-cache" version))
1457 "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
1458 (build-system python-build-system)
1460 `(("python-apipkg" ,python-apipkg)
1461 ("python-execnet" ,python-execnet)
1462 ("python-py" ,python-py)
1463 ("python-pytest" ,python-pytest)))
1464 (synopsis "Py.test plugin with mechanisms for caching across test runs")
1465 (description "The pytest-cache plugin provides tools to rerun failures from
1466 the last py.test invocation.")
1467 (home-page "https://bitbucket.org/hpk42/pytest-cache/")
1468 (license license:expat)))
1470 (define-public python2-pytest-cache
1471 (package-with-python2 python-pytest-cache))
1473 (define-public python-pytest-localserver
1475 (name "python-pytest-localserver")
1479 (uri (pypi-uri "pytest-localserver" version))
1482 "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
1483 (build-system python-build-system)
1486 (modify-phases %standard-phases
1489 (invoke "py.test" "-v"))))))
1491 `(("python-pytest" ,python-pytest)
1492 ("python-requests" ,python-requests)
1493 ("python-six" ,python-six)))
1495 `(("python-werkzeug" ,python-werkzeug)))
1496 (synopsis "Py.test plugin to test server connections locally")
1497 (description "Pytest-localserver is a plugin for the pytest testing
1498 framework which enables you to test server connections locally.")
1499 (home-page "https://pypi.python.org/pypi/pytest-localserver")
1500 (license license:expat)))
1502 (define-public python-pytest-xprocess
1504 (name "python-pytest-xprocess")
1508 (uri (pypi-uri "pytest-xprocess" version))
1511 "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
1512 (build-system python-build-system)
1514 `(("python-pytest" ,python-pytest)
1515 ("python-pytest-cache" ,python-pytest-cache)
1516 ("python-psutil" ,python-psutil)))
1517 (synopsis "Pytest plugin to manage external processes across test runs")
1518 (description "Pytest-xprocess is an experimental py.test plugin for managing
1519 processes across test runs.")
1520 (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
1521 (license license:expat)))
1523 (define-public python-pytest-subtesthack
1525 (name "python-pytest-subtesthack")
1529 (uri (pypi-uri "pytest-subtesthack" version))
1532 "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
1533 (build-system python-build-system)
1535 `(("python-pytest" ,python-pytest)))
1536 (synopsis "Set-up and tear-down fixtures for unit tests")
1537 (description "This plugin allows you to set up and tear down fixtures within
1538 unit test functions that use @code{py.test}. This is useful for using
1539 @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
1540 function multiple times, without setting up or tearing down fixture state as is
1541 normally the case.")
1542 (home-page "https://github.com/untitaker/pytest-subtesthack/")
1543 (license license:unlicense)))
1545 (define-public python2-pytest-subtesthack
1546 (package-with-python2 python-pytest-subtesthack))
1548 (define-public python-pytest-sugar
1550 (name "python-pytest-sugar")
1555 (uri (pypi-uri "pytest-sugar" version))
1558 "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
1559 (build-system python-build-system)
1561 `(("python-packaging" ,python-packaging)
1562 ("python-pytest" ,python-pytest)
1563 ("python-termcolor" ,python-termcolor)))
1564 (home-page "https://pivotfinland.com/pytest-sugar/")
1565 (synopsis "Plugin for pytest that changes the default look and feel")
1567 "@code{pytest-sugar} is a plugin for py.test that changes the default
1568 look and feel of py.test, using a progress bar and showing failures and errors
1570 (license license:bsd-3)))
1572 (define-public python-hypothesis
1574 (name "python-hypothesis")
1578 (uri (pypi-uri "hypothesis" version))
1581 "0a35nwqyjnm4cphi43xracqpkws0ip61mndvqb1iqq7gkva83lb1"))))
1582 (build-system python-build-system)
1584 `(("python-flake8" ,python-flake8)
1585 ("python-pytest" ,python-pytest-bootstrap)))
1587 `(("python-attrs" ,python-attrs-bootstrap)
1588 ("python-coverage" ,python-coverage)))
1589 (synopsis "Library for property based testing")
1590 (description "Hypothesis is a library for testing your Python code against a
1591 much larger range of examples than you would ever want to write by hand. It’s
1592 based on the Haskell library, Quickcheck, and is designed to integrate
1593 seamlessly into your existing Python unit testing work flow.")
1594 (home-page "https://github.com/HypothesisWorks/hypothesis-python")
1595 (license license:mpl2.0)
1596 (properties `((python2-variant . ,(delay python2-hypothesis))))))
1598 (define-public python2-hypothesis
1599 (let ((hypothesis (package-with-python2
1600 (strip-python2-variant python-hypothesis))))
1601 (package (inherit hypothesis)
1603 `(("python2-enum34" ,python2-enum34)
1604 ,@(package-propagated-inputs hypothesis))))))
1606 (define-public python-lit
1613 (uri (pypi-uri "lit" version))
1616 "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
1617 (build-system python-build-system)
1620 (modify-phases %standard-phases
1623 (invoke "python" "lit.py" "tests"))))))
1626 (home-page "https://llvm.org/")
1627 (synopsis "LLVM Software Testing Tool")
1628 (description "@code{lit} is a portable tool for executing LLVM and Clang
1629 style test suites, summarizing their results, and providing indication of
1631 (license license:ncsa)))
1633 (define-public python2-lit
1634 (package-with-python2 python-lit))
1636 (define-public python-pytest-pep8
1638 (name "python-pytest-pep8")
1642 (uri (pypi-uri "pytest-pep8" version))
1645 "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
1646 (build-system python-build-system)
1648 `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
1650 `(("python-pytest" ,python-pytest)))
1652 `(("python-pep8" ,python-pep8)))
1653 (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
1654 (synopsis "Py.test plugin to check PEP8 requirements")
1655 (description "Pytest plugin for checking PEP8 compliance.")
1656 (license license:expat)))
1658 (define-public python2-pytest-pep8
1659 (package-with-python2 python-pytest-pep8))
1661 (define-public python-pytest-flakes
1663 (name "python-pytest-flakes")
1667 (uri (pypi-uri "pytest-flakes" version))
1670 "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
1671 (build-system python-build-system)
1674 (modify-phases %standard-phases
1676 (add-after 'install 'check
1677 (lambda* (#:key outputs inputs #:allow-other-keys)
1678 ;; It's easier to run tests after install.
1679 ;; Make installed package available for running the tests
1680 (add-installed-pythonpath inputs outputs)
1681 (invoke "py.test" "-vv"))))))
1683 `(("python-coverage" ,python-coverage)
1684 ("python-pytest" ,python-pytest)
1685 ("python-pytest-cache" ,python-pytest-cache)
1686 ("python-pytest-pep8" ,python-pytest-pep8)))
1688 `(("python-pyflakes" ,python-pyflakes)))
1689 (home-page "https://github.com/fschulze/pytest-flakes")
1690 (synopsis "Py.test plugin to check source code with pyflakes")
1691 (description "Pytest plugin for checking Python source code with pyflakes.")
1692 (license license:expat)))
1694 (define-public python2-pytest-flakes
1695 (package-with-python2 python-pytest-flakes))
1697 (define-public python2-coverage-test-runner
1699 (name "python2-coverage-test-runner")
1705 "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
1706 "coverage-test-runner/snapshot/coverage-test-runner-"
1710 "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
1711 (build-system python-build-system)
1713 `(#:python ,python-2
1715 (modify-phases %standard-phases
1718 (invoke "./testrun"))))))
1720 `(("python2-coverage" ,python2-coverage)))
1721 (home-page "https://liw.fi/coverage-test-runner/")
1722 (synopsis "Python module for running unit tests")
1723 (description "@code{CoverageTestRunner} is a python module for running
1724 unit tests and failing them if the unit test module does not exercise all
1725 statements in the module it tests.")
1726 (license license:gpl3+)))
1728 ;; Further releases, up to 2.4.3, have failing unit tests. See:
1729 ;; https://github.com/PyCQA/pylint/issues/3198.
1730 (define-public python-pylint
1732 (name "python-pylint")
1738 (url "https://github.com/PyCQA/pylint")
1739 (commit (string-append "pylint-" version))))
1740 (file-name (git-file-name name version))
1743 "17vvzbcqmkhr4icq5p3737nbiiyj1y3g1pa08n9mb1bsnvxmqq0z"))))
1744 (build-system python-build-system)
1746 `(("python-pytest" ,python-pytest)
1747 ("python-pytest-runner" ,python-pytest-runner)
1748 ("python-tox" ,python-tox)))
1750 `(("python-astroid" ,python-astroid)
1751 ("python-isort" ,python-isort)
1752 ("python-mccabe" ,python-mccabe)
1753 ("python-six" ,python-six)))
1754 (home-page "https://github.com/PyCQA/pylint")
1755 (synopsis "Python source code analyzer which looks for coding standard
1757 (description "Pylint is a Python source code analyzer which looks
1758 for programming errors, helps enforcing a coding standard and sniffs
1759 for some code smells (as defined in Martin Fowler's Refactoring book).
1761 Pylint has many rules enabled by default, way too much to silence them
1762 all on a minimally sized program. It's highly configurable and handle
1763 pragmas to control it from within your code. Additionally, it is
1764 possible to write plugins to add your own checks.")
1765 (properties `((python2-variant . ,(delay python2-pylint))))
1766 (license license:gpl2+)))
1768 ;; Python2 is not supported anymore by Pylint. See:
1769 ;; https://github.com/PyCQA/pylint/issues/1763.
1770 (define-public python2-pylint
1771 (let ((pylint (package-with-python2
1772 (strip-python2-variant python-pylint))))
1773 (package (inherit pylint)
1779 (url "https://github.com/PyCQA/pylint")
1780 (commit (string-append "pylint-" version))))
1781 (file-name (git-file-name (package-name pylint) version))
1784 "02a89d8a47s7nfiv1ady3j0sg2sbyja3np145brarfp5x9qxz9x2"))))
1786 `(,@(package-arguments pylint)
1788 (modify-phases %standard-phases
1791 ;; Somehow, tests fail if run from the build directory.
1792 (let ((work "/tmp/work"))
1794 (setenv "PYTHONPATH"
1795 (string-append (getenv "PYTHONPATH") ":" work))
1796 (copy-recursively "." work)
1797 (with-directory-excursion "/tmp"
1798 (invoke "python" "-m" "unittest" "discover"
1799 "-s" (string-append work "/pylint/test")
1800 "-p" "*test_*.py"))))))))
1802 `(("python2-futures" ,python2-futures)
1803 ,@(package-native-inputs pylint)))
1805 `(("python2-backports-functools-lru-cache"
1806 ,python2-backports-functools-lru-cache)
1807 ("python2-configparser" ,python2-configparser)
1808 ,@(package-propagated-inputs pylint))))))
1810 (define-public python-paramunittest
1812 (name "python-paramunittest")
1817 (uri (pypi-uri "ParamUnittest" version))
1820 "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
1821 (build-system python-build-system)
1823 "https://github.com/rik0/ParamUnittest")
1825 "Simple extension to have parametrized unit tests")
1827 "This package allows to create parametrized unit-tests that work with the standard
1828 unittest package. A parametrized test case is automatically converted to multiple test
1829 cases. Since they are TestCase subclasses, they work with other test suites that
1830 recognize TestCases.")
1831 (license license:bsd-2)))
1833 (define-public python2-python-paramunittest
1834 (package-with-python2 python-paramunittest))
1836 (define-public python-pytest-warnings
1838 (name "python-pytest-warnings")
1843 (uri (pypi-uri "pytest-warnings" version))
1846 "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
1847 (build-system python-build-system)
1849 `(("pytest" ,python-pytest)))
1850 (home-page "https://github.com/fschulze/pytest-warnings")
1851 (synopsis "Pytest plugin to list Python warnings in pytest report")
1853 "Python-pytest-warnings is a pytest plugin to list Python warnings in
1855 (license license:expat)
1856 (properties `((python2-variant . ,(delay python2-pytest-warnings))
1857 ;; This package is part of pytest as of version 3.1.0.
1858 (superseded . ,python-pytest)))))
1860 (define-public python2-pytest-warnings
1861 (package (inherit (package-with-python2
1862 (strip-python2-variant python-pytest-warnings)))
1863 (properties `((superseded . ,python2-pytest)))))
1865 (define-public python-pytest-capturelog
1867 (name "python-pytest-capturelog")
1872 (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
1875 "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
1876 (build-system python-build-system)
1878 `(("pytest" ,python-pytest)))
1879 (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
1880 (synopsis "Pytest plugin to catch log messages")
1882 "Python-pytest-catchlog is a pytest plugin to catch log messages.")
1883 (license license:expat)))
1885 (define-public python2-pytest-capturelog
1886 (package-with-python2 python-pytest-capturelog))
1888 (define-public python-pytest-catchlog
1890 (name "python-pytest-catchlog")
1895 (uri (pypi-uri "pytest-catchlog" version ".zip"))
1898 "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
1899 (build-system python-build-system)
1901 `(("unzip" ,unzip)))
1903 `(("pytest" ,python-pytest)))
1904 (home-page "https://github.com/eisensheng/pytest-catchlog")
1905 (synopsis "Pytest plugin to catch log messages")
1907 "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
1908 a fork of pytest-capturelog.")
1909 (license license:expat)))
1911 (define-public python2-pytest-catchlog
1912 (package-with-python2 python-pytest-catchlog))
1914 (define-public python-nosexcover
1916 (name "python-nosexcover")
1920 (uri (pypi-uri "nosexcover" version))
1923 "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
1924 (build-system python-build-system)
1926 `(("python-coverage" ,python-coverage)
1927 ("python-nose" ,python-nose)))
1928 (home-page "http://github.com/cmheisel/nose-xcover")
1929 (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
1930 (description "Nose-xcover is a companion to the built-in
1931 @code{nose.plugins.cover}. This plugin will write out an XML coverage report
1932 to a file named coverage.xml.
1934 It will honor all the options you pass to the Nose coverage plugin,
1935 especially -cover-package.")
1936 (license license:expat)))
1938 (define-public python2-nosexcover
1939 (package-with-python2 python-nosexcover))
1941 (define-public python-discover
1943 (name "python-discover")
1948 (uri (pypi-uri "discover" version))
1951 "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
1952 (build-system python-build-system)
1953 (home-page "http://pypi.python.org/pypi/discover/")
1955 "Python test discovery for unittest")
1957 "Discover provides test discovery for unittest, a feature that has been
1958 backported from Python 2.7 for Python 2.4+.")
1959 (license license:bsd-3)))
1961 (define-public python2-discover
1962 (package-with-python2 python-discover))
1964 (define-public behave
1970 (uri (pypi-uri "behave" version))
1973 "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
1974 (build-system python-build-system)
1976 `(("python-mock" ,python-mock)
1977 ("python-nose" ,python-nose)
1978 ("python-pathpy" ,python-pathpy)
1979 ("python-pyhamcrest" ,python-pyhamcrest)
1980 ("python-pytest" ,python-pytest)))
1982 `(("python-importlib-metadata" ,python-importlib-metadata)
1983 ("python-six" ,python-six)
1984 ("python-parse" ,python-parse)
1985 ("python-parse-type" ,python-parse-type)))
1987 '(#:test-target "behave_test"
1989 (modify-phases %standard-phases
1990 (add-before 'check 'fix-library-loading
1992 ;; Otherwise, tests fail with no module named 'path'
1993 (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":"
1994 (getcwd) "/tasks/_vendor"))
1996 (home-page "https://github.com/behave/behave")
1997 (synopsis "Python behavior-driven development")
1999 "Behave is a tool for behavior-driven development in python.
2000 Behavior-driven development (or BDD) is an agile software development
2001 technique that encourages collaboration between developers, QA and
2002 non-technical or business participants in a software project. Behave uses
2003 tests written in a natural language style, backed up by Python code.")
2004 (license license:x11)))
2006 (define-public python-behave-web-api
2008 (name "python-behave-web-api")
2013 (uri (pypi-uri "behave-web-api" version))
2016 "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
2017 (build-system python-build-system)
2020 (modify-phases %standard-phases
2021 (add-after 'unpack 'fix-dependencies
2023 (substitute* "setup.py"
2024 (("'wheel'") "") ; We don't use it.
2025 (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
2028 `(("behave" ,behave)
2029 ("python-requests" ,python-requests)))
2030 (home-page "https://github.com/jefersondaniel/behave-web-api")
2031 (synopsis "Provides testing for JSON APIs with Behave for Python")
2032 (description "This package provides testing utility modules for testing
2033 JSON APIs with Behave.")
2034 (license license:expat)))
2036 (define-public python2-behave-web-api
2037 (package-with-python2 python-behave-web-api))
2039 (define-public python-rednose
2041 (name "python-rednose")
2046 (uri (pypi-uri "rednose" version))
2049 "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
2050 (build-system python-build-system)
2052 `(#:phases (modify-phases %standard-phases
2053 (add-after 'unpack 'patch-setup.py
2055 ;; Six is only required for tests and later versions
2057 (substitute* "setup.py"
2058 (("six==1.10.0") "six"))
2061 `(("python-colorama" ,python-colorama)
2062 ("python-termstyle" ,python-termstyle)))
2064 `(("python-six" ,python-six)
2065 ("python-nose" ,python-nose)))
2066 (home-page "https://github.com/JBKahn/rednose")
2067 (synopsis "Colored output for Python nosetests")
2068 (description "This package provides colored output for the
2069 @command{nosetests} command of the Python Nose unit test framework.")
2070 (license license:bsd-3)))
2072 (define-public python2-rednose
2073 (package-with-python2 python-rednose))
2075 (define-public python-nose-randomly
2077 (name "python-nose-randomly")
2082 (uri (pypi-uri "nose-randomly" version))
2084 (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
2085 (build-system python-build-system)
2087 `(("python-nose" ,python-nose)
2088 ("python-numpy" ,python-numpy)))
2089 (home-page "https://github.com/adamchainz/nose-randomly")
2091 "Nose plugin to randomly order tests and control random.seed")
2093 "This is a @code{Nose} plugin to randomly order tests which can be quite
2094 powerful in discovering hidden flaws in the tests themselves, while helping to
2095 reduce inter-test dependencies. It also helps in controlling @code{random.seed},
2096 by resetting it to a repeatable number for each test, enabling the tests to
2097 create data based on random numbers and yet remain repeatable.")
2098 (license license:bsd-3)))
2100 (define-public python2-nose-randomly
2101 (package-with-python2 python-nose-randomly))
2103 (define-public python-nose-timer
2105 (name "python-nose-timer")
2110 (uri (pypi-uri "nose-timer" version))
2112 (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
2113 (build-system python-build-system)
2115 `(("python-nose" ,python-nose)
2116 ("python-termcolor" ,python-termcolor)))
2117 (home-page "https://github.com/mahmoudimus/nose-timer")
2118 (synopsis "Timer plugin for nosetests")
2119 (description "Shows how much time was needed to run individual tests.")
2120 (license license:expat)))
2122 (define-public python2-nose-timer
2123 (package-with-python2 python-nose-timer))
2125 (define-public python-freezegun
2127 (name "python-freezegun")
2132 (uri (pypi-uri "freezegun" version))
2134 (base32 "1rx57v8ryjncjimg8hys9kx1r3rknvwcl4y340g20jn0sf69qk9a"))))
2135 (build-system python-build-system)
2137 `(("python-mock" ,python-mock)
2138 ("python-pytest" ,python-pytest)))
2140 `(("python-six" ,python-six)
2141 ("python-dateutil" ,python-dateutil)))
2144 (modify-phases %standard-phases
2145 ;; The tests are normally executed via `make test`, but the PyPi
2146 ;; package does not include the Makefile.
2149 (invoke "pytest" "-vv"))))))
2150 (home-page "https://github.com/spulec/freezegun")
2151 (synopsis "Test utility for mocking the datetime module")
2153 "FreezeGun is a library that allows your python tests to travel through
2154 time by mocking the datetime module.")
2155 (license license:asl2.0)))
2157 (define-public python2-freezegun
2158 (package-with-python2 python-freezegun))
2160 (define-public python-flexmock
2162 (name "python-flexmock")
2166 (uri (pypi-uri "flexmock" version))
2169 "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
2170 (build-system python-build-system)
2171 (home-page "https://flexmock.readthedocs.org")
2172 (synopsis "Testing library for Python")
2174 "flexmock is a testing library for Python that makes it easy to create
2175 mocks, stubs and fakes.")
2176 (license license:bsd-3)))
2178 (define-public python2-flexmock
2179 (package-with-python2 python-flexmock))
2181 (define-public python-flaky
2183 (name "python-flaky")
2187 (uri (pypi-uri "flaky" version))
2190 "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
2191 (build-system python-build-system)
2193 ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
2195 (home-page "https://github.com/box/flaky")
2196 (synopsis "Automatically rerun flaky tests")
2198 "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
2201 Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
2202 on components that aren't 100% reliable. With flaky, instead of removing
2203 those tests or marking them to @code{@@skip}, they can be automatically
2205 (license license:asl2.0)))
2207 (define-public python2-flaky
2208 (package-with-python2 python-flaky))
2210 (define-public python-pyhamcrest
2211 ;; The latest release was in 2016 and its test suite does not work with recent
2212 ;; versions of Pytest. Just take the master branch for now, which seems stable.
2213 (let ((commit "25fdc5f00bdf3084335353bc9247253098ec4cf2")
2216 (name "python-pyhamcrest")
2217 (version (git-version "1.9.0" revision commit))
2219 ;; Tests not distributed from pypi release.
2222 (url "https://github.com/hamcrest/PyHamcrest")
2224 (file-name (git-file-name name version))
2227 "1miqmhhi68vaix8sqc1lvpvbm27bacffxh5anm5cbfsvk7g9n6f3"))))
2228 (native-inputs ;all native inputs are for tests
2229 `(("python-pytest-cov" ,python-pytest-cov)
2230 ("python-mock" ,python-mock)
2231 ("python-pytest" ,python-pytest)
2232 ("python-hypothesis" ,python-hypothesis)))
2234 `(("python-six" ,python-six)))
2235 (build-system python-build-system)
2237 `(#:phases (modify-phases %standard-phases
2240 (setenv "PYTHONPATH"
2241 (string-append "build/lib:"
2242 (getenv "PYTHONPATH")))
2243 (invoke "pytest" "-vv"))))))
2244 (home-page "http://hamcrest.org/")
2245 (synopsis "Hamcrest matchers for Python")
2247 "PyHamcrest is a framework for writing matcher objects,
2248 allowing you to declaratively define \"match\" rules.")
2249 (license license:bsd-3))))
2251 (define-public python2-pyhamcrest
2252 (package-with-python2 python-pyhamcrest))
2254 (define-public unittest-cpp
2256 (name "unittest-cpp")
2261 (url "https://github.com/unittest-cpp/unittest-cpp")
2262 (commit (string-append "v" version))))
2263 (file-name (git-file-name name version))
2265 (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
2267 `(#:tests? #f)) ; It's run after build automatically.
2268 (build-system cmake-build-system)
2269 (home-page "https://github.com/unittest-cpp/unittest-cpp")
2270 (synopsis "Lightweight unit testing framework for C++")
2271 (description "UnitTest++ is a lightweight unit testing framework for C++.
2272 It was designed to do test-driven development on a wide variety of platforms.
2273 Simplicity, portability, speed, and small footprint are all very important
2274 aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
2275 of advanced library and language features, which means it should be easily
2276 portable to just about any platform.")
2277 (license license:expat)))
2279 (define-public libfaketime
2281 (name "libfaketime")
2283 (home-page "https://github.com/wolfcw/libfaketime")
2288 (commit (string-append "v" version))))
2291 "1mfdl82ppgbdvy1ny8mb7xii7p0g7awvn4bn36jb8v4r545slmjc"))
2292 (file-name (git-file-name name version))))
2293 (build-system gnu-build-system)
2295 '(#:phases (modify-phases %standard-phases
2297 (lambda* (#:key outputs #:allow-other-keys)
2298 (let ((out (assoc-ref outputs "out")))
2300 (setenv "PREFIX" out)
2302 (add-before 'check 'pre-check
2304 (substitute* "test/functests/test_exclude_mono.sh"
2305 (("/bin/bash") (which "bash")))
2307 #:test-target "test"))
2309 `(("perl" ,perl))) ;for tests
2310 (synopsis "Fake the system time for single applications")
2312 "The libfaketime library allows users to modify the system time that an
2313 application \"sees\". It is meant to be loaded using the dynamic linker's
2314 @code{LD_PRELOAD} environment variable. The @command{faketime} command
2315 provides a simple way to achieve this.")
2316 (license license:gpl2)))
2318 (define-public umockdev
2324 (uri (string-append "https://github.com/martinpitt/umockdev/"
2325 "releases/download/" version "/"
2326 "umockdev-" version ".tar.xz"))
2329 "095v3abc321s584sga04y16lcmdzsdi88h24wcrm78v7vq484g74"))))
2330 (build-system gnu-build-system)
2333 (modify-phases %standard-phases
2334 (add-after 'unpack 'skip-broken-test
2336 (substitute* "tests/test-umockdev.c"
2337 (("/\\* sys/ in other dir")
2338 (string-append "return; // ")))
2342 ("gtk-doc" ,gtk-doc)
2343 ("pkg-config" ,pkg-config)
2351 ("libgudev" ,libgudev)
2352 ("gobject-introspection" ,gobject-introspection)))
2353 (home-page "https://github.com/martinpitt/umockdev/")
2354 (synopsis "Mock hardware devices for creating unit tests")
2355 (description "umockdev mocks hardware devices for creating integration
2356 tests for hardware related libraries and programs. It also provides tools to
2357 record the properties and behaviour of particular devices, and to run a
2358 program or test suite under a test bed with the previously recorded devices
2360 (license license:lgpl2.1+)))
2362 (define-public virtest
2363 ;; No releases yet, so we take the commit that "vc" expects.
2364 (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
2368 (version (git-version "0.0" revision commit))
2369 (home-page "https://github.com/mattkretz/virtest")
2372 (uri (git-reference (url home-page) (commit commit)))
2373 (file-name (git-file-name name version))
2376 "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
2377 (build-system cmake-build-system)
2379 `(#:phases (modify-phases %standard-phases
2380 (add-after 'unpack 'adjust-install-directory
2382 ;; Vc is the only consumer of this library, and expects
2383 ;; to find it in "virtest/vir/" instead of "vir/vir/".
2384 (substitute* "CMakeLists.txt"
2385 (("DESTINATION include/vir")
2386 "DESTINATION include/virtest"))
2388 (synopsis "Header-only test framework")
2390 "@code{virtest} is a small header-only test framework for C++. It
2391 grew out of the @dfn{Vc} project.")
2392 (license license:bsd-3))))
2394 (define-public python-pyfakefs
2396 (name "python-pyfakefs")
2400 ;; We use the PyPI URL because there is no proper release
2401 ;; available from GitHub. The GitHub project only provides
2402 ;; autogenerated tarballs, which are known to change in place.
2403 (uri (pypi-uri "pyfakefs" version))
2406 "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc"))
2407 (patches (search-patches
2408 "python-pyfakefs-remove-bad-test.patch"))
2409 (file-name (string-append name "-" version ".tar.gz"))))
2412 (modify-phases %standard-phases
2413 ;; The default test suite does not run these extra tests.
2414 (add-after 'check 'check-pytest-plugin
2417 "python" "-m" "pytest"
2418 "pyfakefs/pytest_tests/pytest_plugin_test.py")
2421 `(("python-pytest" ,python-pytest)))
2422 (build-system python-build-system)
2423 ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
2424 ;; page, but the pyfakefs documentation asks us to use this specific URL
2425 ;; when linking to the project. Honor their request.
2426 (home-page "http://pyfakefs.org/")
2427 ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
2428 (synopsis "Mock file system interactions in tests")
2430 "This package provides a Python library intended for use in automated
2431 tests. One difficulty when testing software is that the code under test might
2432 need to read or write to files in the local file system. If the file system
2433 is not set up in just the right way, it might cause a spurious error during
2434 the test. The pyfakefs library provides a solution to problems like this by
2435 mocking file system interactions. In other words, it arranges for the code
2436 under test to interact with a fake file system instead of the real file
2437 system. The code under test requires no modification to work with pyfakefs.")
2438 (license license:asl2.0)))
2440 (define-public python2-pyfakefs
2441 (package-with-python2 python-pyfakefs))