check.scm 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242
  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 Mathieu Othacehe <m.othacehe@gmail.com>
  25. ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
  26. ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
  27. ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
  28. ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
  29. ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
  30. ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
  31. ;;;
  32. ;;; This file is part of GNU Guix.
  33. ;;;
  34. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  35. ;;; under the terms of the GNU General Public License as published by
  36. ;;; the Free Software Foundation; either version 3 of the License, or (at
  37. ;;; your option) any later version.
  38. ;;;
  39. ;;; GNU Guix is distributed in the hope that it will be useful, but
  40. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  41. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  42. ;;; GNU General Public License for more details.
  43. ;;;
  44. ;;; You should have received a copy of the GNU General Public License
  45. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  46. (define-module (gnu packages check)
  47. #:use-module (gnu packages)
  48. #:use-module (gnu packages autotools)
  49. #:use-module (gnu packages base)
  50. #:use-module (gnu packages bash)
  51. #:use-module (gnu packages compression)
  52. #:use-module (gnu packages linux)
  53. #:use-module (gnu packages llvm)
  54. #:use-module (gnu packages glib)
  55. #:use-module (gnu packages gnome)
  56. #:use-module (gnu packages golang)
  57. #:use-module (gnu packages gtk)
  58. #:use-module (gnu packages perl)
  59. #:use-module (gnu packages pkg-config)
  60. #:use-module (gnu packages python)
  61. #:use-module (gnu packages python-web)
  62. #:use-module (gnu packages python-xyz)
  63. #:use-module (gnu packages time)
  64. #:use-module (guix utils)
  65. #:use-module ((guix licenses) #:prefix license:)
  66. #:use-module (guix packages)
  67. #:use-module (guix download)
  68. #:use-module (guix git-download)
  69. #:use-module (guix build-system cmake)
  70. #:use-module (guix build-system gnu)
  71. #:use-module (guix build-system go)
  72. #:use-module (guix build-system python)
  73. #:use-module (guix build-system trivial))
  74. (define-public check
  75. (package
  76. (name "check")
  77. (version "0.12.0")
  78. (source
  79. (origin
  80. (method url-fetch)
  81. (uri (string-append "https://github.com/libcheck/check/releases/download/"
  82. version "/check-" version ".tar.gz"))
  83. (sha256
  84. (base32
  85. "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))
  86. (build-system gnu-build-system)
  87. (home-page "https://libcheck.github.io/check/")
  88. (synopsis "Unit test framework for C")
  89. (description
  90. "Check is a unit testing framework for C. It features a simple
  91. interface for defining unit tests, putting little in the way of the
  92. developer. Tests are run in a separate address space, so Check can
  93. catch both assertion failures and code errors that cause segmentation
  94. faults or other signals. The output from unit tests can be used within
  95. source code editors and IDEs.")
  96. (license license:lgpl2.1+)))
  97. (define-public cunit
  98. (package
  99. (name "cunit")
  100. (version "2.1-3")
  101. (source
  102. (origin
  103. (method url-fetch)
  104. (uri (string-append "mirror://sourceforge/cunit/CUnit/"
  105. version "/CUnit-" version ".tar.bz2"))
  106. (sha256
  107. (base32
  108. "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
  109. (build-system gnu-build-system)
  110. (arguments '(#:phases
  111. (modify-phases %standard-phases
  112. ;; XXX: The "bootstrap" phase detects the "bootstrap"
  113. ;; script, but fails to execute it, so we bootstrap
  114. ;; manually.
  115. (replace 'bootstrap
  116. (lambda _ (invoke "autoreconf" "-vfi"))))))
  117. (native-inputs
  118. `(("automake" ,automake)
  119. ("autoconf" ,autoconf)
  120. ("libtool" ,libtool)))
  121. (home-page "http://cunit.sourceforge.net/")
  122. (synopsis "Automated testing framework for C")
  123. (description
  124. "CUnit is a lightweight system for writing, administering, and running
  125. unit tests in C. It provides C programmers with basic testing functionality
  126. with a flexible variety of user interfaces.")
  127. (license license:gpl2+)))
  128. (define-public cppunit
  129. (package
  130. (name "cppunit")
  131. (version "1.13.2")
  132. (source (origin
  133. (method url-fetch)
  134. (uri (string-append "http://dev-www.libreoffice.org/src/"
  135. name "-" version ".tar.gz"))
  136. (sha256
  137. (base32
  138. "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
  139. ;; Explicitly link with libdl. This is expected to be done by packages
  140. ;; relying on cppunit for their tests. However, not all of them do.
  141. ;; If we added the linker flag to such packages, we would pollute all
  142. ;; binaries, not only those used for testing.
  143. (arguments
  144. `(#:make-flags '("LDFLAGS=-ldl")))
  145. (build-system gnu-build-system)
  146. (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
  147. (synopsis "Unit testing framework for C++")
  148. (description "CppUnit is the C++ port of the famous JUnit framework for
  149. unit testing. Test output is in XML for automatic testing and GUI based for
  150. supervised tests.")
  151. (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
  152. ;; Some packages require this newer version of cppunit. However, it needs
  153. ;; C++11 support, which is not enabled by default in our current GCC, and
  154. ;; updating in-place would require adding CXXFLAGS to many dependent packages.
  155. ;; Thus, keep as a separate variable for now.
  156. ;; TODO: Remove this when our default GCC is updated to 6 or higher.
  157. (define-public cppunit-1.14
  158. (package
  159. (inherit cppunit)
  160. (version "1.14.0")
  161. (source (origin
  162. (method url-fetch)
  163. (uri (string-append "https://dev-www.libreoffice.org/src/"
  164. "cppunit-" version ".tar.gz"))
  165. (sha256
  166. (base32
  167. "1027cyfx5gsjkdkaf6c2wnjh68882grw8n672018cj3vs9lrhmix"))))))
  168. ;; When dependent packages upgraded to use newer version of catch, this one should
  169. ;; be removed.
  170. (define-public catch-framework
  171. (package
  172. (name "catch")
  173. (version "1.3.5") ;Sub-minor is the build number
  174. (source (origin
  175. (method git-fetch)
  176. (uri (git-reference
  177. (url "https://github.com/philsquared/Catch")
  178. ;; Semi-arbitrary.
  179. (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
  180. (file-name (string-append name "-" version))
  181. (sha256
  182. (base32
  183. "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
  184. (build-system trivial-build-system)
  185. (arguments
  186. `(#:modules ((guix build utils))
  187. #:builder (begin
  188. (use-modules (guix build utils))
  189. (let* ((source (assoc-ref %build-inputs "source"))
  190. (output (assoc-ref %outputs "out"))
  191. (incdir (string-append output "/include"))
  192. (docdir (string-append output "/share/doc/catch-"
  193. ,version)))
  194. (for-each mkdir-p (list incdir docdir))
  195. (install-file (string-append source
  196. "/single_include/catch.hpp")
  197. incdir)
  198. (copy-recursively (string-append source "/docs")
  199. docdir)
  200. #t))))
  201. (home-page "http://catch-lib.net/")
  202. (synopsis "Automated test framework for C++ and Objective-C")
  203. (description
  204. "Catch stands for C++ Automated Test Cases in Headers and is a
  205. multi-paradigm automated test framework for C++ and Objective-C.")
  206. (license license:boost1.0)))
  207. (define-public catch-framework2
  208. (package
  209. (name "catch2")
  210. (version "1.12.2")
  211. (home-page "https://github.com/catchorg/Catch2")
  212. (source (origin
  213. (method git-fetch)
  214. (uri (git-reference
  215. (url "https://github.com/catchorg/Catch2")
  216. (commit (string-append "v" version))))
  217. (file-name (git-file-name name version))
  218. (sha256
  219. (base32
  220. "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
  221. (build-system cmake-build-system)
  222. (synopsis "Automated test framework for C++ and Objective-C")
  223. (description "Catch2 stands for C++ Automated Test Cases in Headers and is
  224. a multi-paradigm automated test framework for C++ and Objective-C.")
  225. (license license:boost1.0)))
  226. (define-public cmdtest
  227. (package
  228. (name "cmdtest")
  229. (version "0.32")
  230. (source (origin
  231. (method url-fetch)
  232. (uri (string-append "http://git.liw.fi/cmdtest/snapshot/"
  233. name "-" version ".tar.gz"))
  234. (sha256
  235. (base32
  236. "1jmfiyrrqmpvwdb273bkb8hjaf4rwx9njblx29pmr7giyahskwi5"))))
  237. (build-system python-build-system)
  238. (arguments
  239. `(#:python ,python-2
  240. #:phases
  241. (modify-phases %standard-phases
  242. ;; check phase needs to be run before the build phase. If not, the
  243. ;; coverage test runner looks for tests for the built source files,
  244. ;; and fails.
  245. (delete 'check)
  246. (add-before 'build 'check
  247. (lambda _
  248. (substitute* "yarn"
  249. (("/bin/sh") (which "sh")))
  250. ;; yarn uses python2-ttystatus to print messages.
  251. ;; python2-ttystatus requires /dev/tty which is not present in
  252. ;; the build environment. Hence assuming-failure test fails.
  253. (delete-file "yarn.tests/assuming-failure.script")
  254. (delete-file "yarn.tests/assuming-failure.stdout")
  255. (invoke "python" "setup.py" "check"))))))
  256. (native-inputs
  257. `(("python2-coverage-test-runner" ,python2-coverage-test-runner)))
  258. (propagated-inputs
  259. `(("python2-cliapp" ,python2-cliapp)
  260. ("python2-markdown" ,python2-markdown)
  261. ("python2-ttystatus" ,python2-ttystatus)))
  262. (home-page "https://liw.fi/cmdtest/")
  263. (synopsis "Black box Unix program tester")
  264. (description
  265. "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
  266. given a command line and input files, and the expected output, and it verifies
  267. that the command line produces the expected output. If not, it reports a
  268. problem, and shows the differences.")
  269. (license license:gpl3+)))
  270. (define-public cmocka
  271. (package
  272. (name "cmocka")
  273. (version "1.1.3")
  274. (source (origin
  275. (method url-fetch)
  276. (uri (string-append "https://cmocka.org/files/"
  277. (version-major+minor version) "/cmocka-"
  278. version ".tar.xz"))
  279. (sha256
  280. (base32
  281. "1bxzzafjlwzgldcb07hjnlnqvh88wh21r2kw7z8f704w5bvvrsj3"))))
  282. (build-system cmake-build-system)
  283. (arguments
  284. `(#:tests? #f)) ; no test target
  285. (home-page "https://cmocka.org/")
  286. (synopsis "Unit testing framework for C")
  287. (description "Cmocka is a unit testing framework for C with support for
  288. mock objects. It only requires the standard C library, and works with
  289. different compilers. Cmocka supports several different message output formats
  290. like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
  291. format.")
  292. (license license:asl2.0)))
  293. (define-public cppcheck
  294. (package
  295. (name "cppcheck")
  296. (version "1.87")
  297. (source (origin
  298. (method git-fetch)
  299. (uri (git-reference
  300. (url "https://github.com/danmar/cppcheck")
  301. (commit version)))
  302. (file-name (git-file-name name version))
  303. (sha256
  304. (base32 "1xiy54rz99nzbpwj35jiyssd2nc6k5k0lw5ml6nh2qnmbfkl8swl"))))
  305. (build-system cmake-build-system)
  306. (arguments
  307. '(#:configure-flags '("-DBUILD_TESTS=ON")))
  308. (home-page "http://cppcheck.sourceforge.net")
  309. (synopsis "Static C/C++ code analyzer")
  310. (description "Cppcheck is a static code analyzer for C and C++. Unlike
  311. C/C++ compilers and many other analysis tools it does not detect syntax errors
  312. in the code. Cppcheck primarily detects the types of bugs that the compilers
  313. normally do not detect. The goal is to detect only real errors in the code
  314. (i.e. have zero false positives).")
  315. (license license:gpl3+)))
  316. (define-public cxxtest
  317. (package
  318. (name "cxxtest")
  319. (version "4.4")
  320. (source (origin
  321. (method url-fetch)
  322. (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
  323. version "/cxxtest-" version ".tar.gz"))
  324. (sha256
  325. (base32
  326. "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
  327. (build-system python-build-system)
  328. (arguments
  329. '(#:phases
  330. (modify-phases %standard-phases
  331. (add-after 'unpack 'chdir-to-source
  332. (lambda _
  333. (chdir "python")
  334. #t))
  335. (add-after 'install 'install-headers
  336. (lambda* (#:key outputs #:allow-other-keys)
  337. (let* ((out (assoc-ref outputs "out"))
  338. (include-dir (string-append out "/include/cxxtest")))
  339. (for-each (lambda (header-file)
  340. (install-file header-file include-dir))
  341. (find-files "../cxxtest"))
  342. #t)))
  343. (add-after 'install 'install-doc
  344. (lambda* (#:key outputs #:allow-other-keys)
  345. (let* ((out (assoc-ref outputs "out"))
  346. (doc-dir (string-append out "/share/doc/cxxtest")))
  347. (install-file "../README" doc-dir)
  348. (install-file "../doc/guide.txt" doc-dir)
  349. (copy-recursively "../sample" (string-append doc-dir "/sample"))
  350. #t))))))
  351. (propagated-inputs
  352. `(("python-ply" ,python-ply)))
  353. (home-page "https://cxxtest.com/")
  354. (synopsis "Unit testing framework for C++")
  355. (description "CxxTest is a unit testing framework for C++ that is similar
  356. in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
  357. a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
  358. and it supports a very flexible form of test discovery.")
  359. (license license:lgpl3+)))
  360. (define-public go-gopkg.in-check.v1
  361. (let ((commit "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec")
  362. (revision "0"))
  363. (package
  364. (name "go-gopkg.in-check.v1")
  365. (version (git-version "0.0.0" revision commit))
  366. (source (origin
  367. (method git-fetch)
  368. (uri (git-reference
  369. (url "https://github.com/go-check/check.git")
  370. (commit commit)))
  371. (file-name (git-file-name name version))
  372. (sha256
  373. (base32
  374. "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"))))
  375. (build-system go-build-system)
  376. (arguments
  377. '(#:import-path "gopkg.in/check.v1"))
  378. (synopsis "Rich testing extension for Go's testing package")
  379. (description
  380. "@code{check} is a rich testing extension for Go's testing package.")
  381. (home-page "https://github.com/go-check/check")
  382. (license license:bsd-2))))
  383. (define-public go-github.com-smartystreets-gunit
  384. (package
  385. (name "go-github.com-smartystreets-gunit")
  386. (version "1.0.0")
  387. (source (origin
  388. (method git-fetch)
  389. (uri (git-reference
  390. (url "https://github.com/smartystreets/gunit")
  391. (commit version)))
  392. (file-name (git-file-name name version))
  393. (sha256
  394. (base32
  395. "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
  396. (build-system go-build-system)
  397. (arguments
  398. '(;; TODO: This package depends on go-github.com-smartystreets-assertions
  399. ;; for running the tests, but go-github.com-smartystreets-assertions
  400. ;; depends on this package, so break this loop by not running the tests
  401. ;; for this package.
  402. #:tests? #f
  403. #:import-path "github.com/smartystreets/gunit"))
  404. (synopsis "Testing tool for Go, in the style of xUnit")
  405. (description
  406. "@code{gunit} allows the test author to use a struct as the scope for a
  407. group of related test cases, in the style of xUnit fixtures. This makes
  408. extraction of setup/teardown behavior (as well as invoking the system under
  409. test) much simpler.")
  410. (home-page "https://github.com/smartystreets/gunit")
  411. (license license:expat)))
  412. (define-public go-github.com-smartystreets-assertions
  413. (package
  414. (name "go-github.com-smartystreets-assertions")
  415. (version "1.8.1")
  416. (source (origin
  417. (method git-fetch)
  418. (uri (git-reference
  419. (url "https://github.com/smartystreets/assertions")
  420. (commit version)))
  421. (file-name (git-file-name name version))
  422. (sha256
  423. (base32
  424. "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
  425. (build-system go-build-system)
  426. (arguments
  427. '(#:import-path "github.com/smartystreets/assertions"))
  428. (native-inputs
  429. `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
  430. (synopsis "Assertions for testing with Go")
  431. (description
  432. "The @code{assertions} package provides convinient assertion functions
  433. for writing tests in Go.")
  434. (home-page "https://github.com/smartystreets/assertions")
  435. (license license:expat)))
  436. (define-public go-github.com-smartystreets-goconvey
  437. (package
  438. (name "go-github.com-smartystreets-goconvey")
  439. (version "1.6.3")
  440. (source (origin
  441. (method git-fetch)
  442. (uri (git-reference
  443. (url "https://github.com/smartystreets/goconvey")
  444. (commit version)))
  445. (file-name (git-file-name name version))
  446. (sha256
  447. (base32
  448. "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
  449. (build-system go-build-system)
  450. (arguments
  451. '(#:import-path "github.com/smartystreets/goconvey"))
  452. (propagated-inputs
  453. `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
  454. ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
  455. (synopsis "Go testing tool with both a web and terminal user interface")
  456. (description
  457. "GoConvey is a testing tool for Go. It integrates with go test, can show
  458. test coverage and has a web user interface that will refresh automatically.")
  459. (home-page "https://github.com/smartystreets/goconvey")
  460. (license license:expat)))
  461. ;; XXX When updating, check whether ZNC's GOOGLETEST-SOURCES can be
  462. ;; switched back to simply using (PACKAGE-SOURCE ...).
  463. (define-public googletest
  464. (package
  465. (name "googletest")
  466. (version "1.8.0")
  467. (source
  468. (origin
  469. (method url-fetch)
  470. (uri (string-append "https://github.com/google/googletest/archive/"
  471. "release-" version ".tar.gz"))
  472. (file-name (string-append name "-" version ".tar.gz"))
  473. (sha256
  474. (base32
  475. "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
  476. (build-system cmake-build-system)
  477. (arguments
  478. `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
  479. (native-inputs
  480. `(("python-2" ,python-2)))
  481. (home-page "https://github.com/google/googletest/")
  482. (synopsis "Test discovery and XUnit test framework")
  483. (description "Google Test features an XUnit test framework, automated test
  484. discovery, death tests, assertions, parameterized tests and XML test report
  485. generation.")
  486. (license license:bsd-3)))
  487. (define-public cpputest
  488. (package
  489. (name "cpputest")
  490. (version "3.8")
  491. (source
  492. (origin
  493. (method url-fetch)
  494. (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
  495. version "/cpputest-" version ".tar.gz"))
  496. (sha256
  497. (base32
  498. "0mk48xd3klyqi7wf3f4wn4zqxxzmvrhhl32r25jzrixzl72wq7f8"))))
  499. (build-system gnu-build-system)
  500. (native-inputs
  501. `(("googletest" ,googletest)))
  502. (home-page "https://cpputest.github.io/")
  503. (synopsis "Unit testing and mocking framework for C/C++")
  504. (description
  505. "CppUTest is a C/C++ based unit xUnit test framework. It is written in
  506. C++ but is used in C and C++ projects and frequently used in embedded systems
  507. but it works for any C/C++ project.")
  508. (license license:bsd-3)))
  509. (define-public python-parameterized
  510. (package
  511. (name "python-parameterized")
  512. (version "0.6.1")
  513. (source
  514. (origin
  515. (method url-fetch)
  516. (uri (pypi-uri "parameterized" version))
  517. (sha256
  518. (base32
  519. "1qj1939shm48d9ql6fm1nrdy4p7sdyj8clz1szh5swwpf1qqxxfa"))))
  520. (build-system python-build-system)
  521. (arguments '(#:tests? #f)) ; there are no tests
  522. (home-page "https://github.com/wolever/parameterized")
  523. (synopsis "Parameterized testing with any Python test framework")
  524. (description
  525. "Parameterized is a Python library that aims to fix parameterized testing
  526. for every Python test framework. It supports nose, py.test, and unittest.")
  527. (license license:bsd-2)))
  528. (define-public python2-parameterized
  529. (package-with-python2 python-parameterized))
  530. (define-public python-mock
  531. (package
  532. (name "python-mock")
  533. (version "2.0.0")
  534. (source
  535. (origin
  536. (method url-fetch)
  537. (uri (pypi-uri "mock" version))
  538. (sha256
  539. (base32
  540. "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
  541. (propagated-inputs
  542. `(("python-pbr" ,python-pbr-minimal)
  543. ("python-six" ,python-six)))
  544. (build-system python-build-system)
  545. (native-inputs
  546. `(("python-unittest2" ,python-unittest2)))
  547. (arguments
  548. `(#:phases
  549. (modify-phases %standard-phases
  550. (replace 'check
  551. (lambda _
  552. (zero? (system* "unit2")))))))
  553. (home-page "https://github.com/testing-cabal/mock")
  554. (synopsis "Python mocking and patching library for testing")
  555. (description
  556. "Mock is a library for testing in Python. It allows you to replace parts
  557. of your system under test with mock objects and make assertions about how they
  558. have been used.")
  559. (properties `((python2-variant . ,(delay python2-mock))))
  560. (license license:expat)))
  561. (define-public python2-mock
  562. (let ((base (package-with-python2
  563. (strip-python2-variant python-mock))))
  564. (package (inherit base)
  565. (propagated-inputs
  566. `(("python2-functools32" ,python2-functools32)
  567. ("python2-funcsigs" ,python2-funcsigs)
  568. ,@(package-propagated-inputs base))))))
  569. (define-public python-nose
  570. (package
  571. (name "python-nose")
  572. (version "1.3.7")
  573. (source
  574. (origin
  575. (method url-fetch)
  576. (uri (pypi-uri "nose" version))
  577. (sha256
  578. (base32
  579. "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
  580. (build-system python-build-system)
  581. (arguments
  582. '(#:tests? #f)) ; FIXME: test suite fails
  583. (home-page "http://readthedocs.org/docs/nose/")
  584. (synopsis "Python testing library")
  585. (description
  586. "Nose extends the unittest library to make testing easier.")
  587. (license license:lgpl2.0+)))
  588. (define-public python2-nose
  589. (package-with-python2 python-nose))
  590. (define-public python-nose2
  591. (package
  592. (name "python-nose2")
  593. (version "0.6.5")
  594. (source
  595. (origin
  596. (method url-fetch)
  597. (uri (pypi-uri "nose2" version))
  598. (sha256
  599. (base32
  600. "1x4zjq1zlyrh8b9ba0cmafd3w94pxhid408kibyjd3s6h1lap6s7"))))
  601. (build-system python-build-system)
  602. (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
  603. (propagated-inputs
  604. `(("python-cov-core" ,python-cov-core)
  605. ("python-pytest-cov" ,python-pytest-cov)
  606. ("python-six" ,python-six)))
  607. (home-page "https://github.com/nose-devs/nose2")
  608. (synopsis "Next generation of nicer testing for Python")
  609. (description
  610. "Nose2 is the next generation of nicer testing for Python, based on the
  611. plugins branch of unittest2. Nose2 aims to improve on nose by providing a
  612. better plugin api, being easier for users to configure, and simplifying internal
  613. interfaces and processes.")
  614. (license license:bsd-2)))
  615. (define-public python2-nose2
  616. (package-with-python2 python-nose2))
  617. (define-public python-unittest2
  618. (package
  619. (name "python-unittest2")
  620. (version "1.1.0")
  621. (source
  622. (origin
  623. (method url-fetch)
  624. (uri (pypi-uri "unittest2" version))
  625. (patches
  626. (search-patches "python-unittest2-python3-compat.patch"
  627. "python-unittest2-remove-argparse.patch"))
  628. (sha256
  629. (base32
  630. "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
  631. (build-system python-build-system)
  632. (arguments
  633. '(#:phases
  634. (modify-phases %standard-phases
  635. (replace 'check
  636. (lambda _
  637. (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
  638. (propagated-inputs
  639. `(("python-six" ,python-six)
  640. ("python-traceback2" ,python-traceback2)))
  641. (home-page "http://pypi.python.org/pypi/unittest2")
  642. (synopsis "Python unit testing library")
  643. (description
  644. "Unittest2 is a replacement for the unittest module in the Python
  645. standard library.")
  646. (license license:psfl)))
  647. (define-public python2-unittest2
  648. (package-with-python2 python-unittest2))
  649. (define-public python-pytest
  650. (package
  651. (name "python-pytest")
  652. (version "3.8.0")
  653. (source
  654. (origin
  655. (method url-fetch)
  656. (uri (pypi-uri "pytest" version))
  657. (sha256
  658. (base32
  659. "17grcfvd6ggvvqmprwv5y8g319nayam70hr43ssjwj40ws27z858"))))
  660. (build-system python-build-system)
  661. (arguments
  662. `(#:phases
  663. (modify-phases %standard-phases
  664. (add-before 'check 'disable-invalid-tests
  665. (lambda _
  666. ;; Some tests involves the /usr directory, and fails.
  667. (substitute* "testing/test_argcomplete.py"
  668. (("def test_remove_dir_prefix\\(self\\):")
  669. "@pytest.mark.xfail\n def test_remove_dir_prefix(self):"))
  670. (substitute* "testing/test_argcomplete.py"
  671. (("def test_remove_dir_prefix" line)
  672. (string-append "@pytest.mark.skip"
  673. "(reason=\"Assumes that /usr exists.\")\n "
  674. line)))
  675. #t))
  676. (replace 'check (lambda _ (invoke "pytest" "-vv"))))))
  677. (propagated-inputs
  678. `(("python-atomicwrites" ,python-atomicwrites)
  679. ("python-attrs" ,python-attrs-bootstrap)
  680. ("python-more-itertools" ,python-more-itertools)
  681. ("python-pluggy" ,python-pluggy)
  682. ("python-py" ,python-py)
  683. ("python-six" ,python-six-bootstrap)))
  684. (native-inputs
  685. `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
  686. ("bash" ,bash)
  687. ("python-hypothesis" ,python-hypothesis)
  688. ("python-nose" ,python-nose)
  689. ("python-mock" ,python-mock)
  690. ("python-pytest" ,python-pytest-bootstrap)
  691. ("python-setuptools-scm" ,python-setuptools-scm)))
  692. (home-page "https://docs.pytest.org/en/latest/")
  693. (synopsis "Python testing library")
  694. (description
  695. "Pytest is a testing tool that provides auto-discovery of test modules
  696. and functions, detailed info on failing assert statements, modular fixtures,
  697. and many external plugins.")
  698. (license license:expat)
  699. (properties `((python2-variant . ,(delay python2-pytest))))))
  700. (define-public python2-pytest
  701. (let ((pytest (package-with-python2
  702. (strip-python2-variant python-pytest))))
  703. (package
  704. (inherit pytest)
  705. (propagated-inputs
  706. `(("python2-funcsigs" ,python2-funcsigs)
  707. ("python2-pathlib2" ,python2-pathlib2)
  708. ,@(package-propagated-inputs pytest))))))
  709. (define-public python-pytest-bootstrap
  710. (package
  711. (inherit (strip-python2-variant python-pytest))
  712. (name "python-pytest-bootstrap")
  713. (native-inputs `(("python-setuptools-scm" ,python-setuptools-scm)))
  714. (arguments `(#:tests? #f))
  715. (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
  716. (define-public python2-pytest-bootstrap
  717. (let ((pytest (package-with-python2
  718. (strip-python2-variant python-pytest-bootstrap))))
  719. (package (inherit pytest)
  720. (propagated-inputs
  721. `(("python2-funcsigs" ,python2-funcsigs-bootstrap)
  722. ("python2-pathlib2" ,python2-pathlib2-bootstrap)
  723. ,@(package-propagated-inputs pytest))))))
  724. (define-public python-pytest-cov
  725. (package
  726. (name "python-pytest-cov")
  727. (version "2.6.1")
  728. (source
  729. (origin
  730. (method url-fetch)
  731. (uri (pypi-uri "pytest-cov" version))
  732. (sha256
  733. (base32 "0cyxbbghx2l4p60w10k00j1j74q1ngfiffr0pxn73ababjr69dha"))))
  734. (build-system python-build-system)
  735. (arguments
  736. `(#:phases
  737. (modify-phases %standard-phases
  738. (replace 'check
  739. (lambda _
  740. ;; Options taken from tox.ini.
  741. ;; TODO: make "--restructuredtext" tests pass. They currently fail
  742. ;; with "Duplicate implicit target name".
  743. (invoke "python" "./setup.py" "check"
  744. "--strict" "--metadata"))))))
  745. (propagated-inputs
  746. `(("python-coverage" ,python-coverage)
  747. ("python-pytest" ,python-pytest)))
  748. (home-page "https://github.com/pytest-dev/pytest-cov")
  749. (synopsis "Pytest plugin for measuring coverage")
  750. (description
  751. "Pytest-cov produces coverage reports. It supports centralised testing and
  752. distributed testing in both @code{load} and @code{each} modes. It also
  753. supports coverage of subprocesses.")
  754. (license license:expat)))
  755. (define-public python2-pytest-cov
  756. (package-with-python2 python-pytest-cov))
  757. (define-public python-pytest-runner
  758. (package
  759. (name "python-pytest-runner")
  760. (version "4.2")
  761. (source
  762. (origin
  763. (method url-fetch)
  764. (uri (pypi-uri "pytest-runner" version))
  765. (sha256
  766. (base32
  767. "1gkpyphawxz38ni1gdq1fmwyqcg02m7ypzqvv46z06crwdxi2gyj"))))
  768. (build-system python-build-system)
  769. (native-inputs
  770. `(("python-pytest" ,python-pytest-bootstrap)
  771. ("python-setuptools-scm" ,python-setuptools-scm)))
  772. (home-page "https://github.com/pytest-dev/pytest-runner")
  773. (synopsis "Invoke py.test as a distutils command")
  774. (description
  775. "This package provides a @command{pytest-runner} command that
  776. @file{setup.py} files can use to run tests.")
  777. (license license:expat)))
  778. (define-public python2-pytest-runner
  779. (package-with-python2 python-pytest-runner))
  780. (define-public python-pytest-mock
  781. (package
  782. (name "python-pytest-mock")
  783. (version "1.10.1")
  784. (source
  785. (origin
  786. (method url-fetch)
  787. (uri (pypi-uri "pytest-mock" version))
  788. (sha256
  789. (base32
  790. "1i5mg3ff1qk0wqfcxfz60hwy3q5dskdp36i10ckigkzffg8hc3ad"))))
  791. (build-system python-build-system)
  792. (native-inputs
  793. `(("python-setuptools-scm" ,python-setuptools-scm)))
  794. (propagated-inputs
  795. `(("python-pytest" ,python-pytest)))
  796. (home-page "https://github.com/pytest-dev/pytest-mock/")
  797. (synopsis "Thin-wrapper around the mock package for easier use with py.test")
  798. (description
  799. "This plugin installs a @code{mocker} fixture which is a thin-wrapper
  800. around the patching API provided by the @code{mock} package, but with the
  801. benefit of not having to worry about undoing patches at the end of a test.
  802. The mocker fixture has the same API as @code{mock.patch}, supporting the
  803. same arguments.")
  804. (properties `((python2-variant . ,(delay python2-pytest-mock))))
  805. (license license:expat)))
  806. (define-public python2-pytest-mock
  807. (let ((base (package-with-python2
  808. (strip-python2-variant python-pytest-mock))))
  809. (package (inherit base)
  810. (propagated-inputs
  811. `(("python2-mock" ,python2-mock)
  812. ,@(package-propagated-inputs base))))))
  813. (define-public python-pytest-xdist
  814. (package
  815. (name "python-pytest-xdist")
  816. (version "1.25.0")
  817. (source
  818. (origin
  819. (method url-fetch)
  820. (uri (pypi-uri "pytest-xdist" version))
  821. (sha256
  822. (base32
  823. "1d812apvcmshh2l8f38spqwb3bpp0x43yy7lyfpxxzc99h4r7y4n"))
  824. (modules '((guix build utils)))
  825. (snippet
  826. '(begin
  827. ;; Remove pre-compiled .pyc files from source.
  828. (for-each delete-file-recursively
  829. (find-files "." "__pycache__" #:directories? #t))
  830. (for-each delete-file (find-files "." "\\.pyc$"))
  831. #t))))
  832. (build-system python-build-system)
  833. (arguments
  834. '(#:tests? #f)) ;FIXME: Some tests are failing.
  835. ;; #:phases
  836. ;; (modify-phases %standard-phases
  837. ;; (delete 'check)
  838. ;; (add-after 'install 'check
  839. ;; (lambda* (#:key inputs outputs #:allow-other-keys)
  840. ;; (add-installed-pythonpath inputs outputs)
  841. ;; (zero? (system* "py.test" "-v")))))
  842. (native-inputs
  843. `(("python-setuptools-scm" ,python-setuptools-scm)))
  844. (propagated-inputs
  845. `(("python-execnet" ,python-execnet)
  846. ("python-pytest" ,python-pytest)
  847. ("python-py" ,python-py)))
  848. (home-page
  849. "https://github.com/pytest-dev/pytest-xdist")
  850. (synopsis
  851. "Plugin for py.test with distributed testing and loop-on-failing modes")
  852. (description
  853. "The pytest-xdist plugin extends py.test with some unique test execution
  854. modes: parallelization, running tests in boxed subprocesses, the ability
  855. to run tests repeatedly when failed, and the ability to run tests on multiple
  856. Python interpreters or platforms. It uses rsync to copy the existing
  857. program code to a remote location, executes there, and then syncs the
  858. result back.")
  859. (license license:expat)))
  860. (define-public python2-pytest-xdist
  861. (package-with-python2 python-pytest-xdist))
  862. (define-public python-scripttest
  863. (package
  864. (name "python-scripttest")
  865. (version "1.3")
  866. (source
  867. (origin
  868. (method url-fetch)
  869. (uri (pypi-uri "scripttest" version))
  870. (sha256
  871. (base32
  872. "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
  873. (build-system python-build-system)
  874. (native-inputs
  875. `(("python-pytest" ,python-pytest)))
  876. (home-page "http://pythonpaste.org/scripttest/")
  877. (synopsis "Python library to test command-line scripts")
  878. (description "Scripttest is a Python helper library for testing
  879. interactive command-line applications. With it you can run a script in a
  880. subprocess and see the output as well as any file modifications.")
  881. (license license:expat)))
  882. (define-public python2-scripttest
  883. (package-with-python2 python-scripttest))
  884. (define-public python-testtools-bootstrap
  885. (package
  886. (name "python-testtools-bootstrap")
  887. (version "2.3.0")
  888. (source
  889. (origin
  890. (method url-fetch)
  891. (uri (pypi-uri "testtools" version))
  892. (sha256
  893. (base32
  894. "0n8519lk8aaa91vymz842831181wf7fss98hyllhygi3z1nfq9sq"))
  895. (patches (search-patches "python-testtools.patch"))))
  896. (build-system python-build-system)
  897. (arguments '(#:tests? #f))
  898. (propagated-inputs
  899. `(("python-extras" ,python-extras)
  900. ("python-fixtures" ,python-fixtures-bootstrap)
  901. ("python-mimeparse" ,python-mimeparse)
  902. ("python-pbr" ,python-pbr-minimal)
  903. ("python-six" ,python-six)
  904. ("python-traceback2" ,python-traceback2)
  905. ("python-unittest2" ,python-unittest2)))
  906. (home-page "https://github.com/testing-cabal/testtools")
  907. (synopsis
  908. "Extensions to the Python standard library unit testing framework")
  909. (description
  910. "This package is only for bootstrapping. Do not use this.")
  911. (license license:psfl)))
  912. (define-public python2-testtools-bootstrap
  913. (package-with-python2 python-testtools-bootstrap))
  914. (define-public python-testtools
  915. (package
  916. (inherit python-testtools-bootstrap)
  917. (name "python-testtools")
  918. (arguments
  919. `(#:phases (modify-phases %standard-phases
  920. (replace 'check
  921. (lambda _
  922. (invoke "python" "-m" "testtools.run"
  923. "testtools.tests.test_suite"))))))
  924. (propagated-inputs
  925. `(("python-extras" ,python-extras)
  926. ("python-fixtures" ,python-fixtures)
  927. ("python-mimeparse" ,python-mimeparse)
  928. ("python-pbr" ,python-pbr)
  929. ("python-six" ,python-six)
  930. ("python-traceback2" ,python-traceback2)
  931. ("python-unittest2" ,python-unittest2)))
  932. (native-inputs
  933. `(("python-testscenarios" ,python-testscenarios-bootstrap)))
  934. (description
  935. "Testtools extends the Python standard library unit testing framework to
  936. provide matchers, more debugging information, and cross-Python
  937. compatibility.")))
  938. (define-public python2-testtools
  939. (package-with-python2 python-testtools))
  940. (define-public python-testscenarios-bootstrap
  941. (package
  942. (name "python-testscenarios-bootstrap")
  943. (version "0.5.0")
  944. (source
  945. (origin
  946. (method url-fetch)
  947. (uri (pypi-uri "testscenarios" version))
  948. (sha256
  949. (base32
  950. "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
  951. (build-system python-build-system)
  952. (arguments
  953. `(#:phases (modify-phases %standard-phases
  954. (replace 'check
  955. (lambda _
  956. (invoke "python" "-m" "testtools.run"
  957. "testscenarios.test_suite"))))))
  958. (propagated-inputs
  959. `(("python-pbr" ,python-pbr-minimal)
  960. ("python-testtools" ,python-testtools-bootstrap)))
  961. (home-page "https://launchpad.net/testscenarios")
  962. (synopsis "Pyunit extension for dependency injection")
  963. (description
  964. "This package is only for bootstrapping. Don't use this.")
  965. (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
  966. (define-public python2-testscenarios-bootstrap
  967. (package-with-python2 python-testscenarios-bootstrap))
  968. (define-public python-testscenarios
  969. (package
  970. (inherit python-testscenarios-bootstrap)
  971. (name "python-testscenarios")
  972. (propagated-inputs
  973. `(("python-pbr" ,python-pbr)
  974. ("python-testtools" ,python-testtools)))
  975. (description
  976. "Testscenarios provides clean dependency injection for Python unittest
  977. style tests.")))
  978. (define-public python2-testscenarios
  979. (package-with-python2 python-testscenarios))
  980. ;; Testresources requires python-pbr at runtime, but pbr needs it for its
  981. ;; own tests. Hence this bootstrap variant.
  982. (define-public python-testresources-bootstrap
  983. (package
  984. (name "python-testresources-bootstrap")
  985. (version "2.0.1")
  986. (source (origin
  987. (method url-fetch)
  988. (uri (pypi-uri "testresources" version))
  989. (sha256
  990. (base32
  991. "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
  992. (build-system python-build-system)
  993. (arguments '(#:tests? #f))
  994. (propagated-inputs
  995. `(("python-pbr" ,python-pbr-minimal)))
  996. (home-page "https://launchpad.net/testresources")
  997. (synopsis
  998. "Pyunit extension for managing test resources")
  999. (description
  1000. "This package is only here for bootstrapping purposes. Use the regular
  1001. testresources package instead.")
  1002. (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
  1003. (define-public python2-testresources-bootstrap
  1004. (package-with-python2 python-testresources-bootstrap))
  1005. (define-public python-testresources
  1006. (package
  1007. (inherit python-testresources-bootstrap)
  1008. (name "python-testresources")
  1009. (propagated-inputs
  1010. `(("python-pbr" ,python-pbr)))
  1011. (arguments '())
  1012. (native-inputs
  1013. `(("python-fixtures" ,python-fixtures)
  1014. ("python-testtols" ,python-testtools)))
  1015. (description
  1016. "Testresources is an extension to Python's unittest to allow declarative
  1017. use of resources by test cases.")))
  1018. (define-public python2-testresources
  1019. (package-with-python2 python-testresources))
  1020. (define-public python-subunit-bootstrap
  1021. (package
  1022. (name "python-subunit-bootstrap")
  1023. (version "1.3.0")
  1024. (source
  1025. (origin
  1026. (method url-fetch)
  1027. (uri (pypi-uri "python-subunit" version))
  1028. (sha256
  1029. (base32
  1030. "1fsw8rsn1s3nklx06mayrg5rn2zbky6wwjc5z07s7rf1wjzfs1wn"))))
  1031. (build-system python-build-system)
  1032. (propagated-inputs
  1033. `(("python-extras" ,python-extras)
  1034. ("python-testtools" ,python-testtools-bootstrap)))
  1035. (native-inputs
  1036. `(("python-fixtures" ,python-fixtures-bootstrap)
  1037. ("python-hypothesis" ,python-hypothesis)
  1038. ("python-testscenarios" ,python-testscenarios-bootstrap)))
  1039. (home-page "https://launchpad.net/subunit")
  1040. (synopsis "Python implementation of the subunit protocol")
  1041. (description
  1042. "This package is here for bootstrapping purposes only. Use the regular
  1043. python-subunit package instead.")
  1044. (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
  1045. (define-public python2-subunit-bootstrap
  1046. (package-with-python2 python-subunit-bootstrap))
  1047. (define-public python-subunit
  1048. (package
  1049. (inherit python-subunit-bootstrap)
  1050. (name "python-subunit")
  1051. (propagated-inputs
  1052. `(("python-extras" ,python-extras)
  1053. ("python-testtools" ,python-testtools)))
  1054. (native-inputs
  1055. `(("python-fixtures" ,python-fixtures)
  1056. ("python-hypothesis" ,python-hypothesis)
  1057. ("python-testscenarios" ,python-testscenarios)))
  1058. (description
  1059. "Python-subunit is a Python implementation of the subunit test streaming
  1060. protocol.")))
  1061. (define-public python2-subunit
  1062. (package-with-python2 python-subunit))
  1063. ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
  1064. ;; own tests. Hence this bootstrap variant.
  1065. (define-public python-fixtures-bootstrap
  1066. (package
  1067. (name "python-fixtures-bootstrap")
  1068. (version "3.0.0")
  1069. (source (origin
  1070. (method url-fetch)
  1071. (uri (pypi-uri "fixtures" version))
  1072. (sha256
  1073. (base32
  1074. "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))))
  1075. (build-system python-build-system)
  1076. (arguments `(#:tests? #f))
  1077. (propagated-inputs
  1078. `(("python-pbr-minimal" ,python-pbr-minimal)
  1079. ("python-six" ,python-six)))
  1080. (home-page "https://launchpad.net/python-fixtures")
  1081. (synopsis "Python test fixture library")
  1082. (description
  1083. "This package is only used for bootstrapping. Use the regular
  1084. python-fixtures package instead.")
  1085. (license (list license:bsd-3 license:asl2.0)))) ; at user's option
  1086. (define-public python2-fixtures-bootstrap
  1087. (package-with-python2 python-fixtures-bootstrap))
  1088. (define-public python-fixtures
  1089. (package
  1090. (inherit python-fixtures-bootstrap)
  1091. (name "python-fixtures")
  1092. (arguments
  1093. '(#:phases
  1094. (modify-phases %standard-phases
  1095. (replace 'check
  1096. (lambda _
  1097. (invoke "python" "-m" "testtools.run"
  1098. "fixtures.test_suite"))))))
  1099. (propagated-inputs
  1100. ;; Fixtures uses pbr at runtime to check versions, etc.
  1101. `(("python-pbr" ,python-pbr)
  1102. ("python-six" ,python-six)))
  1103. (native-inputs
  1104. `(("python-mock" ,python-mock)
  1105. ("python-testtools" ,python-testtools-bootstrap)))
  1106. (description
  1107. "Fixtures provides a way to create reusable state, useful when writing
  1108. Python tests.")))
  1109. (define-public python2-fixtures
  1110. (package-with-python2 python-fixtures))
  1111. (define-public python-testrepository-bootstrap
  1112. (package
  1113. (name "python-testrepository-bootstrap")
  1114. (version "0.0.20")
  1115. (source
  1116. (origin
  1117. (method url-fetch)
  1118. (uri (pypi-uri "testrepository" version))
  1119. (sha256
  1120. (base32
  1121. "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
  1122. (build-system python-build-system)
  1123. (arguments '(#:tests? #f))
  1124. (propagated-inputs
  1125. `(("python-fixtures" ,python-fixtures-bootstrap)
  1126. ("python-subunit" ,python-subunit-bootstrap)
  1127. ("python-testtools" ,python-testtools-bootstrap)))
  1128. (native-inputs
  1129. `(("python-mimeparse" ,python-mimeparse)))
  1130. (home-page "https://launchpad.net/testrepository")
  1131. (synopsis "Database for Python test results")
  1132. (description
  1133. "Bootstrap package for python-testrepository. Don't use this.")
  1134. (license (list license:bsd-3 license:asl2.0)))) ; at user's option
  1135. (define-public python2-testrepository-bootstrap
  1136. (package-with-python2 python-testrepository-bootstrap))
  1137. (define-public python-testrepository
  1138. (package
  1139. (inherit python-testrepository-bootstrap)
  1140. (name "python-testrepository")
  1141. (arguments
  1142. ;; FIXME: Many tests are failing.
  1143. '(#:tests? #f))
  1144. (propagated-inputs
  1145. `(("python-fixtures" ,python-fixtures)
  1146. ("python-subunit" ,python-subunit)
  1147. ("python-testtools" ,python-testtools)))
  1148. (native-inputs
  1149. `(("python-mimeparse" ,python-mimeparse)))
  1150. (description "Testrepository provides a database of test results which can
  1151. be used as part of a developer's workflow to check things such as what tests
  1152. have failed since the last commit or what tests are currently failing.")))
  1153. (define-public python2-testrepository
  1154. (package-with-python2 python-testrepository))
  1155. (define-public python-coverage
  1156. (package
  1157. (name "python-coverage")
  1158. (version "4.4.1")
  1159. (source
  1160. (origin
  1161. (method url-fetch)
  1162. (uri (pypi-uri "coverage" version))
  1163. (sha256
  1164. (base32
  1165. "097l4s3ssxm1vncsn0nw3a1pbzah28773q36c1ab9wz01r04973s"))))
  1166. (build-system python-build-system)
  1167. (arguments
  1168. ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
  1169. '(#:tests? #f))
  1170. (home-page "http://nedbatchelder.com/code/coverage")
  1171. (synopsis "Code coverage measurement for Python")
  1172. (description
  1173. "Coverage measures code coverage, typically during test execution. It
  1174. uses the code analysis tools and tracing hooks provided in the Python standard
  1175. library to determine which lines are executable, and which have been
  1176. executed.")
  1177. (license license:bsd-3)))
  1178. (define-public python2-coverage
  1179. (package-with-python2 python-coverage))
  1180. (define-public python-cov-core
  1181. (package
  1182. (name "python-cov-core")
  1183. (version "1.15.0")
  1184. (source
  1185. (origin
  1186. (method url-fetch)
  1187. (uri (pypi-uri "cov-core" version))
  1188. (sha256
  1189. (base32
  1190. "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
  1191. (build-system python-build-system)
  1192. (propagated-inputs
  1193. `(("python-coverage" ,python-coverage)))
  1194. (home-page "https://github.com/schlamar/cov-core")
  1195. (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
  1196. (description
  1197. "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
  1198. and @code{nose2-cov}. It is useful for developing coverage plugins for these
  1199. testing frameworks.")
  1200. (license license:expat)))
  1201. (define-public python2-cov-core
  1202. (package-with-python2 python-cov-core))
  1203. (define-public python-codecov
  1204. (package
  1205. (name "python-codecov")
  1206. (version "2.0.15")
  1207. (source
  1208. (origin
  1209. (method url-fetch)
  1210. (uri (pypi-uri "codecov" version))
  1211. (sha256
  1212. (base32
  1213. "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
  1214. (build-system python-build-system)
  1215. (native-inputs
  1216. `(("python-unittest2" ,python-unittest2)))
  1217. (propagated-inputs
  1218. `(("python-coverage" ,python-coverage)
  1219. ("python-requests" ,python-requests)))
  1220. (home-page "http://github.com/codecov/codecov-python")
  1221. (synopsis "Upload code coverage reports to @code{codecov.io}")
  1222. (description
  1223. "Codecov collects code coverage reports from code written in Python, Java,
  1224. C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
  1225. (license license:asl2.0)))
  1226. (define-public python-testpath
  1227. (package
  1228. (name "python-testpath")
  1229. (version "0.2")
  1230. (source
  1231. (origin
  1232. (method git-fetch)
  1233. (uri (git-reference
  1234. (url "https://github.com/jupyter/testpath")
  1235. (commit version)))
  1236. (file-name (git-file-name name version))
  1237. (sha256
  1238. (base32
  1239. "0r4iiizjql6ny1ln7ciw7rrbjadz1s9zrf2hl0xkgnh3ypd8936f"))))
  1240. (build-system python-build-system)
  1241. (arguments
  1242. `(#:tests? #f ; this package does not even have a setup.py
  1243. #:modules ((guix build python-build-system)
  1244. (guix build utils)
  1245. (srfi srfi-1))
  1246. #:imported-modules (,@%python-build-system-modules
  1247. (srfi srfi-1))
  1248. #:phases
  1249. (modify-phases %standard-phases
  1250. (delete 'install)
  1251. (replace 'build
  1252. (lambda* (#:key inputs outputs #:allow-other-keys)
  1253. (let* ((version (last
  1254. (string-split (assoc-ref inputs "python") #\-)))
  1255. (x.y (string-join (take (string-split version #\.) 2)
  1256. "."))
  1257. (dir (string-append
  1258. (assoc-ref outputs "out")
  1259. "/lib/python" x.y "/site-packages/testpath")))
  1260. (mkdir-p dir)
  1261. (copy-recursively "testpath" dir))
  1262. #t)))))
  1263. (home-page "https://github.com/takluyver/testpath")
  1264. (synopsis "Test utilities for code working with files and commands")
  1265. (description
  1266. "Testpath is a collection of utilities for Python code working with files
  1267. and commands. It contains functions to check things on the file system, and
  1268. tools for mocking system commands and recording calls to those.")
  1269. (license license:expat)))
  1270. (define-public python2-testpath
  1271. (package-with-python2 python-testpath))
  1272. (define-public python-testlib
  1273. (package
  1274. (name "python-testlib")
  1275. (version "0.6.5")
  1276. (source
  1277. (origin
  1278. (method url-fetch)
  1279. (uri (pypi-uri "testlib" version ".zip"))
  1280. (sha256
  1281. (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
  1282. (build-system python-build-system)
  1283. (native-inputs
  1284. `(("unzip" ,unzip))) ; for unpacking the source
  1285. (synopsis "Python micro test suite harness")
  1286. (description "A micro unittest suite harness for Python.")
  1287. (home-page "https://github.com/trentm/testlib")
  1288. (license license:expat)))
  1289. (define-public python2-testlib
  1290. (package-with-python2 python-testlib))
  1291. ;;; The software provided by this package was integrated into pytest 2.8.
  1292. (define-public python-pytest-cache
  1293. (package
  1294. (name "python-pytest-cache")
  1295. (version "1.0")
  1296. (source (origin
  1297. (method url-fetch)
  1298. (uri (pypi-uri "pytest-cache" version))
  1299. (sha256
  1300. (base32
  1301. "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
  1302. (build-system python-build-system)
  1303. (propagated-inputs
  1304. `(("python-apipkg" ,python-apipkg)
  1305. ("python-execnet" ,python-execnet)
  1306. ("python-py" ,python-py)
  1307. ("python-pytest" ,python-pytest)))
  1308. (synopsis "Py.test plugin with mechanisms for caching across test runs")
  1309. (description "The pytest-cache plugin provides tools to rerun failures from
  1310. the last py.test invocation.")
  1311. (home-page "https://bitbucket.org/hpk42/pytest-cache/")
  1312. (license license:expat)))
  1313. (define-public python2-pytest-cache
  1314. (package-with-python2 python-pytest-cache))
  1315. (define-public python-pytest-localserver
  1316. (package
  1317. (name "python-pytest-localserver")
  1318. (version "0.5.0")
  1319. (source (origin
  1320. (method url-fetch)
  1321. (uri (pypi-uri "pytest-localserver" version))
  1322. (sha256
  1323. (base32
  1324. "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
  1325. (build-system python-build-system)
  1326. (arguments
  1327. '(#:phases
  1328. (modify-phases %standard-phases
  1329. (replace 'check
  1330. (lambda _
  1331. (invoke "py.test" "-v"))))))
  1332. (native-inputs
  1333. `(("python-pytest" ,python-pytest)
  1334. ("python-requests" ,python-requests)
  1335. ("python-six" ,python-six)))
  1336. (propagated-inputs
  1337. `(("python-werkzeug" ,python-werkzeug)))
  1338. (synopsis "Py.test plugin to test server connections locally")
  1339. (description "Pytest-localserver is a plugin for the pytest testing
  1340. framework which enables you to test server connections locally.")
  1341. (home-page "https://pypi.python.org/pypi/pytest-localserver")
  1342. (license license:expat)))
  1343. (define-public python-pytest-xprocess
  1344. (package
  1345. (name "python-pytest-xprocess")
  1346. (version "0.9.1")
  1347. (source (origin
  1348. (method url-fetch)
  1349. (uri (pypi-uri "pytest-xprocess" version))
  1350. (sha256
  1351. (base32
  1352. "17zlql1xqw3ywcgwwbqmw633aly99lab12hm02asr8awvg5603pp"))))
  1353. (build-system python-build-system)
  1354. (propagated-inputs
  1355. `(("python-pytest" ,python-pytest)
  1356. ("python-pytest-cache" ,python-pytest-cache)
  1357. ("python-psutil" ,python-psutil)))
  1358. (synopsis "Pytest plugin to manage external processes across test runs")
  1359. (description "Pytest-xprocess is an experimental py.test plugin for managing
  1360. processes across test runs.")
  1361. (home-page "https://bitbucket.org/pytest-dev/pytest-xprocess")
  1362. (license license:expat)))
  1363. (define-public python-pytest-subtesthack
  1364. (package
  1365. (name "python-pytest-subtesthack")
  1366. (version "0.1.1")
  1367. (source (origin
  1368. (method url-fetch)
  1369. (uri (pypi-uri "pytest-subtesthack" version))
  1370. (sha256
  1371. (base32
  1372. "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
  1373. (build-system python-build-system)
  1374. (propagated-inputs
  1375. `(("python-pytest" ,python-pytest)))
  1376. (synopsis "Set-up and tear-down fixtures for unit tests")
  1377. (description "This plugin allows you to set up and tear down fixtures within
  1378. unit test functions that use @code{py.test}. This is useful for using
  1379. @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
  1380. function multiple times, without setting up or tearing down fixture state as is
  1381. normally the case.")
  1382. (home-page "https://github.com/untitaker/pytest-subtesthack/")
  1383. (license license:unlicense)))
  1384. (define-public python2-pytest-subtesthack
  1385. (package-with-python2 python-pytest-subtesthack))
  1386. (define-public python-pytest-sugar
  1387. (package
  1388. (name "python-pytest-sugar")
  1389. (version "0.9.2")
  1390. (source
  1391. (origin
  1392. (method url-fetch)
  1393. (uri (pypi-uri "pytest-sugar" version))
  1394. (sha256
  1395. (base32
  1396. "1asq7yc4g8bx2sn7yy974mhc9ywvaihasjab4inkirdwn9s7mn7w"))))
  1397. (build-system python-build-system)
  1398. (propagated-inputs
  1399. `(("python-packaging" ,python-packaging)
  1400. ("python-pytest" ,python-pytest)
  1401. ("python-termcolor" ,python-termcolor)))
  1402. (home-page "https://pivotfinland.com/pytest-sugar/")
  1403. (synopsis "Plugin for pytest that changes the default look and feel")
  1404. (description
  1405. "@code{pytest-sugar} is a plugin for py.test that changes the default
  1406. look and feel of py.test, using a progress bar and showing failures and errors
  1407. instantly.")
  1408. (license license:bsd-3)))
  1409. (define-public python-hypothesis
  1410. (package
  1411. (name "python-hypothesis")
  1412. (version "3.70.3")
  1413. (source (origin
  1414. (method url-fetch)
  1415. (uri (pypi-uri "hypothesis" version))
  1416. (sha256
  1417. (base32
  1418. "1rshs1japfmwgar98yrkq4hg4z2q76hlnq7w2n3lfbjnscn1jd9b"))))
  1419. (build-system python-build-system)
  1420. (native-inputs
  1421. `(;; FIXME: Change to python-flake8 in the next rebuild cycle.
  1422. ("python-flake8" ,python-flake8-3.5)
  1423. ("python-pytest" ,python-pytest-bootstrap)))
  1424. (propagated-inputs
  1425. `(("python-attrs" ,python-attrs-bootstrap)
  1426. ("python-coverage" ,python-coverage)))
  1427. (synopsis "Library for property based testing")
  1428. (description "Hypothesis is a library for testing your Python code against a
  1429. much larger range of examples than you would ever want to write by hand. It’s
  1430. based on the Haskell library, Quickcheck, and is designed to integrate
  1431. seamlessly into your existing Python unit testing work flow.")
  1432. (home-page "https://github.com/HypothesisWorks/hypothesis-python")
  1433. (license license:mpl2.0)
  1434. (properties `((python2-variant . ,(delay python2-hypothesis))))))
  1435. (define-public python2-hypothesis
  1436. (let ((hypothesis (package-with-python2
  1437. (strip-python2-variant python-hypothesis))))
  1438. (package (inherit hypothesis)
  1439. (propagated-inputs
  1440. `(("python2-enum34" ,python2-enum34)
  1441. ,@(package-propagated-inputs hypothesis))))))
  1442. (define-public python-lit
  1443. (package
  1444. (name "python-lit")
  1445. (version "0.5.1")
  1446. (source
  1447. (origin
  1448. (method url-fetch)
  1449. (uri (pypi-uri "lit" version))
  1450. (sha256
  1451. (base32
  1452. "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
  1453. (build-system python-build-system)
  1454. (arguments
  1455. `(#:phases
  1456. (modify-phases %standard-phases
  1457. (replace 'check
  1458. (lambda _
  1459. (invoke "python" "lit.py" "tests"))))))
  1460. (native-inputs
  1461. `(("llvm" ,llvm)))
  1462. (home-page "https://llvm.org/")
  1463. (synopsis "LLVM Software Testing Tool")
  1464. (description "@code{lit} is a portable tool for executing LLVM and Clang
  1465. style test suites, summarizing their results, and providing indication of
  1466. failures.")
  1467. (license license:ncsa)))
  1468. (define-public python2-lit
  1469. (package-with-python2 python-lit))
  1470. (define-public python-pytest-pep8
  1471. (package
  1472. (name "python-pytest-pep8")
  1473. (version "1.0.6")
  1474. (source (origin
  1475. (method url-fetch)
  1476. (uri (pypi-uri "pytest-pep8" version))
  1477. (sha256
  1478. (base32
  1479. "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
  1480. (build-system python-build-system)
  1481. (arguments
  1482. `(#:tests? #f)) ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
  1483. (native-inputs
  1484. `(("python-pytest" ,python-pytest)))
  1485. (propagated-inputs
  1486. `(("python-pep8" ,python-pep8)))
  1487. (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
  1488. (synopsis "Py.test plugin to check PEP8 requirements")
  1489. (description "Pytest plugin for checking PEP8 compliance.")
  1490. (license license:expat)))
  1491. (define-public python2-pytest-pep8
  1492. (package-with-python2 python-pytest-pep8))
  1493. (define-public python-pytest-flakes
  1494. (package
  1495. (name "python-pytest-flakes")
  1496. (version "1.0.1")
  1497. (source (origin
  1498. (method url-fetch)
  1499. (uri (pypi-uri "pytest-flakes" version))
  1500. (sha256
  1501. (base32
  1502. "0flag3n33kbhyjrhzmq990rvg4yb8hhhl0i48q9hw0ll89jp28lw"))))
  1503. (build-system python-build-system)
  1504. (arguments
  1505. `(#:phases
  1506. (modify-phases %standard-phases
  1507. (delete 'check)
  1508. (add-after 'install 'check
  1509. (lambda* (#:key outputs inputs #:allow-other-keys)
  1510. ;; It's easier to run tests after install.
  1511. ;; Make installed package available for running the tests
  1512. (add-installed-pythonpath inputs outputs)
  1513. (invoke "py.test" "-vv"))))))
  1514. (native-inputs
  1515. `(("python-coverage" ,python-coverage)
  1516. ("python-pytest" ,python-pytest)
  1517. ("python-pytest-cache" ,python-pytest-cache)
  1518. ("python-pytest-pep8" ,python-pytest-pep8)))
  1519. (propagated-inputs
  1520. `(("python-pyflakes" ,python-pyflakes)))
  1521. (home-page "https://github.com/fschulze/pytest-flakes")
  1522. (synopsis "Py.test plugin to check source code with pyflakes")
  1523. (description "Pytest plugin for checking Python source code with pyflakes.")
  1524. (license license:expat)))
  1525. (define-public python2-pytest-flakes
  1526. (package-with-python2 python-pytest-flakes))
  1527. (define-public python2-coverage-test-runner
  1528. (package
  1529. (name "python2-coverage-test-runner")
  1530. (version "1.15")
  1531. (source
  1532. (origin
  1533. (method url-fetch)
  1534. (uri (string-append
  1535. "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
  1536. "coverage-test-runner/snapshot/coverage-test-runner-"
  1537. version ".tar.gz"))
  1538. (sha256
  1539. (base32
  1540. "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
  1541. (build-system python-build-system)
  1542. (arguments
  1543. `(#:python ,python-2
  1544. #:phases
  1545. (modify-phases %standard-phases
  1546. (replace 'check
  1547. (lambda _
  1548. (invoke "./testrun"))))))
  1549. (propagated-inputs
  1550. `(("python2-coverage" ,python2-coverage)))
  1551. (home-page "https://liw.fi/coverage-test-runner/")
  1552. (synopsis "Python module for running unit tests")
  1553. (description "@code{CoverageTestRunner} is a python module for running
  1554. unit tests and failing them if the unit test module does not exercise all
  1555. statements in the module it tests.")
  1556. (license license:gpl3+)))
  1557. (define-public python-pylint
  1558. (package
  1559. (name "python-pylint")
  1560. (version "1.7.2")
  1561. (source
  1562. (origin
  1563. (method url-fetch)
  1564. (uri (string-append
  1565. "https://github.com/PyCQA/pylint/archive/pylint-"
  1566. version ".tar.gz"))
  1567. (sha256
  1568. (base32
  1569. "0mzn1czhf1mgr2wiqfihb274sja02h899b85kywdpivppa9nwrmp"))))
  1570. (build-system python-build-system)
  1571. (native-inputs
  1572. `(("python-pytest" ,python-pytest)
  1573. ("python-pytest-runner" ,python-pytest-runner)
  1574. ("python-tox" ,python-tox)))
  1575. (propagated-inputs
  1576. `(("python-astroid" ,python-astroid)
  1577. ("python-isort" ,python-isort)
  1578. ("python-mccabe" ,python-mccabe)
  1579. ("python-six" ,python-six)))
  1580. (arguments
  1581. `(#:phases
  1582. (modify-phases %standard-phases
  1583. (replace 'check
  1584. (lambda _
  1585. ;; Somehow, tests for python2-pylint
  1586. ;; fail if run from the build directory
  1587. (let ((work "/tmp/work"))
  1588. (mkdir-p work)
  1589. (setenv "PYTHONPATH"
  1590. (string-append (getenv "PYTHONPATH") ":" work))
  1591. (copy-recursively "." work)
  1592. (with-directory-excursion "/tmp"
  1593. (invoke "python" "-m" "unittest" "discover"
  1594. "-s" (string-append work "/pylint/test")
  1595. "-p" "*test_*.py"))))))))
  1596. (home-page "https://github.com/PyCQA/pylint")
  1597. (synopsis "Python source code analyzer which looks for coding standard
  1598. errors")
  1599. (description "Pylint is a Python source code analyzer which looks
  1600. for programming errors, helps enforcing a coding standard and sniffs
  1601. for some code smells (as defined in Martin Fowler's Refactoring book).
  1602. Pylint has many rules enabled by default, way too much to silence them
  1603. all on a minimally sized program. It's highly configurable and handle
  1604. pragmas to control it from within your code. Additionally, it is
  1605. possible to write plugins to add your own checks.")
  1606. (properties `((python2-variant . ,(delay python2-pylint))))
  1607. (license license:gpl2+)))
  1608. (define-public python2-pylint
  1609. (let ((pylint (package-with-python2
  1610. (strip-python2-variant python-pylint))))
  1611. (package (inherit pylint)
  1612. (propagated-inputs
  1613. `(("python2-backports-functools-lru-cache"
  1614. ,python2-backports-functools-lru-cache)
  1615. ("python2-configparser" ,python2-configparser)
  1616. ,@(package-propagated-inputs pylint))))))
  1617. (define-public python-paramunittest
  1618. (package
  1619. (name "python-paramunittest")
  1620. (version "0.2")
  1621. (source
  1622. (origin
  1623. (method url-fetch)
  1624. (uri (pypi-uri "ParamUnittest" version))
  1625. (sha256
  1626. (base32
  1627. "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
  1628. (build-system python-build-system)
  1629. (home-page
  1630. "https://github.com/rik0/ParamUnittest")
  1631. (synopsis
  1632. "Simple extension to have parametrized unit tests")
  1633. (description
  1634. "This package allows to create parametrized unit-tests that work with the standard
  1635. unittest package. A parametrized test case is automatically converted to multiple test
  1636. cases. Since they are TestCase subclasses, they work with other test suites that
  1637. recognize TestCases.")
  1638. (license license:bsd-2)))
  1639. (define-public python2-python-paramunittest
  1640. (package-with-python2 python-paramunittest))
  1641. (define-public python-pytest-warnings
  1642. (package
  1643. (name "python-pytest-warnings")
  1644. (version "0.2.0")
  1645. (source
  1646. (origin
  1647. (method url-fetch)
  1648. (uri (pypi-uri "pytest-warnings" version))
  1649. (sha256
  1650. (base32
  1651. "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
  1652. (build-system python-build-system)
  1653. (propagated-inputs
  1654. `(("pytest" ,python-pytest)))
  1655. (home-page "https://github.com/fschulze/pytest-warnings")
  1656. (synopsis "Pytest plugin to list Python warnings in pytest report")
  1657. (description
  1658. "Python-pytest-warnings is a pytest plugin to list Python warnings in
  1659. pytest report.")
  1660. (license license:expat)
  1661. (properties `((python2-variant . ,(delay python2-pytest-warnings))
  1662. ;; This package is part of pytest as of version 3.1.0.
  1663. (superseded . ,python-pytest)))))
  1664. (define-public python2-pytest-warnings
  1665. (package (inherit (package-with-python2
  1666. (strip-python2-variant python-pytest-warnings)))
  1667. (properties `((superseded . ,python2-pytest)))))
  1668. (define-public python-pytest-capturelog
  1669. (package
  1670. (name "python-pytest-capturelog")
  1671. (version "0.7")
  1672. (source
  1673. (origin
  1674. (method url-fetch)
  1675. (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
  1676. (sha256
  1677. (base32
  1678. "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
  1679. (build-system python-build-system)
  1680. (propagated-inputs
  1681. `(("pytest" ,python-pytest)))
  1682. (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
  1683. (synopsis "Pytest plugin to catch log messages")
  1684. (description
  1685. "Python-pytest-catchlog is a pytest plugin to catch log messages.")
  1686. (license license:expat)))
  1687. (define-public python2-pytest-capturelog
  1688. (package-with-python2 python-pytest-capturelog))
  1689. (define-public python-pytest-catchlog
  1690. (package
  1691. (name "python-pytest-catchlog")
  1692. (version "1.2.2")
  1693. (source
  1694. (origin
  1695. (method url-fetch)
  1696. (uri (pypi-uri "pytest-catchlog" version ".zip"))
  1697. (sha256
  1698. (base32
  1699. "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
  1700. (build-system python-build-system)
  1701. (native-inputs
  1702. `(("unzip" ,unzip)))
  1703. (propagated-inputs
  1704. `(("pytest" ,python-pytest)))
  1705. (home-page "https://github.com/eisensheng/pytest-catchlog")
  1706. (synopsis "Pytest plugin to catch log messages")
  1707. (description
  1708. "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
  1709. a fork of pytest-capturelog.")
  1710. (license license:expat)))
  1711. (define-public python2-pytest-catchlog
  1712. (package-with-python2 python-pytest-catchlog))
  1713. (define-public python-nosexcover
  1714. (package
  1715. (name "python-nosexcover")
  1716. (version "1.0.11")
  1717. (source (origin
  1718. (method url-fetch)
  1719. (uri (pypi-uri "nosexcover" version))
  1720. (sha256
  1721. (base32
  1722. "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
  1723. (build-system python-build-system)
  1724. (propagated-inputs
  1725. `(("python-coverage" ,python-coverage)
  1726. ("python-nose" ,python-nose)))
  1727. (home-page "http://github.com/cmheisel/nose-xcover")
  1728. (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
  1729. (description "Nose-xcover is a companion to the built-in
  1730. @code{nose.plugins.cover}. This plugin will write out an XML coverage report
  1731. to a file named coverage.xml.
  1732. It will honor all the options you pass to the Nose coverage plugin,
  1733. especially -cover-package.")
  1734. (license license:expat)))
  1735. (define-public python2-nosexcover
  1736. (package-with-python2 python-nosexcover))
  1737. (define-public python-discover
  1738. (package
  1739. (name "python-discover")
  1740. (version "0.4.0")
  1741. (source
  1742. (origin
  1743. (method url-fetch)
  1744. (uri (pypi-uri "discover" version))
  1745. (sha256
  1746. (base32
  1747. "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
  1748. (build-system python-build-system)
  1749. (home-page "http://pypi.python.org/pypi/discover/")
  1750. (synopsis
  1751. "Python test discovery for unittest")
  1752. (description
  1753. "Discover provides test discovery for unittest, a feature that has been
  1754. backported from Python 2.7 for Python 2.4+.")
  1755. (license license:bsd-3)))
  1756. (define-public python2-discover
  1757. (package-with-python2 python-discover))
  1758. (define-public behave
  1759. (package
  1760. (name "behave")
  1761. (version "1.2.6")
  1762. (source (origin
  1763. (method url-fetch)
  1764. (uri (pypi-uri "behave" version))
  1765. (sha256
  1766. (base32
  1767. "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))))
  1768. (build-system python-build-system)
  1769. (native-inputs
  1770. `(("python-mock" ,python-mock)
  1771. ("python-nose" ,python-nose)
  1772. ("python-pathpy" ,python-pathpy)
  1773. ("python-pyhamcrest" ,python-pyhamcrest)
  1774. ("python-pytest" ,python-pytest)))
  1775. (propagated-inputs
  1776. `(("python-six" ,python-six)
  1777. ("python-parse" ,python-parse)
  1778. ("python-parse-type" ,python-parse-type)))
  1779. (arguments
  1780. '(#:test-target "behave_test"))
  1781. (home-page "https://github.com/behave/behave")
  1782. (synopsis "Python behavior-driven development")
  1783. (description
  1784. "Behave is a tool for behavior-driven development in python.
  1785. Behavior-driven development (or BDD) is an agile software development
  1786. technique that encourages collaboration between developers, QA and
  1787. non-technical or business participants in a software project. Behave uses
  1788. tests written in a natural language style, backed up by Python code.")
  1789. (license license:x11)))
  1790. (define-public python-behave-web-api
  1791. (package
  1792. (name "python-behave-web-api")
  1793. (version "1.0.6")
  1794. (source
  1795. (origin
  1796. (method url-fetch)
  1797. (uri (pypi-uri "behave-web-api" version))
  1798. (sha256
  1799. (base32
  1800. "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
  1801. (build-system python-build-system)
  1802. (arguments
  1803. `(#:phases
  1804. (modify-phases %standard-phases
  1805. (add-after 'unpack 'fix-dependencies
  1806. (lambda _
  1807. (substitute* "setup.py"
  1808. (("'wheel'") "") ; We don't use it.
  1809. (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
  1810. #t)))))
  1811. (propagated-inputs
  1812. `(("behave" ,behave)
  1813. ("python-requests" ,python-requests)))
  1814. (home-page "https://github.com/jefersondaniel/behave-web-api")
  1815. (synopsis "Provides testing for JSON APIs with Behave for Python")
  1816. (description "This package provides testing utility modules for testing
  1817. JSON APIs with Behave.")
  1818. (license license:expat)))
  1819. (define-public python2-behave-web-api
  1820. (package-with-python2 python-behave-web-api))
  1821. (define-public python-rednose
  1822. (package
  1823. (name "python-rednose")
  1824. (version "1.2.3")
  1825. (source
  1826. (origin
  1827. (method url-fetch)
  1828. (uri (pypi-uri "rednose" version))
  1829. (sha256
  1830. (base32
  1831. "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
  1832. (build-system python-build-system)
  1833. (arguments
  1834. `(#:phases (modify-phases %standard-phases
  1835. (add-after 'unpack 'patch-setup.py
  1836. (lambda _
  1837. ;; Six is only required for tests and later versions
  1838. ;; work fine.
  1839. (substitute* "setup.py"
  1840. (("six==1.10.0") "six"))
  1841. #t)))))
  1842. (propagated-inputs
  1843. `(("python-colorama" ,python-colorama)
  1844. ("python-termstyle" ,python-termstyle)))
  1845. (native-inputs
  1846. `(("python-six" ,python-six)
  1847. ("python-nose" ,python-nose)))
  1848. (home-page "https://github.com/JBKahn/rednose")
  1849. (synopsis "Colored output for Python nosetests")
  1850. (description "This package provides colored output for the
  1851. @command{nosetests} command of the Python Nose unit test framework.")
  1852. (license license:bsd-3)))
  1853. (define-public python2-rednose
  1854. (package-with-python2 python-rednose))
  1855. (define-public python-nose-randomly
  1856. (package
  1857. (name "python-nose-randomly")
  1858. (version "1.2.6")
  1859. (source
  1860. (origin
  1861. (method url-fetch)
  1862. (uri (pypi-uri "nose-randomly" version))
  1863. (sha256
  1864. (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
  1865. (build-system python-build-system)
  1866. (native-inputs
  1867. `(("python-nose" ,python-nose)
  1868. ("python-numpy" ,python-numpy)))
  1869. (home-page "https://github.com/adamchainz/nose-randomly")
  1870. (synopsis
  1871. "Nose plugin to randomly order tests and control random.seed")
  1872. (description
  1873. "This is a @code{Nose} plugin to randomly order tests which can be quite
  1874. powerful in discovering hidden flaws in the tests themselves, while helping to
  1875. reduce inter-test dependencies. It also helps in controlling @code{random.seed},
  1876. by resetting it to a repeatable number for each test, enabling the tests to
  1877. create data based on random numbers and yet remain repeatable.")
  1878. (license license:bsd-3)))
  1879. (define-public python2-nose-randomly
  1880. (package-with-python2 python-nose-randomly))
  1881. (define-public python-nose-timer
  1882. (package
  1883. (name "python-nose-timer")
  1884. (version "0.7.3")
  1885. (source
  1886. (origin
  1887. (method url-fetch)
  1888. (uri (pypi-uri "nose-timer" version))
  1889. (sha256
  1890. (base32
  1891. "0hfz5aqnhf493i9kyb6prm4zm8vx7wmfsyg3nvsnh24lzh2kwx44"))))
  1892. (build-system python-build-system)
  1893. (propagated-inputs
  1894. `(("python-nose" ,python-nose)
  1895. ("python-termcolor" ,python-termcolor)))
  1896. (home-page "https://github.com/mahmoudimus/nose-timer")
  1897. (synopsis "Timer plugin for nosetests")
  1898. (description "Shows how much time was needed to run individual tests.")
  1899. (license license:expat)))
  1900. (define-public python2-nose-timer
  1901. (package-with-python2 python-nose-timer))
  1902. (define-public python-freezegun
  1903. (package
  1904. (name "python-freezegun")
  1905. (version "0.3.10")
  1906. (source
  1907. (origin
  1908. (method url-fetch)
  1909. (uri (pypi-uri "freezegun" version))
  1910. (sha256
  1911. (base32
  1912. "08m6b42yxb9hk5lv747v9n2qsxyadmkb0k6yg0gxdanwap0slg3h"))))
  1913. (build-system python-build-system)
  1914. (native-inputs
  1915. `(("python-mock" ,python-mock)
  1916. ("python-nose" ,python-nose)
  1917. ("python-coverage" ,python-coverage)))
  1918. (propagated-inputs
  1919. `(("python-six" ,python-six)
  1920. ("python-dateutil" ,python-dateutil)))
  1921. (arguments
  1922. `(#:phases
  1923. (modify-phases %standard-phases
  1924. ;; The tests are normally executed via `make test`, but the PyPi
  1925. ;; package does not include the Makefile.
  1926. (replace 'check
  1927. (lambda _
  1928. (invoke "nosetests" "./tests/"))))))
  1929. (home-page "https://github.com/spulec/freezegun")
  1930. (synopsis "Test utility for mocking the datetime module")
  1931. (description
  1932. "FreezeGun is a library that allows your python tests to travel through
  1933. time by mocking the datetime module.")
  1934. (license license:asl2.0)))
  1935. (define-public python2-freezegun
  1936. (package-with-python2 python-freezegun))
  1937. (define-public python-flexmock
  1938. (package
  1939. (name "python-flexmock")
  1940. (version "0.10.2")
  1941. (source (origin
  1942. (method url-fetch)
  1943. (uri (pypi-uri "flexmock" version))
  1944. (sha256
  1945. (base32
  1946. "0arc6njvs6i9v9hgvzk5m50296g7zy5m9d7pyb43vdsdgxrci5gy"))))
  1947. (build-system python-build-system)
  1948. (home-page "https://flexmock.readthedocs.org")
  1949. (synopsis "Testing library for Python")
  1950. (description
  1951. "flexmock is a testing library for Python that makes it easy to create
  1952. mocks, stubs and fakes.")
  1953. (license license:bsd-3)))
  1954. (define-public python2-flexmock
  1955. (package-with-python2 python-flexmock))
  1956. (define-public python-flaky
  1957. (package
  1958. (name "python-flaky")
  1959. (version "3.5.3")
  1960. (source (origin
  1961. (method url-fetch)
  1962. (uri (pypi-uri "flaky" version))
  1963. (sha256
  1964. (base32
  1965. "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
  1966. (build-system python-build-system)
  1967. (arguments
  1968. ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
  1969. '(#:tests? #f))
  1970. (home-page "https://github.com/box/flaky")
  1971. (synopsis "Automatically rerun flaky tests")
  1972. (description
  1973. "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
  1974. reruns flaky tests.
  1975. Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
  1976. on components that aren't 100% reliable. With flaky, instead of removing
  1977. those tests or marking them to @code{@@skip}, they can be automatically
  1978. retried.")
  1979. (license license:asl2.0)))
  1980. (define-public python2-flaky
  1981. (package-with-python2 python-flaky))
  1982. (define-public python-pyhamcrest
  1983. (package
  1984. (name "python-pyhamcrest")
  1985. (version "1.9.0")
  1986. (source (origin
  1987. ;; Tests not distributed from pypi release.
  1988. (method git-fetch)
  1989. (uri (git-reference
  1990. (url "https://github.com/hamcrest/PyHamcrest")
  1991. (commit (string-append "V" version))))
  1992. (file-name (git-file-name name version))
  1993. (sha256
  1994. (base32
  1995. "01qnzj9qnzz0y78qa3ing24ssvszb0adw59xc4qqmdn5wryy606b"))))
  1996. (native-inputs ; All native inputs are for tests
  1997. `(("python-pytest-cov" ,python-pytest-cov)
  1998. ("python-mock" ,python-mock)
  1999. ("python-pytest" ,python-pytest)
  2000. ("python-hypothesis" ,python-hypothesis)))
  2001. (propagated-inputs
  2002. `(("python-six" ,python-six)))
  2003. (build-system python-build-system)
  2004. (home-page "http://hamcrest.org/")
  2005. (synopsis "Hamcrest matchers for Python")
  2006. (description
  2007. "PyHamcrest is a framework for writing matcher objects,
  2008. allowing you to declaratively define \"match\" rules.")
  2009. (license license:bsd-3)))
  2010. (define-public python2-pyhamcrest
  2011. (package-with-python2 python-pyhamcrest))
  2012. (define-public unittest-cpp
  2013. (package
  2014. (name "unittest-cpp")
  2015. (version "2.0.0")
  2016. (source (origin
  2017. (method git-fetch)
  2018. (uri (git-reference
  2019. (url "https://github.com/unittest-cpp/unittest-cpp")
  2020. (commit (string-append "v" version))))
  2021. (file-name (git-file-name name version))
  2022. (sha256
  2023. (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
  2024. (arguments
  2025. `(#:tests? #f)) ; It's run after build automatically.
  2026. (build-system cmake-build-system)
  2027. (home-page "https://github.com/unittest-cpp/unittest-cpp")
  2028. (synopsis "Lightweight unit testing framework for C++")
  2029. (description "UnitTest++ is a lightweight unit testing framework for C++.
  2030. It was designed to do test-driven development on a wide variety of platforms.
  2031. Simplicity, portability, speed, and small footprint are all very important
  2032. aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
  2033. of advanced library and language features, which means it should be easily
  2034. portable to just about any platform.")
  2035. (license license:expat)))
  2036. (define-public libfaketime
  2037. (package
  2038. (name "libfaketime")
  2039. (version "0.9.7")
  2040. (home-page "https://github.com/wolfcw/libfaketime")
  2041. (source (origin
  2042. (method git-fetch)
  2043. (uri (git-reference
  2044. (url home-page)
  2045. (commit (string-append "v" version))))
  2046. (sha256
  2047. (base32
  2048. "1cin1pqwpsswcv7amiwijirvcg3x1zf2l00s1x84nxc5602fzr5c"))
  2049. (file-name (git-file-name name version))))
  2050. (build-system gnu-build-system)
  2051. (arguments
  2052. '(#:phases (modify-phases %standard-phases
  2053. (replace 'configure
  2054. (lambda* (#:key outputs #:allow-other-keys)
  2055. (let ((out (assoc-ref outputs "out")))
  2056. (setenv "CC" "gcc")
  2057. (setenv "PREFIX" out)
  2058. #t)))
  2059. (add-before 'check 'pre-check
  2060. (lambda _
  2061. (substitute* "test/functests/test_exclude_mono.sh"
  2062. (("/bin/bash") (which "bash")))
  2063. #t)))
  2064. #:test-target "test"))
  2065. (native-inputs
  2066. `(("perl" ,perl))) ;for tests
  2067. (synopsis "Fake the system time for single applications")
  2068. (description
  2069. "The libfaketime library allows users to modify the system time that an
  2070. application \"sees\". It is meant to be loaded using the dynamic linker's
  2071. @code{LD_PRELOAD} environment variable. The @command{faketime} command
  2072. provides a simple way to achieve this.")
  2073. (license license:gpl2)))
  2074. (define-public umockdev
  2075. (package
  2076. (name "umockdev")
  2077. (version "0.12.1")
  2078. (source (origin
  2079. (method url-fetch)
  2080. (uri (string-append "https://github.com/martinpitt/umockdev/"
  2081. "releases/download/" version "/"
  2082. "umockdev-" version ".tar.xz"))
  2083. (sha256
  2084. (base32
  2085. "1hx5jm9afng6hw9wyp524z8nwdp6w053pca0w2c0gqpgrmvjxvd2"))))
  2086. (build-system gnu-build-system)
  2087. (arguments
  2088. `(#:phases
  2089. (modify-phases %standard-phases
  2090. (add-after 'unpack 'skip-broken-test
  2091. (lambda _
  2092. (substitute* "tests/test-umockdev.c"
  2093. (("/\\* sys/ in other dir")
  2094. (string-append "return; // ")))
  2095. #t)))))
  2096. (native-inputs
  2097. `(("vala" ,vala)
  2098. ("python" ,python) ; for tests
  2099. ("which" ,which) ; for tests
  2100. ("gtk-doc" ,gtk-doc)
  2101. ("pkg-config" ,pkg-config)))
  2102. (inputs
  2103. `(("glib" ,glib)
  2104. ("eudev" ,eudev)
  2105. ("libgudev" ,libgudev)
  2106. ("gobject-introspection" ,gobject-introspection)))
  2107. (home-page "https://github.com/martinpitt/umockdev/")
  2108. (synopsis "Mock hardware devices for creating unit tests")
  2109. (description "umockdev mocks hardware devices for creating integration
  2110. tests for hardware related libraries and programs. It also provides tools to
  2111. record the properties and behaviour of particular devices, and to run a
  2112. program or test suite under a test bed with the previously recorded devices
  2113. loaded.")
  2114. (license license:lgpl2.1+)))