check.scm 113 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035
  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, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  11. ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
  12. ;;; Copyright © 2016 Christine Lemmer-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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  20. ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
  21. ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
  22. ;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
  23. ;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
  24. ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
  25. ;;; Copyright © 2017, 2019 Kei Kebreau <kkebreau@posteo.net>
  26. ;;; Copyright © 2017 Nikita <nikita@n0.is>
  27. ;;; Copyright © 2015, 2017, 2018, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
  28. ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
  29. ;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  30. ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
  31. ;;; Copyright © 2019, 2021 Pierre Langlois <pierre.langlois@gmx.com>
  32. ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
  33. ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
  34. ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
  35. ;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
  36. ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
  37. ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
  38. ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  39. ;;; Copyright © 2021 Hugo Lecomte <hugo.lecomte@inria.fr>
  40. ;;;
  41. ;;; This file is part of GNU Guix.
  42. ;;;
  43. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  44. ;;; under the terms of the GNU General Public License as published by
  45. ;;; the Free Software Foundation; either version 3 of the License, or (at
  46. ;;; your option) any later version.
  47. ;;;
  48. ;;; GNU Guix is distributed in the hope that it will be useful, but
  49. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  50. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  51. ;;; GNU General Public License for more details.
  52. ;;;
  53. ;;; You should have received a copy of the GNU General Public License
  54. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  55. (define-module (gnu packages check)
  56. #:use-module (gnu packages)
  57. #:use-module (gnu packages autotools)
  58. #:use-module (gnu packages base)
  59. #:use-module (gnu packages bash)
  60. #:use-module (gnu packages compression)
  61. #:use-module (gnu packages linux)
  62. #:use-module (gnu packages llvm)
  63. #:use-module (gnu packages glib)
  64. #:use-module (gnu packages gnome)
  65. #:use-module (gnu packages golang)
  66. #:use-module (gnu packages gtk)
  67. #:use-module (gnu packages perl)
  68. #:use-module (gnu packages pkg-config)
  69. #:use-module (gnu packages python)
  70. #:use-module (gnu packages python-check)
  71. #:use-module (gnu packages python-build)
  72. #:use-module (gnu packages python-web)
  73. #:use-module (gnu packages python-xyz)
  74. #:use-module (gnu packages python-science)
  75. #:use-module (gnu packages time)
  76. #:use-module (gnu packages xml)
  77. #:use-module (guix utils)
  78. #:use-module ((guix licenses) #:prefix license:)
  79. #:use-module (guix packages)
  80. #:use-module (guix download)
  81. #:use-module (guix git-download)
  82. #:use-module (guix build-system cmake)
  83. #:use-module (guix build-system glib-or-gtk)
  84. #:use-module (guix build-system gnu)
  85. #:use-module (guix build-system go)
  86. #:use-module (guix build-system meson)
  87. #:use-module (guix build-system python)
  88. #:use-module (guix build-system trivial)
  89. #:use-module (srfi srfi-1))
  90. (define-public pedansee
  91. (package
  92. (name "pedansee")
  93. (version "0.0.3")
  94. (source
  95. (origin
  96. (method url-fetch)
  97. (uri
  98. (string-append "https://www.flyn.org/projects/"
  99. name "/" name "-" version ".tar.gz"))
  100. (sha256
  101. (base32 "0lsg791x6n95pxg6vif8qfc46nqcamhjq3g0dl5xqf6imy7n3acd"))))
  102. (build-system glib-or-gtk-build-system)
  103. (native-inputs
  104. `(("clang" ,clang)
  105. ("pkg-config" ,pkg-config)
  106. ("python" ,python-wrapper)))
  107. (inputs
  108. `(("glib" ,glib)))
  109. (synopsis "Code checker for C")
  110. (description "Pedansee checks C source files for compliance with a particular
  111. programming style. The style is currently defined by the pedansee source code
  112. in the form of functions which walk each source file’s syntax tree. You can
  113. modify some aspects of this style through the use of regular expressions.")
  114. (home-page "https://www.flyn.org/projects/pedansee/")
  115. (license license:gpl3+)))
  116. (define-public mutest
  117. (package
  118. (name "mutest")
  119. (version "0.0.0")
  120. (source
  121. (origin
  122. (method git-fetch)
  123. (uri
  124. (git-reference
  125. (url "https://github.com/ebassi/mutest")
  126. (commit "e6246c9")))
  127. (file-name (git-file-name name version))
  128. (sha256
  129. (base32 "0gdqwq6fvk06wld4rhnw5752hahrvhd69zrci045x25rwx90x26q"))))
  130. (build-system meson-build-system)
  131. (synopsis "Small C testing library")
  132. (description "Mutest aims to be a small unit testing library for C projects,
  133. with an API heavily modelled on high level Behavior-Driver Development frameworks
  134. like Jasmine or Mocha.")
  135. (home-page "https://ebassi.github.io/mutest/mutest.md.html")
  136. (license license:expat)))
  137. (define-public check
  138. (package
  139. (name "check")
  140. (version "0.15.2")
  141. (source
  142. (origin
  143. (method url-fetch)
  144. (uri (string-append "https://github.com/libcheck/check/releases/download/"
  145. version "/check-" version ".tar.gz"))
  146. (sha256
  147. (base32
  148. "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8"))
  149. (patches
  150. (list
  151. ;; This patch fixes some tests that would otherwise fail on
  152. ;; powerpc64le-linux. Without this patch, the tests make certain
  153. ;; assumptions about floating point number precision that are not true
  154. ;; on that platform.
  155. ;;
  156. ;; TODO: Remove this patch when updating to the next check release,
  157. ;; since it will be included there. See:
  158. ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47698
  159. (origin
  160. (method url-fetch)
  161. (uri
  162. (string-append "https://github.com/libcheck/check/commit/"
  163. "4fbe702fa4f35bee8a90512f9f59d1441c4ae82e.patch"))
  164. (file-name (string-append name
  165. "-fix-test-precision-for-ppc.patch"))
  166. (sha256
  167. (base32
  168. "04qg1p9afdd6453k18qskazrvscysdcjz9j6w4i6p5x4xyma19v6")))))))
  169. (build-system gnu-build-system)
  170. (home-page "https://libcheck.github.io/check/")
  171. (synopsis "Unit test framework for C")
  172. (description
  173. "Check is a unit testing framework for C. It features a simple
  174. interface for defining unit tests, putting little in the way of the
  175. developer. Tests are run in a separate address space, so Check can
  176. catch both assertion failures and code errors that cause segmentation
  177. faults or other signals. The output from unit tests can be used within
  178. source code editors and IDEs.")
  179. (license license:lgpl2.1+)))
  180. ;; Some packages require older versions. Removed once no longer needed.
  181. (define-public check-0.14
  182. (package
  183. (inherit check)
  184. (version "0.14.0")
  185. (source (origin
  186. (method url-fetch)
  187. (uri (string-append "https://github.com/libcheck/check/releases"
  188. "/download/" version "/check-" version ".tar.gz"))
  189. (sha256
  190. (base32
  191. "02zkfiyklckmivrfvdsrlzvzphkdsgjrz3igncw05dv5pshhq3xx"))))))
  192. (define-public check-0.12
  193. (package
  194. (inherit check)
  195. (version "0.12.0")
  196. (source (origin
  197. (method url-fetch)
  198. (uri (string-append "https://github.com/libcheck/check/releases"
  199. "/download/" version "/check-" version ".tar.gz"))
  200. (sha256
  201. (base32
  202. "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6"))))))
  203. (define-public clitest
  204. (package
  205. (name "clitest")
  206. (version "0.3.0")
  207. (home-page "https://github.com/aureliojargas/clitest")
  208. (source (origin
  209. (method git-fetch)
  210. (uri (git-reference
  211. (url home-page)
  212. (commit (string-append "v" version))))
  213. (file-name (git-file-name name version))
  214. (sha256
  215. (base32
  216. "0zw5wra9hc717srmcar1wm4i34kyj8c49ny4bb7y3nrvkjp2pdb5"))))
  217. (build-system gnu-build-system)
  218. (arguments
  219. `(#:phases
  220. (modify-phases %standard-phases
  221. ;; This package is distributed as a single shell script and comes
  222. ;; without a proper build system.
  223. (delete 'configure)
  224. (delete 'build)
  225. (replace 'check
  226. (lambda _
  227. (substitute* "test.md"
  228. ;; One test looks for an error from grep in the form "grep: foo",
  229. ;; but our grep returns the absolute file name on errors. Adjust
  230. ;; the test to cope with that.
  231. (("sed 's/\\^e\\*grep: \\.\\*/")
  232. "sed 's/.*e*grep: .*/"))
  233. (setenv "HOME" "/tmp")
  234. (invoke "./clitest" "test.md")))
  235. (replace 'install
  236. (lambda* (#:key outputs #:allow-other-keys)
  237. (let ((out (assoc-ref outputs "out")))
  238. (install-file "clitest" (string-append out "/bin"))
  239. (install-file "README.md"
  240. (string-append out "/share/doc/clitest-" ,version))
  241. #t))))))
  242. (native-inputs
  243. `(("perl" ,perl))) ;for tests
  244. (synopsis "Command line test tool")
  245. (description
  246. "@command{clitest} is a portable shell script that performs automatic
  247. testing of Unix command lines.")
  248. (license license:expat)))
  249. (define-public cunit
  250. (package
  251. (name "cunit")
  252. (version "2.1-3")
  253. (source
  254. (origin
  255. (method url-fetch)
  256. (uri (string-append "mirror://sourceforge/cunit/CUnit/"
  257. version "/CUnit-" version ".tar.bz2"))
  258. (sha256
  259. (base32
  260. "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
  261. (build-system gnu-build-system)
  262. (arguments '(#:phases
  263. (modify-phases %standard-phases
  264. ;; XXX: The "bootstrap" phase detects the "bootstrap"
  265. ;; script, but fails to execute it, so we bootstrap
  266. ;; manually.
  267. (replace 'bootstrap
  268. (lambda _ (invoke "autoreconf" "-vfi"))))))
  269. (native-inputs
  270. `(("automake" ,automake)
  271. ("autoconf" ,autoconf)
  272. ("libtool" ,libtool)))
  273. (home-page "http://cunit.sourceforge.net/")
  274. (synopsis "Automated testing framework for C")
  275. (description
  276. "CUnit is a lightweight system for writing, administering, and running
  277. unit tests in C. It provides C programmers with basic testing functionality
  278. with a flexible variety of user interfaces.")
  279. (license license:gpl2+)))
  280. (define-public cppunit
  281. (package
  282. (name "cppunit")
  283. (version "1.15.1")
  284. (source (origin
  285. (method url-fetch)
  286. (uri (string-append "http://dev-www.libreoffice.org/src/"
  287. name "-" version ".tar.gz"))
  288. (sha256
  289. (base32
  290. "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9"))))
  291. ;; Explicitly link with libdl. This is expected to be done by packages
  292. ;; relying on cppunit for their tests. However, not all of them do.
  293. ;; If we added the linker flag to such packages, we would pollute all
  294. ;; binaries, not only those used for testing.
  295. (arguments
  296. `(#:make-flags '("LDFLAGS=-ldl")))
  297. (build-system gnu-build-system)
  298. (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
  299. (synopsis "Unit testing framework for C++")
  300. (description "CppUnit is the C++ port of the famous JUnit framework for
  301. unit testing. Test output is in XML for automatic testing and GUI based for
  302. supervised tests.")
  303. (license license:lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
  304. (define-public shunit2
  305. (package
  306. (name "shunit2")
  307. (version "2.1.8")
  308. (source (origin
  309. (method git-fetch)
  310. (uri (git-reference
  311. (url "https://github.com/kward/shunit2")
  312. (commit (string-append "v" version))))
  313. (file-name (git-file-name name version))
  314. (sha256
  315. (base32
  316. "08vs0jjl3pfh100sjlw31x4638xj7fghr0j2g1zfikba8n1f9491"))))
  317. (build-system gnu-build-system)
  318. (arguments
  319. `(#:phases
  320. (modify-phases %standard-phases
  321. (delete 'configure) ; no configure script
  322. (delete 'build)
  323. (add-after 'patch-source-shebangs 'patch-more-shebangs
  324. (lambda _
  325. (substitute* "shunit2"
  326. (("#! /bin/sh") (string-append "#! " (which "sh")))
  327. (("/usr/bin/od") (which "od")))
  328. (substitute* "test_runner"
  329. (("/bin/sh") (which "sh"))
  330. (("/bin/bash") (which "bash")))
  331. #t))
  332. (replace 'check
  333. (lambda* (#:key tests? #:allow-other-keys)
  334. (when tests?
  335. ;; This test is buggy in the build container.
  336. (delete-file "shunit2_misc_test.sh")
  337. (invoke "sh" "test_runner"))
  338. #t))
  339. (replace 'install
  340. (lambda* (#:key outputs #:allow-other-keys)
  341. (install-file "shunit2"
  342. (string-append (assoc-ref outputs "out")
  343. "/bin"))
  344. #t)))))
  345. (home-page "https://github.com/kward/shunit2")
  346. (synopsis "@code{xUnit} based unit testing for Unix shell scripts")
  347. (description "@code{shUnit2} was originally developed to provide a
  348. consistent testing solution for @code{log4sh}, a shell based logging framework
  349. similar to @code{log4j}. It is designed to work in a similar manner to JUnit,
  350. PyUnit and others.")
  351. (license license:asl2.0)))
  352. ;; When dependent packages upgraded to use newer version of catch, this one should
  353. ;; be removed.
  354. (define-public catch-framework
  355. (package
  356. (name "catch")
  357. (version "1.3.5") ;Sub-minor is the build number
  358. (source (origin
  359. (method git-fetch)
  360. (uri (git-reference
  361. (url "https://github.com/philsquared/Catch")
  362. ;; Semi-arbitrary.
  363. (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
  364. (file-name (string-append name "-" version))
  365. (sha256
  366. (base32
  367. "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
  368. (build-system trivial-build-system)
  369. (arguments
  370. `(#:modules ((guix build utils))
  371. #:builder (begin
  372. (use-modules (guix build utils))
  373. (let* ((source (assoc-ref %build-inputs "source"))
  374. (output (assoc-ref %outputs "out"))
  375. (incdir (string-append output "/include"))
  376. (docdir (string-append output "/share/doc/catch-"
  377. ,version)))
  378. (for-each mkdir-p (list incdir docdir))
  379. (install-file (string-append source
  380. "/single_include/catch.hpp")
  381. incdir)
  382. (copy-recursively (string-append source "/docs")
  383. docdir)
  384. #t))))
  385. (home-page "http://catch-lib.net/")
  386. (synopsis "Automated test framework for C++ and Objective-C")
  387. (description
  388. "Catch stands for C++ Automated Test Cases in Headers and is a
  389. multi-paradigm automated test framework for C++ and Objective-C.")
  390. (license license:boost1.0)))
  391. (define-public catch-framework2-1
  392. (package
  393. (name "catch2")
  394. (version "1.12.2")
  395. (home-page "https://github.com/catchorg/Catch2")
  396. (source (origin
  397. (method git-fetch)
  398. (uri (git-reference
  399. (url "https://github.com/catchorg/Catch2")
  400. (commit (string-append "v" version))))
  401. (file-name (git-file-name name version))
  402. (sha256
  403. (base32
  404. "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23"))))
  405. (build-system cmake-build-system)
  406. (synopsis "Automated test framework for C++ and Objective-C")
  407. (description "Catch2 stands for C++ Automated Test Cases in Headers and is
  408. a multi-paradigm automated test framework for C++ and Objective-C.")
  409. (license license:boost1.0)))
  410. (define-public catch-framework2
  411. (package
  412. (name "catch2")
  413. (version "2.13.2")
  414. (home-page "https://github.com/catchorg/Catch2")
  415. (source (origin
  416. (method git-fetch)
  417. (uri (git-reference
  418. (url "https://github.com/catchorg/Catch2")
  419. (commit (string-append "v" version))))
  420. (file-name (git-file-name name version))
  421. (sha256
  422. (base32
  423. "100r0kmra8jmra2hv92lzvwcmphpaiccwvq3lpdsa5b7hailhach"))))
  424. (build-system cmake-build-system)
  425. (inputs
  426. `(("python" ,python-wrapper)))
  427. (synopsis "Automated test framework for C++ and Objective-C")
  428. (description "Catch2 stands for C++ Automated Test Cases in Headers and is
  429. a multi-paradigm automated test framework for C++ and Objective-C.")
  430. (license license:boost1.0)))
  431. (define-public cmdtest
  432. (package
  433. (name "cmdtest")
  434. ;; Use the latest commit (from 2019) in order to get Python 3 support.
  435. (version "0.32-14-gcdfe14e")
  436. (source (origin
  437. (method git-fetch)
  438. (uri (git-reference
  439. (url "git://git.liw.fi/cmdtest/")
  440. (commit version)))
  441. (file-name (git-file-name name version))
  442. (sha256
  443. (base32
  444. "1yhcwsqcpckkq5kw3h07k0xg6infyiyzq9ni3nqphrzxis7hxjf1"))))
  445. (build-system python-build-system)
  446. (arguments `(#:tests? #f)) ;requires Python 2!
  447. (native-inputs
  448. `(("python-coverage-test-runner" ,python-coverage-test-runner)
  449. ("python" ,python)))
  450. (inputs
  451. `(("python-cliapp" ,python-cliapp)
  452. ("python-markdown" ,python-markdown)
  453. ("python-ttystatus" ,python-ttystatus)))
  454. (home-page "https://liw.fi/cmdtest/")
  455. (synopsis "Black box Unix program tester")
  456. (description
  457. "@code{cmdtest} black box tests Unix command line tools. Roughly, it is
  458. given a command line and input files, and the expected output, and it verifies
  459. that the command line produces the expected output. If not, it reports a
  460. problem, and shows the differences.")
  461. (license license:gpl3+)))
  462. (define-public cmocka
  463. (package
  464. (name "cmocka")
  465. (version "1.1.5")
  466. (source (origin
  467. (method url-fetch)
  468. (uri (string-append "https://cmocka.org/files/"
  469. (version-major+minor version) "/cmocka-"
  470. version ".tar.xz"))
  471. (sha256
  472. (base32
  473. "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h"))))
  474. (build-system cmake-build-system)
  475. (arguments
  476. `(#:tests? #f)) ; no test target
  477. (home-page "https://cmocka.org/")
  478. (synopsis "Unit testing framework for C")
  479. (description "Cmocka is a unit testing framework for C with support for
  480. mock objects. It only requires the standard C library, and works with
  481. different compilers. Cmocka supports several different message output formats
  482. like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
  483. format.")
  484. (license license:asl2.0)))
  485. (define-public cppcheck
  486. (package
  487. (name "cppcheck")
  488. (version "2.3")
  489. (source (origin
  490. (method git-fetch)
  491. (uri (git-reference
  492. (url "https://github.com/danmar/cppcheck")
  493. (commit version)))
  494. (file-name (git-file-name name version))
  495. (sha256
  496. (base32 "03ic5mig3ryzkf85r95ryagf84s7y5nd6sqr915l3zj30apnifvz"))))
  497. (build-system cmake-build-system)
  498. (arguments
  499. '(#:configure-flags '("-DBUILD_TESTS=ON")))
  500. (home-page "http://cppcheck.sourceforge.net")
  501. (synopsis "Static C/C++ code analyzer")
  502. (description "Cppcheck is a static code analyzer for C and C++. Unlike
  503. C/C++ compilers and many other analysis tools it does not detect syntax errors
  504. in the code. Cppcheck primarily detects the types of bugs that the compilers
  505. normally do not detect. The goal is to detect only real errors in the code
  506. (i.e. have zero false positives).")
  507. (license license:gpl3+)))
  508. (define-public cxxtest
  509. (package
  510. (name "cxxtest")
  511. (version "4.4")
  512. (source (origin
  513. (method url-fetch)
  514. (uri (string-append "mirror://sourceforge/cxxtest/cxxtest/"
  515. version "/cxxtest-" version ".tar.gz"))
  516. (sha256
  517. (base32
  518. "1n7pbj4z9ivx005hqvivj9ddhq8awynzg6jishfbypf6j7ply58w"))))
  519. (build-system python-build-system)
  520. (arguments
  521. '(#:phases
  522. (modify-phases %standard-phases
  523. (add-after 'unpack 'chdir-to-source
  524. (lambda _
  525. (chdir "python")
  526. #t))
  527. (add-after 'install 'install-headers
  528. (lambda* (#:key outputs #:allow-other-keys)
  529. (let* ((out (assoc-ref outputs "out"))
  530. (include-dir (string-append out "/include/cxxtest")))
  531. (for-each (lambda (header-file)
  532. (install-file header-file include-dir))
  533. (find-files "../cxxtest"))
  534. #t)))
  535. (add-after 'install 'install-doc
  536. (lambda* (#:key outputs #:allow-other-keys)
  537. (let* ((out (assoc-ref outputs "out"))
  538. (doc-dir (string-append out "/share/doc/cxxtest")))
  539. (install-file "../README" doc-dir)
  540. (install-file "../doc/guide.txt" doc-dir)
  541. (copy-recursively "../sample" (string-append doc-dir "/sample"))
  542. #t))))))
  543. (propagated-inputs
  544. `(("python-ply" ,python-ply)))
  545. (home-page "https://cxxtest.com/")
  546. (synopsis "Unit testing framework for C++")
  547. (description "CxxTest is a unit testing framework for C++ that is similar
  548. in spirit to JUnit, CppUnit, and xUnit. CxxTest does not require precompiling
  549. a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI)
  550. and it supports a very flexible form of test discovery.")
  551. (license license:lgpl3+)))
  552. (define-public doctest
  553. (package
  554. (name "doctest")
  555. (version "2.4.6")
  556. (home-page "https://github.com/onqtam/doctest")
  557. (source (origin
  558. (method git-fetch)
  559. (uri (git-reference (url home-page) (commit version)))
  560. (file-name (git-file-name name version))
  561. (sha256
  562. (base32
  563. "14m3q6d96zg6d99x1152jkly50gdjrn5ylrbhax53pfgfzzc5yqx"))))
  564. (build-system cmake-build-system)
  565. (synopsis "C++ test framework")
  566. (description
  567. "doctest is a single-header testing framework for C++11 and later. It
  568. has been designed to be fast, light and unintrusive.")
  569. (license license:expat)))
  570. (define-public go-gopkg.in-check.v1
  571. (let ((commit "788fd78401277ebd861206a03c884797c6ec5541")
  572. (revision "1"))
  573. (package
  574. (name "go-gopkg.in-check.v1")
  575. (version (git-version "0.0.0" revision commit))
  576. (source (origin
  577. (method git-fetch)
  578. (uri (git-reference
  579. (url "https://github.com/go-check/check")
  580. (commit commit)))
  581. (file-name (git-file-name name version))
  582. (sha256
  583. (base32
  584. "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"))))
  585. (build-system go-build-system)
  586. (arguments
  587. '(#:import-path "gopkg.in/check.v1"))
  588. (propagated-inputs
  589. `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty)))
  590. (synopsis "Rich testing extension for Go's testing package")
  591. (description
  592. "@code{check} is a rich testing extension for Go's testing package.")
  593. (home-page "https://github.com/go-check/check")
  594. (license license:bsd-2))))
  595. (define-public go-github.com-smartystreets-gunit
  596. (package
  597. (name "go-github.com-smartystreets-gunit")
  598. (version "1.0.0")
  599. (source (origin
  600. (method git-fetch)
  601. (uri (git-reference
  602. (url "https://github.com/smartystreets/gunit")
  603. (commit version)))
  604. (file-name (git-file-name name version))
  605. (sha256
  606. (base32
  607. "00m4zg0kdj49mnpmf9klb44ba71p966xsk6zknrzqgfc8119f35z"))))
  608. (build-system go-build-system)
  609. (arguments
  610. '(;; TODO: This package depends on go-github.com-smartystreets-assertions
  611. ;; for running the tests, but go-github.com-smartystreets-assertions
  612. ;; depends on this package, so break this loop by not running the tests
  613. ;; for this package.
  614. #:tests? #f
  615. #:import-path "github.com/smartystreets/gunit"))
  616. (synopsis "Testing tool for Go, in the style of xUnit")
  617. (description
  618. "@code{gunit} allows the test author to use a struct as the scope for a
  619. group of related test cases, in the style of xUnit fixtures. This makes
  620. extraction of setup/teardown behavior (as well as invoking the system under
  621. test) much simpler.")
  622. (home-page "https://github.com/smartystreets/gunit")
  623. (license license:expat)))
  624. (define-public go-github.com-smartystreets-assertions
  625. (package
  626. (name "go-github.com-smartystreets-assertions")
  627. (version "1.8.1")
  628. (source (origin
  629. (method git-fetch)
  630. (uri (git-reference
  631. (url "https://github.com/smartystreets/assertions")
  632. (commit version)))
  633. (file-name (git-file-name name version))
  634. (sha256
  635. (base32
  636. "1j0adgbykl55rf2945g0n5bmqdsnjcqlx5dcmpfh4chki43hiwg9"))))
  637. (build-system go-build-system)
  638. (arguments
  639. '(#:import-path "github.com/smartystreets/assertions"))
  640. (native-inputs
  641. `(("go-github.com-smartystreets-gunit" ,go-github.com-smartystreets-gunit)))
  642. (synopsis "Assertions for testing with Go")
  643. (description
  644. "The @code{assertions} package provides convenient assertion functions
  645. for writing tests in Go.")
  646. (home-page "https://github.com/smartystreets/assertions")
  647. (license license:expat)))
  648. (define-public go-github.com-smartystreets-goconvey
  649. (package
  650. (name "go-github.com-smartystreets-goconvey")
  651. (version "1.6.3")
  652. (source (origin
  653. (method git-fetch)
  654. (uri (git-reference
  655. (url "https://github.com/smartystreets/goconvey")
  656. (commit version)))
  657. (file-name (git-file-name name version))
  658. (sha256
  659. (base32
  660. "1ph18rkl3ns3fgin5i4j54w5a69grrmf3apcsmnpdn1wlrbs3dxh"))))
  661. (build-system go-build-system)
  662. (arguments
  663. '(#:import-path "github.com/smartystreets/goconvey"))
  664. (propagated-inputs
  665. `(("go-github.com-jtolds-gls" ,go-github.com-jtolds-gls)
  666. ("go-github.com-smartystreets-assertions" ,go-github.com-smartystreets-assertions)))
  667. (synopsis "Go testing tool with both a web and terminal user interface")
  668. (description
  669. "GoConvey is a testing tool for Go. It integrates with go test, can show
  670. test coverage and has a web user interface that will refresh automatically.")
  671. (home-page "https://github.com/smartystreets/goconvey")
  672. (license license:expat)))
  673. (define-public googletest
  674. (package
  675. (name "googletest")
  676. (version "1.10.0")
  677. (source
  678. (origin
  679. (method git-fetch)
  680. (uri (git-reference
  681. (url "https://github.com/google/googletest")
  682. (commit (string-append "release-" version))))
  683. (file-name (git-file-name name version))
  684. (sha256
  685. (base32 "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"))))
  686. (build-system cmake-build-system)
  687. (arguments
  688. `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
  689. (native-inputs
  690. `(("python" ,python-wrapper)))
  691. (home-page "https://github.com/google/googletest/")
  692. (synopsis "Test discovery and XUnit test framework")
  693. (description "Google Test features an XUnit test framework, automated test
  694. discovery, death tests, assertions, parameterized tests and XML test report
  695. generation.")
  696. (license license:bsd-3)))
  697. (define-public googletest-1.8
  698. (package
  699. (inherit googletest)
  700. (version "1.8.1")
  701. (source (origin
  702. (method git-fetch)
  703. (uri (git-reference
  704. (url "https://github.com/google/googletest")
  705. (commit (string-append "release-" version))))
  706. (file-name (git-file-name "googletest" version))
  707. (sha256
  708. (base32
  709. "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk"))))))
  710. (define-public googlebenchmark
  711. (package
  712. (name "googlebenchmark")
  713. (version "1.5.3")
  714. (home-page "https://github.com/google/benchmark")
  715. (source (origin
  716. (method git-fetch)
  717. (uri (git-reference (url home-page)
  718. (commit (string-append "v" version))))
  719. (file-name (git-file-name "google-benchmark" version))
  720. (sha256
  721. (base32
  722. "1hls0aqqj5cfldn9jfpvzjhpxkhrydrz9crp477rwllwjsybdxw7"))))
  723. (build-system cmake-build-system)
  724. (arguments
  725. '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON"
  726. (string-append
  727. "-DGOOGLETEST_PATH="
  728. (assoc-ref %build-inputs "googletest")))))
  729. (inputs
  730. `(("googletest" ,(package-source googletest))))
  731. (synopsis "C++ library to support the benchmarking of functions")
  732. (description
  733. "The googlebenchmark C++ library support the benchmarking of functions,
  734. similar to unit tests.")
  735. (license license:asl2.0)))
  736. (define-public cpputest
  737. (package
  738. (name "cpputest")
  739. (version "4.0")
  740. (source
  741. (origin
  742. (method url-fetch)
  743. (uri (string-append "https://github.com/cpputest/cpputest/releases/download/v"
  744. version "/cpputest-" version ".tar.gz"))
  745. (sha256
  746. (base32
  747. "1xslavlb1974y5xvs8n1j9zkk05dlw8imy4saasrjlmibl895ii1"))))
  748. (build-system gnu-build-system)
  749. (native-inputs
  750. `(("googletest" ,googletest)))
  751. (home-page "https://cpputest.github.io/")
  752. (synopsis "Unit testing and mocking framework for C/C++")
  753. (description
  754. "CppUTest is a C/C++ based unit xUnit test framework. It is written in
  755. C++ but is used in C and C++ projects and frequently used in embedded systems
  756. but it works for any C/C++ project.")
  757. (license license:bsd-3)))
  758. (define-public python-parameterized
  759. (package
  760. (name "python-parameterized")
  761. (version "0.7.4")
  762. (source
  763. (origin
  764. (method url-fetch)
  765. (uri (pypi-uri "parameterized" version))
  766. (sha256
  767. (base32 "1444fdz5bj0k10nmhxv0bv2gfrfisi7hfzqdndb0pvhf4g3qq3qr"))))
  768. (build-system python-build-system)
  769. (arguments
  770. '(#:phases (modify-phases %standard-phases
  771. (replace 'check
  772. (lambda* (#:key tests? #:allow-other-keys)
  773. (if tests?
  774. (invoke "nosetests" "-v")
  775. (format #t "test suite not run~%"))
  776. #t)))))
  777. (native-inputs
  778. `(("python-mock" ,python-mock)
  779. ("python-nose" ,python-nose)))
  780. (home-page "https://github.com/wolever/parameterized")
  781. (synopsis "Parameterized testing with any Python test framework")
  782. (description
  783. "Parameterized is a Python library that aims to fix parameterized testing
  784. for every Python test framework. It supports nose, py.test, and unittest.")
  785. (properties `((python2-variant . ,(delay python2-parameterized))))
  786. (license license:bsd-2)))
  787. (define-public python2-parameterized
  788. (let ((base (package-with-python2 (strip-python2-variant
  789. python-parameterized))))
  790. (package/inherit
  791. base
  792. (source
  793. (origin
  794. (inherit (package-source base))
  795. (patches (search-patches "python2-parameterized-docstring-test.patch")))))))
  796. (define-public python-minimock
  797. (package
  798. (name "python-minimock")
  799. (version "1.2.8")
  800. (source
  801. (origin
  802. (method url-fetch)
  803. (uri (pypi-uri "MiniMock" version))
  804. (sha256
  805. (base32
  806. "0k2sxb1ibnyg05iblz7zhbv825f1zk9906rab7883iqgvzmdzpsz"))))
  807. (build-system python-build-system)
  808. (home-page "https://pypi.org/project/MiniMock")
  809. (synopsis "Simple Python library for using mock objects")
  810. (description "MiniMock is a simple library for building mock objects with
  811. doctest.")
  812. (license license:expat)))
  813. (define-public python2-minimock
  814. (package-with-python2 python-minimock))
  815. (define-public python-mock
  816. (package
  817. (name "python-mock")
  818. (version "3.0.5")
  819. (source
  820. (origin
  821. (method url-fetch)
  822. (uri (pypi-uri "mock" version))
  823. (sha256
  824. (base32
  825. "1hrp6j0yrx2xzylfv02qa8kph661m6yq4p0mc8fnimch9j4psrc3"))))
  826. (propagated-inputs
  827. `(("python-six" ,python-six)))
  828. (build-system python-build-system)
  829. (arguments
  830. ;; FIXME: Tests require "pytest", which depends on this package.
  831. '(#:tests? #f))
  832. (home-page "https://github.com/testing-cabal/mock")
  833. (synopsis "Python mocking and patching library for testing")
  834. (description
  835. "Mock is a library for testing in Python. It allows you to replace parts
  836. of your system under test with mock objects and make assertions about how they
  837. have been used. This library is now part of Python (since Python 3.3),
  838. available via the @code{unittest.mock} module.")
  839. (properties `((python2-variant . ,(delay python2-mock))))
  840. (license license:expat)))
  841. (define-public python2-mock
  842. (let ((base (package-with-python2
  843. (strip-python2-variant python-mock))))
  844. (package/inherit base
  845. (propagated-inputs
  846. `(("python2-functools32" ,python2-functools32)
  847. ("python2-funcsigs" ,python2-funcsigs)
  848. ,@(package-propagated-inputs base))))))
  849. (define-public python-nose
  850. (package
  851. (name "python-nose")
  852. (version "1.3.7")
  853. (source
  854. (origin
  855. (method url-fetch)
  856. (uri (pypi-uri "nose" version))
  857. (sha256
  858. (base32
  859. "164a43k7k2wsqqk1s6vavcdamvss4mz0vd6pwzv2h9n8rgwzxgzi"))))
  860. (build-system python-build-system)
  861. (arguments
  862. '(#:tests? #f)) ; FIXME: test suite fails
  863. (home-page "http://readthedocs.org/docs/nose/")
  864. (synopsis "Python testing library")
  865. (description
  866. "Nose extends the unittest library to make testing easier.")
  867. (license license:lgpl2.0+)))
  868. (define-public python2-nose
  869. (package-with-python2 python-nose))
  870. (define-public python-nose2
  871. (package
  872. (name "python-nose2")
  873. (version "0.9.2")
  874. (source
  875. (origin
  876. (method url-fetch)
  877. (uri (pypi-uri "nose2" version))
  878. (sha256
  879. (base32
  880. "0pmbb6nk31yhgh4zkcblzxsznml7f7pf5q1ihgrwvbxv4mwzfql7"))))
  881. (build-system python-build-system)
  882. (arguments `(#:tests? #f)) ; 'module' object has no attribute 'collector'
  883. (propagated-inputs
  884. `(("python-cov-core" ,python-cov-core)
  885. ("python-pytest-cov" ,python-pytest-cov)
  886. ("python-six" ,python-six)))
  887. (home-page "https://github.com/nose-devs/nose2")
  888. (synopsis "Next generation of nicer testing for Python")
  889. (description
  890. "Nose2 is the next generation of nicer testing for Python, based on the
  891. plugins branch of unittest2. Nose2 aims to improve on nose by providing a
  892. better plugin api, being easier for users to configure, and simplifying internal
  893. interfaces and processes.")
  894. (license license:bsd-2)))
  895. (define-public python2-nose2
  896. (package-with-python2 python-nose2))
  897. (define-public python-unittest2
  898. (package
  899. (name "python-unittest2")
  900. (version "1.1.0")
  901. (source
  902. (origin
  903. (method url-fetch)
  904. (uri (pypi-uri "unittest2" version))
  905. (patches
  906. (search-patches "python-unittest2-python3-compat.patch"
  907. "python-unittest2-remove-argparse.patch"))
  908. (sha256
  909. (base32
  910. "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
  911. (build-system python-build-system)
  912. (arguments
  913. '(#:phases
  914. (modify-phases %standard-phases
  915. (replace 'check
  916. (lambda _
  917. (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
  918. (propagated-inputs
  919. `(("python-six" ,python-six)
  920. ("python-traceback2" ,python-traceback2)))
  921. (home-page "https://pypi.org/project/unittest2/")
  922. (synopsis "Python unit testing library")
  923. (description
  924. "Unittest2 is a replacement for the unittest module in the Python
  925. standard library.")
  926. (license license:psfl)))
  927. (define-public python2-unittest2
  928. (package-with-python2 python-unittest2))
  929. (define-public python-pytest
  930. (package
  931. (name "python-pytest")
  932. (version "6.2.1")
  933. (source
  934. (origin
  935. (method url-fetch)
  936. (uri (pypi-uri "pytest" version))
  937. (sha256
  938. (base32
  939. "01n3jny7m05r6g7gphbkj2xdms75ql93x69crd377hlvi6qikr36"))))
  940. (build-system python-build-system)
  941. (arguments
  942. `(#:phases
  943. (modify-phases %standard-phases
  944. (replace 'check
  945. (lambda* (#:key (tests? #t) #:allow-other-keys)
  946. (setenv "TERM" "dumb") ;attempt disabling markup tests
  947. (if tests?
  948. (invoke "pytest" "-vv" "-k"
  949. (string-append
  950. ;; This test involve the /usr directory, and fails.
  951. " not test_argcomplete"
  952. ;; These test do not honor the isatty detection and
  953. ;; fail.
  954. " and not test_code_highlight"
  955. " and not test_color_yes"))
  956. (format #t "test suite not run~%")))))))
  957. (propagated-inputs
  958. `(("python-attrs" ,python-attrs-bootstrap)
  959. ("python-iniconfig" ,python-iniconfig)
  960. ("python-more-itertools" ,python-more-itertools)
  961. ("python-packaging" ,python-packaging-bootstrap)
  962. ("python-pluggy" ,python-pluggy)
  963. ("python-py" ,python-py)
  964. ("python-six" ,python-six-bootstrap)
  965. ("python-toml" ,python-toml)
  966. ("python-wcwidth" ,python-wcwidth)))
  967. (native-inputs
  968. `(;; Tests need the "regular" bash since 'bash-final' lacks `compgen`.
  969. ("bash" ,bash)
  970. ("python-hypothesis" ,python-hypothesis)
  971. ("python-nose" ,python-nose)
  972. ("python-mock" ,python-mock)
  973. ("python-pytest" ,python-pytest-bootstrap)
  974. ("python-setuptools-scm" ,python-setuptools-scm)
  975. ("python-toml" ,python-toml)
  976. ("python-xmlschema" ,python-xmlschema)))
  977. (home-page "https://docs.pytest.org/en/latest/")
  978. (synopsis "Python testing library")
  979. (description
  980. "Pytest is a testing tool that provides auto-discovery of test modules
  981. and functions, detailed info on failing assert statements, modular fixtures,
  982. and many external plugins.")
  983. (license license:expat)
  984. (properties `((python2-variant . ,(delay python2-pytest))))))
  985. (define-public python-pytest-6 python-pytest)
  986. ;; Pytest 4.x are the last versions that support Python 2.
  987. (define-public python2-pytest
  988. (package
  989. (inherit (strip-python2-variant python-pytest))
  990. (name "python2-pytest")
  991. (version "4.6.11")
  992. (source (origin
  993. (method url-fetch)
  994. (uri (pypi-uri "pytest" version))
  995. (sha256
  996. (base32
  997. "0ls3pqr86xgif6bphsb6wrww9r2vc7p7a2naq8zcq8115wwq5yjh"))))
  998. (build-system python-build-system)
  999. (arguments
  1000. `(#:python ,python-2
  1001. ,@(package-arguments python-pytest)))
  1002. (propagated-inputs
  1003. `(("python-atomicwrites" ,python2-atomicwrites)
  1004. ("python-attrs" ,python2-attrs-bootstrap)
  1005. ("python-funcsigs" ,python2-funcsigs)
  1006. ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
  1007. ("python-more-itertools" ,python2-more-itertools)
  1008. ("python-packaging" ,python2-packaging-bootstrap)
  1009. ("python-pathlib2" ,python2-pathlib2)
  1010. ("python-pluggy" ,python2-pluggy)
  1011. ("python-py" ,python2-py)
  1012. ("python-six" ,python2-six-bootstrap)
  1013. ("python-wcwidth" ,python2-wcwidth)))
  1014. (native-inputs
  1015. `(("bash" ,bash) ;tests require 'compgen'
  1016. ("python-hypothesis" ,python2-hypothesis)
  1017. ("python-nose" ,python2-nose)
  1018. ("python-mock" ,python2-mock)
  1019. ("python-pytest" ,python2-pytest-bootstrap)
  1020. ("python-setuptools-scm" ,python2-setuptools-scm)))))
  1021. (define-public python-pytest-bootstrap
  1022. (package
  1023. (inherit (strip-python2-variant python-pytest))
  1024. (name "python-pytest-bootstrap")
  1025. (native-inputs `(("python-iniconfig" ,python-iniconfig)
  1026. ("python-setuptools-scm" ,python-setuptools-scm)
  1027. ("python-toml" ,python-toml)))
  1028. (arguments `(#:tests? #f))
  1029. (properties `((python2-variant . ,(delay python2-pytest-bootstrap))))))
  1030. (define-public python2-pytest-bootstrap
  1031. (hidden-package
  1032. (package/inherit
  1033. python2-pytest
  1034. (name "python2-pytest-bootstrap")
  1035. (arguments
  1036. (substitute-keyword-arguments (package-arguments python2-pytest)
  1037. ((#:tests? _ #f) #f)))
  1038. (native-inputs
  1039. `(("python-setuptools-scm" ,python2-setuptools-scm)))
  1040. (propagated-inputs
  1041. `(("python-atomicwrites" ,python2-atomicwrites)
  1042. ("python-attrs" ,python2-attrs-bootstrap)
  1043. ("python-funcsigs" ,python2-funcsigs-bootstrap)
  1044. ("python-importlib-metadata" ,python2-importlib-metadata-bootstrap)
  1045. ("python-more-itertools" ,python2-more-itertools)
  1046. ("python-packaging" ,python2-packaging-bootstrap)
  1047. ("python-pathlib2" ,python2-pathlib2-bootstrap)
  1048. ("python-pluggy" ,python2-pluggy-bootstrap)
  1049. ("python-py" ,python2-py)
  1050. ("python-wcwidth" ,python2-wcwidth))))))
  1051. (define-public python-pytest-cov
  1052. (package
  1053. (name "python-pytest-cov")
  1054. (version "2.8.1")
  1055. (source
  1056. (origin
  1057. (method url-fetch)
  1058. (uri (pypi-uri "pytest-cov" version))
  1059. (sha256
  1060. (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
  1061. (build-system python-build-system)
  1062. (arguments
  1063. `(#:phases
  1064. (modify-phases %standard-phases
  1065. (replace 'check
  1066. (lambda _
  1067. ;; Options taken from tox.ini.
  1068. ;; TODO: make "--restructuredtext" tests pass. They currently fail
  1069. ;; with "Duplicate implicit target name".
  1070. (invoke "python" "./setup.py" "check"
  1071. "--strict" "--metadata"))))))
  1072. (propagated-inputs
  1073. `(("python-coverage" ,python-coverage)
  1074. ("python-pytest" ,python-pytest)))
  1075. (home-page "https://github.com/pytest-dev/pytest-cov")
  1076. (synopsis "Pytest plugin for measuring coverage")
  1077. (description
  1078. "Pytest-cov produces coverage reports. It supports centralised testing and
  1079. distributed testing in both @code{load} and @code{each} modes. It also
  1080. supports coverage of subprocesses.")
  1081. (license license:expat)))
  1082. (define-public python2-pytest-cov
  1083. (package-with-python2 python-pytest-cov))
  1084. (define-public python-pytest-httpserver
  1085. (package
  1086. (name "python-pytest-httpserver")
  1087. (version "1.0.0")
  1088. (source (origin
  1089. (method url-fetch)
  1090. (uri (pypi-uri "pytest_httpserver" version))
  1091. (sha256
  1092. (base32
  1093. "0vbls0j570l5my83j4jnk5blmnir44i0w511azlh41nl6k8rac5f"))))
  1094. (build-system python-build-system)
  1095. (native-inputs
  1096. `(("python-pytest" ,python-pytest)))
  1097. (propagated-inputs
  1098. `(("python-werkzeug" ,python-werkzeug)))
  1099. (arguments
  1100. '(#:phases
  1101. (modify-phases %standard-phases
  1102. (add-before 'check 'fix-library-loading
  1103. (lambda _
  1104. (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") ":."))))
  1105. (replace 'check
  1106. (lambda _
  1107. (invoke "pytest" "tests" "-vv")
  1108. (invoke "pytest" "tests" "-vv" "--ssl"))))))
  1109. (home-page "https://github.com/csernazs/pytest-httpserver")
  1110. (synopsis "HTTP server for pytest")
  1111. (description "Pytest plugin library to test http clients without
  1112. contacting the real http server.")
  1113. (license license:expat)))
  1114. (define-public python-pytest-runner
  1115. (package
  1116. (name "python-pytest-runner")
  1117. (version "5.2")
  1118. (source
  1119. (origin
  1120. (method url-fetch)
  1121. (uri (pypi-uri "pytest-runner" version))
  1122. (sha256
  1123. (base32
  1124. "0awll1bva5zy8cspsxcpv7pjcrdf5c6pf56nqn4f74vvmlzfgiwn"))))
  1125. (build-system python-build-system)
  1126. (arguments
  1127. '(;; FIXME: The test suite requires 'python-flake8' and 'python-black',
  1128. ;; but that introduces a circular dependency.
  1129. #:tests? #f
  1130. #:phases (modify-phases %standard-phases
  1131. (replace 'check
  1132. (lambda* (#:key tests? #:allow-other-keys)
  1133. (if tests?
  1134. (invoke "pytest" "-vv")
  1135. (format #t "test suite not run~%"))
  1136. #t)))))
  1137. (native-inputs
  1138. `(("python-setuptools-scm" ,python-setuptools-scm)))
  1139. (home-page "https://github.com/pytest-dev/pytest-runner")
  1140. (synopsis "Invoke py.test as a distutils command")
  1141. (description
  1142. "This package provides a @command{pytest-runner} command that
  1143. @file{setup.py} files can use to run tests.")
  1144. (license license:expat)))
  1145. (define-public python2-pytest-runner
  1146. (package-with-python2 python-pytest-runner))
  1147. ;; python-bleach 3.1.0 requires this ancient version of pytest-runner.
  1148. ;; Remove once no longer needed.
  1149. (define-public python-pytest-runner-2
  1150. (package
  1151. (inherit python-pytest-runner)
  1152. (version "2.12.2")
  1153. (source (origin
  1154. (method url-fetch)
  1155. (uri (pypi-uri "pytest-runner" version))
  1156. (sha256
  1157. (base32
  1158. "11ivjj9hfphkv4yfb2g74av4yy86y8gcbf7gbif0p1hcdfnxg3w6"))))))
  1159. (define-public python2-pytest-runner-2
  1160. (package-with-python2 python-pytest-runner-2))
  1161. (define-public python-pytest-lazy-fixture
  1162. (package
  1163. (name "python-pytest-lazy-fixture")
  1164. (version "0.6.3")
  1165. (source
  1166. (origin
  1167. (method url-fetch)
  1168. (uri (pypi-uri "pytest-lazy-fixture" version))
  1169. (sha256
  1170. (base32 "1b0hmnsxw4s2wf9pks8dg6dfy5cx3zcbzs8517lfccxsfizhqz8f"))))
  1171. (build-system python-build-system)
  1172. (arguments
  1173. '(#:phases
  1174. (modify-phases %standard-phases
  1175. (replace 'check
  1176. (lambda* (#:key inputs outputs #:allow-other-keys)
  1177. ;; Make the installed plugin discoverable by Pytest.
  1178. (add-installed-pythonpath inputs outputs)
  1179. (invoke "pytest" "-vv"))))))
  1180. (propagated-inputs
  1181. `(("python-pytest" ,python-pytest)))
  1182. (home-page "https://github.com/tvorog/pytest-lazy-fixture")
  1183. (synopsis "Use fixtures in @code{pytest.mark.parametrize}")
  1184. (description "This plugin helps to use fixtures in
  1185. @code{pytest.mark.parametrize}.")
  1186. (license license:expat)))
  1187. (define-public python-pytest-mock
  1188. (package
  1189. (name "python-pytest-mock")
  1190. (version "3.6.1")
  1191. (source
  1192. (origin
  1193. (method url-fetch)
  1194. (uri (pypi-uri "pytest-mock" version))
  1195. (sha256 (base32
  1196. "0qhfmd05z3g88bnwq6644jl6p5wy01i4yy7h8883z9jjih2pl8a0"))))
  1197. (build-system python-build-system)
  1198. (arguments
  1199. `(#:phases
  1200. (modify-phases %standard-phases
  1201. (replace 'check
  1202. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  1203. (when tests?
  1204. (add-installed-pythonpath inputs outputs)
  1205. ;; Skip the assertion rewriting tests, which don't work in the
  1206. ;; presence of read-only Python modules (a limitation of
  1207. ;; Pytest). Also skip the "test_standalone_mock" test, which
  1208. ;; can only work when 'python-mock' is not available
  1209. ;; (currently propagated by Pytest 5).
  1210. (invoke "pytest" "--assert=plain"
  1211. "-k" "not test_standalone_mock")))))))
  1212. (native-inputs
  1213. `(("python-setuptools-scm" ,python-setuptools-scm)))
  1214. (propagated-inputs
  1215. `(("python-pytest" ,python-pytest)
  1216. ("python-pytest-asyncio" ,python-pytest-asyncio)))
  1217. (home-page "https://github.com/pytest-dev/pytest-mock/")
  1218. (synopsis "Thin-wrapper around the mock package for easier use with py.test")
  1219. (description
  1220. "This plugin installs a @code{mocker} fixture which is a thin-wrapper
  1221. around the patching API provided by the @code{mock} package, but with the
  1222. benefit of not having to worry about undoing patches at the end of a test.
  1223. The mocker fixture has the same API as @code{mock.patch}, supporting the
  1224. same arguments.")
  1225. (properties `((python2-variant . ,(delay python2-pytest-mock))))
  1226. (license license:expat)))
  1227. (define-public python2-pytest-mock
  1228. (let ((base (package-with-python2
  1229. (strip-python2-variant python-pytest-mock))))
  1230. (package/inherit base
  1231. (propagated-inputs
  1232. `(("python2-mock" ,python2-mock)
  1233. ,@(package-propagated-inputs base))))))
  1234. (define-public python-pytest-xdist
  1235. (package
  1236. (name "python-pytest-xdist")
  1237. (version "2.1.0")
  1238. (source
  1239. (origin
  1240. (method url-fetch)
  1241. (uri (pypi-uri "pytest-xdist" version))
  1242. (sha256
  1243. (base32
  1244. "0wh6pn66nncfs6ay0n863bgyriwsgppn8flx5l7551j1lbqkinc2"))
  1245. (modules '((guix build utils)))
  1246. (snippet
  1247. '(begin
  1248. ;; Remove pre-compiled .pyc files from source.
  1249. (for-each delete-file-recursively
  1250. (find-files "." "__pycache__" #:directories? #t))
  1251. (for-each delete-file (find-files "." "\\.pyc$"))
  1252. #t))))
  1253. (build-system python-build-system)
  1254. (arguments
  1255. '(#:tests? #f ; Lots of tests fail.
  1256. #:phases
  1257. (modify-phases %standard-phases
  1258. (add-after 'unpack 'patch-setup-py
  1259. (lambda _
  1260. ;; Relax pytest requirement.
  1261. (substitute* "setup.py"
  1262. (("pytest>=6\\.0\\.0") "pytest"))))
  1263. (replace 'check
  1264. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  1265. (when tests?
  1266. (add-installed-pythonpath inputs outputs)
  1267. (invoke "pytest" "-vv"
  1268. "-n" (number->string (parallel-job-count)))))))))
  1269. (native-inputs
  1270. `(("python-setuptools-scm" ,python-setuptools-scm)))
  1271. (propagated-inputs
  1272. `(("python-execnet" ,python-execnet)
  1273. ("python-pytest" ,python-pytest)
  1274. ("python-py" ,python-py)
  1275. ("python-pytest-forked" ,python-pytest-forked)))
  1276. (home-page
  1277. "https://github.com/pytest-dev/pytest-xdist")
  1278. (synopsis
  1279. "Plugin for py.test with distributed testing and loop-on-failing modes")
  1280. (description
  1281. "The pytest-xdist plugin extends py.test with some unique test execution
  1282. modes: parallelization, running tests in boxed subprocesses, the ability
  1283. to run tests repeatedly when failed, and the ability to run tests on multiple
  1284. Python interpreters or platforms. It uses rsync to copy the existing
  1285. program code to a remote location, executes there, and then syncs the
  1286. result back.")
  1287. (license license:expat)))
  1288. (define-public python2-pytest-xdist
  1289. (package-with-python2 python-pytest-xdist))
  1290. (define-public python-pytest-xdist-next
  1291. (package/inherit python-pytest-xdist
  1292. (name "python-pytest-xdist")
  1293. (version "2.3.0")
  1294. (source
  1295. (origin
  1296. (method url-fetch)
  1297. (uri (pypi-uri "pytest-xdist" version))
  1298. (sha256
  1299. (base32
  1300. "19cy57jrf3pwi7x6fnbxryjvqagsl0yv736jnynvr3yqhlpxxv78"))))
  1301. (propagated-inputs
  1302. `(("python-execnet" ,python-execnet)
  1303. ("python-pytest" ,python-pytest-6)
  1304. ("python-pytest-forked" ,python-pytest-forked)))))
  1305. (define-public python-pytest-timeout
  1306. (package
  1307. (name "python-pytest-timeout")
  1308. (version "1.4.2")
  1309. (source
  1310. (origin
  1311. (method url-fetch)
  1312. (uri (pypi-uri "pytest-timeout" version))
  1313. (sha256
  1314. (base32
  1315. "0xnsigs0kmpq1za0d4i522sp3f71x5bgpdh3ski0rs74yqy13cr0"))))
  1316. (build-system python-build-system)
  1317. (arguments
  1318. '(#:phases (modify-phases %standard-phases
  1319. (replace 'check
  1320. (lambda* (#:key inputs outputs #:allow-other-keys)
  1321. ;; Make the installed plugin discoverable by Pytest.
  1322. (add-installed-pythonpath inputs outputs)
  1323. (invoke "pytest" "-vv"))))))
  1324. (propagated-inputs
  1325. `(("python-pytest" ,python-pytest)
  1326. ("python-pytest-cov" ,python-pytest-cov)))
  1327. (native-inputs
  1328. `(("python-pexpect" ,python-pexpect)))
  1329. (home-page "https://github.com/pytest-dev/pytest-timeout")
  1330. (synopsis "Plugin for py.test to abort hanging tests")
  1331. (description
  1332. "This package provides a py.test plugin that aborts hanging tests after a
  1333. timeout has been exceeded.")
  1334. (license license:expat)))
  1335. (define-public python-pytest-forked
  1336. (package
  1337. (name "python-pytest-forked")
  1338. (version "1.3.0")
  1339. (source
  1340. (origin
  1341. (method git-fetch) ;for tests
  1342. (uri (git-reference
  1343. (url "https://github.com/pytest-dev/pytest-forked")
  1344. (commit (string-append "v" version))))
  1345. (file-name (git-file-name name version))
  1346. (sha256
  1347. (base32
  1348. "1aip4kx50ynvykl7kq2mlbsi82vx701dvb8mm64lhp69bbv105rc"))))
  1349. (build-system python-build-system)
  1350. (arguments
  1351. `(#:phases
  1352. (modify-phases %standard-phases
  1353. (add-after 'unpack 'disable-setuptools-scm
  1354. (lambda _
  1355. (substitute* "setup.py"
  1356. (("use_scm_version=True")
  1357. (format #f "version=~s" ,version))
  1358. (("setup_requires=\\['setuptools_scm'\\],.*")
  1359. ""))))
  1360. (replace 'check
  1361. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  1362. (when tests?
  1363. (add-installed-pythonpath inputs outputs)
  1364. (invoke "pytest" "-vv")))))))
  1365. (native-inputs
  1366. ;; XXX: The bootstrap variant of Pytest is used to ensure the
  1367. ;; 'hypothesis' plugin is not in the environment (due to
  1368. ;; <http://issues.guix.gnu.org/25235>), which would cause the test suite
  1369. ;; to fail (see: https://github.com/pytest-dev/pytest-forked/issues/54).
  1370. `(("python-pytest" ,python-pytest-bootstrap)))
  1371. (home-page "https://github.com/pytest-dev/pytest-forked")
  1372. (synopsis "Pytest plugin to run tests in isolated forked subprocesses")
  1373. (description "This package provides a Pytest plugin which enables running
  1374. each test in a subprocess and will report if a test crashed the process. It
  1375. can be useful to isolate tests against undesirable global environment
  1376. side-effects (such as setting environment variables).")
  1377. (license license:expat)))
  1378. (define-public python-scripttest
  1379. (package
  1380. (name "python-scripttest")
  1381. (version "1.3")
  1382. (source
  1383. (origin
  1384. (method url-fetch)
  1385. (uri (pypi-uri "scripttest" version))
  1386. (sha256
  1387. (base32
  1388. "0f4w84k8ck82syys7yg9maz93mqzc8p5ymis941x034v44jzq74m"))))
  1389. (build-system python-build-system)
  1390. (native-inputs
  1391. `(("python-pytest" ,python-pytest)))
  1392. (home-page (string-append "https://web.archive.org/web/20161029233413/"
  1393. "http://pythonpaste.org/scripttest/"))
  1394. (synopsis "Python library to test command-line scripts")
  1395. (description "Scripttest is a Python helper library for testing
  1396. interactive command-line applications. With it you can run a script in a
  1397. subprocess and see the output as well as any file modifications.")
  1398. (license license:expat)))
  1399. (define-public python-testtools-bootstrap
  1400. (package
  1401. (name "python-testtools-bootstrap")
  1402. (version "2.5.0")
  1403. (source
  1404. (origin
  1405. (method url-fetch)
  1406. (uri (pypi-uri "testtools" version))
  1407. (sha256
  1408. (base32
  1409. "0gxjbjk93jjqi491k4s9rh3ia37v21yifd35pvizv7sgv4rk9hap"))))
  1410. (build-system python-build-system)
  1411. (arguments '(#:tests? #f))
  1412. (propagated-inputs
  1413. `(("python-extras" ,python-extras)
  1414. ("python-fixtures" ,python-fixtures-bootstrap)
  1415. ("python-pbr" ,python-pbr-minimal)))
  1416. (home-page "https://github.com/testing-cabal/testtools")
  1417. (synopsis
  1418. "Extensions to the Python standard library unit testing framework")
  1419. (description
  1420. "This package is only for bootstrapping. Do not use this.")
  1421. (license license:psfl)))
  1422. (define-public python-testtools
  1423. (package
  1424. (inherit python-testtools-bootstrap)
  1425. (name "python-testtools")
  1426. (arguments
  1427. `(#:phases
  1428. (modify-phases %standard-phases
  1429. (replace 'check
  1430. (lambda* (#:key tests? #:allow-other-keys)
  1431. (when tests?
  1432. (invoke "python" "-m" "testtools.run"
  1433. "testtools.tests.test_suite")))))))
  1434. (propagated-inputs
  1435. `(("python-extras" ,python-extras)
  1436. ("python-fixtures" ,python-fixtures)
  1437. ("python-pbr" ,python-pbr)))
  1438. (native-inputs
  1439. `(("python-testscenarios" ,python-testscenarios-bootstrap)))
  1440. (description
  1441. "Testtools extends the Python standard library unit testing framework to
  1442. provide matchers, more debugging information, and cross-Python
  1443. compatibility.")))
  1444. (define-public python-testscenarios-bootstrap
  1445. (package
  1446. (name "python-testscenarios-bootstrap")
  1447. (version "0.5.0")
  1448. (source
  1449. (origin
  1450. (method url-fetch)
  1451. (uri (pypi-uri "testscenarios" version))
  1452. (sha256
  1453. (base32
  1454. "1dm2aydqpv76vnsk1pw7k8n42hq58cfi4n1ixy7nyzpaj1mwnmy2"))))
  1455. (build-system python-build-system)
  1456. (arguments
  1457. `(#:phases (modify-phases %standard-phases
  1458. (replace 'check
  1459. (lambda _
  1460. (invoke "python" "-m" "testtools.run"
  1461. "testscenarios.test_suite"))))))
  1462. (propagated-inputs
  1463. `(("python-pbr" ,python-pbr-minimal)
  1464. ("python-testtools" ,python-testtools-bootstrap)))
  1465. (home-page "https://launchpad.net/testscenarios")
  1466. (synopsis "Pyunit extension for dependency injection")
  1467. (description
  1468. "This package is only for bootstrapping. Don't use this.")
  1469. (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
  1470. (define-public python-testscenarios
  1471. (package
  1472. (inherit python-testscenarios-bootstrap)
  1473. (name "python-testscenarios")
  1474. (propagated-inputs
  1475. `(("python-pbr" ,python-pbr)
  1476. ("python-testtools" ,python-testtools)))
  1477. (description
  1478. "Testscenarios provides clean dependency injection for Python unittest
  1479. style tests.")))
  1480. ;; Testresources requires python-pbr at runtime, but pbr needs it for its
  1481. ;; own tests. Hence this bootstrap variant.
  1482. (define-public python-testresources-bootstrap
  1483. (package
  1484. (name "python-testresources-bootstrap")
  1485. (version "2.0.1")
  1486. (source (origin
  1487. (method url-fetch)
  1488. (uri (pypi-uri "testresources" version))
  1489. (sha256
  1490. (base32
  1491. "05s4dsli9g17m1r3b1gvwicbbgq011hnpb2b9qnj27ja2n11k7gf"))))
  1492. (build-system python-build-system)
  1493. (arguments '(#:tests? #f))
  1494. (propagated-inputs
  1495. `(("python-pbr" ,python-pbr-minimal)))
  1496. (home-page "https://launchpad.net/testresources")
  1497. (synopsis
  1498. "Pyunit extension for managing test resources")
  1499. (description
  1500. "This package is only here for bootstrapping purposes. Use the regular
  1501. testresources package instead.")
  1502. (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
  1503. (define-public python-testresources
  1504. (package
  1505. (inherit python-testresources-bootstrap)
  1506. (name "python-testresources")
  1507. (propagated-inputs
  1508. `(("python-pbr" ,python-pbr)))
  1509. (arguments '())
  1510. (native-inputs
  1511. `(("python-fixtures" ,python-fixtures)
  1512. ("python-testtols" ,python-testtools)))
  1513. (description
  1514. "Testresources is an extension to Python's unittest to allow declarative
  1515. use of resources by test cases.")))
  1516. (define-public python-subunit-bootstrap
  1517. (package
  1518. (name "python-subunit-bootstrap")
  1519. (version "1.4.0")
  1520. (source
  1521. (origin
  1522. (method url-fetch)
  1523. (uri (pypi-uri "python-subunit" version))
  1524. (sha256
  1525. (base32
  1526. "0j0ymmnc5nfxi1qzvy59j27viqca7l7xd0y9x29g7yr0h693j804"))))
  1527. (build-system python-build-system)
  1528. (propagated-inputs
  1529. `(("python-extras" ,python-extras)
  1530. ("python-testtools" ,python-testtools-bootstrap)))
  1531. (native-inputs
  1532. `(("python-fixtures" ,python-fixtures-bootstrap)
  1533. ("python-hypothesis" ,python-hypothesis)
  1534. ("python-testscenarios" ,python-testscenarios-bootstrap)))
  1535. (home-page "https://launchpad.net/subunit")
  1536. (synopsis "Python implementation of the subunit protocol")
  1537. (description
  1538. "This package is here for bootstrapping purposes only. Use the regular
  1539. python-subunit package instead.")
  1540. (license (list license:bsd-3 license:asl2.0)))) ; at the user's option
  1541. (define-public python-subunit
  1542. (package
  1543. (inherit python-subunit-bootstrap)
  1544. (name "python-subunit")
  1545. (propagated-inputs
  1546. `(("python-extras" ,python-extras)
  1547. ("python-testtools" ,python-testtools)))
  1548. (native-inputs
  1549. `(("python-fixtures" ,python-fixtures)
  1550. ("python-hypothesis" ,python-hypothesis)
  1551. ("python-testscenarios" ,python-testscenarios)))
  1552. (description
  1553. "Python-subunit is a Python implementation of the subunit test streaming
  1554. protocol.")))
  1555. ;; Fixtures requires python-pbr at runtime, but pbr uses fixtures for its
  1556. ;; own tests. Hence this bootstrap variant.
  1557. (define-public python-fixtures-bootstrap
  1558. (package
  1559. (name "python-fixtures-bootstrap")
  1560. (version "3.0.0")
  1561. (source
  1562. (origin
  1563. (method url-fetch)
  1564. (uri (pypi-uri "fixtures" version))
  1565. (sha256
  1566. (base32
  1567. "1vxj29bzz3rd4pcy51d05wng9q9dh4jq6wx92yklsm7i6h1ddw7w"))
  1568. (patches (search-patches "python-fixtures-remove-monkeypatch-test.patch"))))
  1569. (build-system python-build-system)
  1570. (arguments
  1571. `(#:tests? #f
  1572. #:phases
  1573. (modify-phases %standard-phases
  1574. ;; Package is not loadable on its own at this stage.
  1575. (delete 'sanity-check))))
  1576. (propagated-inputs
  1577. `(("python-pbr-minimal" ,python-pbr-minimal)
  1578. ("python-six" ,python-six)))
  1579. (home-page "https://launchpad.net/python-fixtures")
  1580. (synopsis "Python test fixture library")
  1581. (description
  1582. "This package is only used for bootstrapping. Use the regular
  1583. python-fixtures package instead.")
  1584. (license (list license:bsd-3 license:asl2.0)))) ; at user's option
  1585. (define-public python-fixtures
  1586. (package
  1587. (inherit python-fixtures-bootstrap)
  1588. (name "python-fixtures")
  1589. (arguments
  1590. '(#:phases
  1591. (modify-phases %standard-phases
  1592. (replace 'check
  1593. (lambda* (#:key tests? #:allow-other-keys)
  1594. (when tests?
  1595. (invoke "python" "-m" "testtools.run"
  1596. "fixtures.test_suite")))))))
  1597. (propagated-inputs
  1598. ;; Fixtures uses pbr at runtime to check versions, etc.
  1599. `(("python-pbr" ,python-pbr)
  1600. ("python-six" ,python-six)))
  1601. (native-inputs
  1602. `(("python-mock" ,python-mock)
  1603. ("python-testtools" ,python-testtools-bootstrap)))
  1604. (description
  1605. "Fixtures provides a way to create reusable state, useful when writing
  1606. Python tests.")))
  1607. (define-public python-testrepository-bootstrap
  1608. (package
  1609. (name "python-testrepository-bootstrap")
  1610. (version "0.0.20")
  1611. (source
  1612. (origin
  1613. (method url-fetch)
  1614. (uri (pypi-uri "testrepository" version))
  1615. (sha256
  1616. (base32
  1617. "1ssqb07c277010i6gzzkbdd46gd9mrj0bi0i8vn560n2k2y4j93m"))))
  1618. (build-system python-build-system)
  1619. (arguments '(#:tests? #f))
  1620. (propagated-inputs
  1621. `(("python-fixtures" ,python-fixtures-bootstrap)
  1622. ("python-subunit" ,python-subunit-bootstrap)
  1623. ("python-testtools" ,python-testtools-bootstrap)))
  1624. (native-inputs
  1625. `(("python-mimeparse" ,python-mimeparse)))
  1626. (home-page "https://launchpad.net/testrepository")
  1627. (synopsis "Database for Python test results")
  1628. (description
  1629. "Bootstrap package for python-testrepository. Don't use this.")
  1630. (license (list license:bsd-3 license:asl2.0)))) ; at user's option
  1631. (define-public python-testrepository
  1632. (package
  1633. (inherit python-testrepository-bootstrap)
  1634. (name "python-testrepository")
  1635. (arguments
  1636. ;; FIXME: Many tests are failing.
  1637. '(#:tests? #f))
  1638. (propagated-inputs
  1639. `(("python-fixtures" ,python-fixtures)
  1640. ("python-subunit" ,python-subunit)
  1641. ("python-testtools" ,python-testtools)))
  1642. (native-inputs
  1643. `(("python-mimeparse" ,python-mimeparse)))
  1644. (description "Testrepository provides a database of test results which can
  1645. be used as part of a developer's workflow to check things such as what tests
  1646. have failed since the last commit or what tests are currently failing.")))
  1647. (define-public python-coverage
  1648. (package
  1649. (name "python-coverage")
  1650. (version "5.2.1")
  1651. (source
  1652. (origin
  1653. (method url-fetch)
  1654. (uri (pypi-uri "coverage" version))
  1655. (sha256
  1656. (base32
  1657. "16z8i18msgs8k74n73dj9x49wzkl0vk4vq8k5pl1bsj70y7b4k53"))))
  1658. (build-system python-build-system)
  1659. (arguments
  1660. ;; FIXME: 95 tests failed, 539 passed, 6 skipped, 2 errors.
  1661. '(#:tests? #f))
  1662. (home-page "https://coverage.readthedocs.io")
  1663. (synopsis "Code coverage measurement for Python")
  1664. (description
  1665. "Coverage measures code coverage, typically during test execution. It
  1666. uses the code analysis tools and tracing hooks provided in the Python standard
  1667. library to determine which lines are executable, and which have been
  1668. executed.")
  1669. (license license:bsd-3)))
  1670. (define-public python2-coverage
  1671. (package-with-python2 python-coverage))
  1672. (define-public python-pytest-asyncio
  1673. (package
  1674. (name "python-pytest-asyncio")
  1675. (version "0.15.1")
  1676. (source
  1677. (origin
  1678. (method git-fetch) ;for tests
  1679. (uri (git-reference
  1680. (url "https://github.com/pytest-dev/pytest-asyncio")
  1681. (commit (string-append "v" version))))
  1682. (file-name (git-file-name name version))
  1683. (sha256
  1684. (base32 "03drs4myv1ik79148xyhli37q6mp931jb14cz65n8qvls2zvvwgx"))))
  1685. (build-system python-build-system)
  1686. (native-inputs
  1687. `(("python-coverage" ,python-coverage)
  1688. ("python-async-generator" ,python-async-generator)
  1689. ("python-hypothesis" ,python-hypothesis)
  1690. ("python-pytest" ,python-pytest)))
  1691. (home-page "https://github.com/pytest-dev/pytest-asyncio")
  1692. (synopsis "Pytest support for asyncio")
  1693. (description "Python asyncio code is usually written in the form of
  1694. coroutines, which makes it slightly more difficult to test using normal
  1695. testing tools. @code{pytest-asyncio} provides useful fixtures and markers
  1696. to make testing async code easier.")
  1697. (license license:asl2.0)))
  1698. (define-public python-cov-core
  1699. (package
  1700. (name "python-cov-core")
  1701. (version "1.15.0")
  1702. (source
  1703. (origin
  1704. (method url-fetch)
  1705. (uri (pypi-uri "cov-core" version))
  1706. (sha256
  1707. (base32
  1708. "0k3np9ymh06yv1ib96sb6wfsxjkqhmik8qfsn119vnhga9ywc52a"))))
  1709. (build-system python-build-system)
  1710. (propagated-inputs
  1711. `(("python-coverage" ,python-coverage)))
  1712. (home-page "https://github.com/schlamar/cov-core")
  1713. (synopsis "Coverage plugin core for pytest-cov, nose-cov and nose2-cov")
  1714. (description
  1715. "This is a library package for use by @code{pytest-cov}, @code{nose-cov}
  1716. and @code{nose2-cov}. It is useful for developing coverage plugins for these
  1717. testing frameworks.")
  1718. (license license:expat)))
  1719. (define-public python2-cov-core
  1720. (package-with-python2 python-cov-core))
  1721. (define-public python-codecov
  1722. (package
  1723. (name "python-codecov")
  1724. (version "2.0.15")
  1725. (source
  1726. (origin
  1727. (method url-fetch)
  1728. (uri (pypi-uri "codecov" version))
  1729. (sha256
  1730. (base32
  1731. "1217c0vqf7ii65635gvl27a5pfhv0r7zhrpdp9cx640hg73bgn4f"))))
  1732. (build-system python-build-system)
  1733. (native-inputs
  1734. `(("python-unittest2" ,python-unittest2)))
  1735. (propagated-inputs
  1736. `(("python-coverage" ,python-coverage)
  1737. ("python-requests" ,python-requests)))
  1738. (home-page "https://github.com/codecov/codecov-python")
  1739. (synopsis "Upload code coverage reports to @code{codecov.io}")
  1740. (description
  1741. "Codecov collects code coverage reports from code written in Python, Java,
  1742. C/C++, R, and more, and uploads it to the @code{codecov.io} service.")
  1743. (license license:asl2.0)))
  1744. (define-public python-testpath
  1745. (package
  1746. (name "python-testpath")
  1747. (version "0.4.4")
  1748. (source
  1749. (origin
  1750. (method git-fetch)
  1751. (uri (git-reference
  1752. (url "https://github.com/jupyter/testpath")
  1753. (commit version)))
  1754. (file-name (git-file-name name version))
  1755. (sha256
  1756. (base32
  1757. "1fwv4d3p54xx1x942s104irr35lszvv6jnr4nn1scsfvc0m1qmbk"))))
  1758. (build-system python-build-system)
  1759. (arguments
  1760. `(#:tests? #f ; this package does not even have a setup.py
  1761. #:modules ((guix build python-build-system)
  1762. (guix build utils)
  1763. (srfi srfi-1))
  1764. #:phases
  1765. (modify-phases %standard-phases
  1766. (replace 'build
  1767. (lambda _
  1768. ;; A ZIP archive should be generated, but it fails with "ZIP does
  1769. ;; not support timestamps before 1980". Luckily,
  1770. ;; SOURCE_DATE_EPOCH is respected, which we set to some time in
  1771. ;; 1980.
  1772. (setenv "SOURCE_DATE_EPOCH" "315532800")
  1773. (invoke "flit" "build")))
  1774. (replace 'install
  1775. (lambda* (#:key inputs outputs #:allow-other-keys)
  1776. (add-installed-pythonpath inputs outputs)
  1777. (let ((out (assoc-ref outputs "out")))
  1778. (for-each (lambda (wheel)
  1779. (format #true wheel)
  1780. (invoke "python" "-m" "pip" "install"
  1781. wheel (string-append "--prefix=" out)))
  1782. (find-files "dist" "\\.whl$"))))))))
  1783. (native-inputs
  1784. `(("python-flit" ,python-flit)))
  1785. (home-page "https://github.com/takluyver/testpath")
  1786. (synopsis "Test utilities for code working with files and commands")
  1787. (description
  1788. "Testpath is a collection of utilities for Python code working with files
  1789. and commands. It contains functions to check things on the file system, and
  1790. tools for mocking system commands and recording calls to those.")
  1791. (license license:expat)))
  1792. (define-public python-testlib
  1793. (package
  1794. (name "python-testlib")
  1795. (version "0.6.5")
  1796. (source
  1797. (origin
  1798. (method url-fetch)
  1799. (uri (pypi-uri "testlib" version ".zip"))
  1800. (sha256
  1801. (base32 "1mz26cxn4x8bbgv0rn0mvj2z05y31rkc8009nvdlb3lam5b4mj3y"))))
  1802. (build-system python-build-system)
  1803. (native-inputs
  1804. `(("unzip" ,unzip))) ; for unpacking the source
  1805. (synopsis "Python micro test suite harness")
  1806. (description "A micro unittest suite harness for Python.")
  1807. (home-page "https://github.com/trentm/testlib")
  1808. (license license:expat)))
  1809. (define-public python2-testlib
  1810. (package-with-python2 python-testlib))
  1811. ;;; The software provided by this package was integrated into pytest 2.8.
  1812. (define-public python-pytest-cache
  1813. (package
  1814. (name "python-pytest-cache")
  1815. (version "1.0")
  1816. (source (origin
  1817. (method url-fetch)
  1818. (uri (pypi-uri "pytest-cache" version))
  1819. (sha256
  1820. (base32
  1821. "1a873fihw4rhshc722j4h6j7g3nj7xpgsna9hhg3zn6ksknnhx5y"))))
  1822. (build-system python-build-system)
  1823. (propagated-inputs
  1824. `(("python-apipkg" ,python-apipkg)
  1825. ("python-execnet" ,python-execnet)
  1826. ("python-py" ,python-py)
  1827. ("python-pytest" ,python-pytest)))
  1828. (synopsis "Py.test plugin with mechanisms for caching across test runs")
  1829. (description "The pytest-cache plugin provides tools to rerun failures from
  1830. the last py.test invocation.")
  1831. (home-page "https://bitbucket.org/hpk42/pytest-cache/")
  1832. (license license:expat)))
  1833. (define-public python2-pytest-cache
  1834. (package-with-python2 python-pytest-cache))
  1835. (define-public python-pytest-localserver
  1836. (package
  1837. (name "python-pytest-localserver")
  1838. (version "0.5.0")
  1839. (source (origin
  1840. (method url-fetch)
  1841. (uri (pypi-uri "pytest-localserver" version))
  1842. (sha256
  1843. (base32
  1844. "1hpgpxrpfq5c731ndnsay2lc0y9nh2wy9fn1f83s3z8xkn82fm1s"))))
  1845. (build-system python-build-system)
  1846. (arguments
  1847. '(#:phases
  1848. (modify-phases %standard-phases
  1849. (replace 'check
  1850. (lambda _
  1851. (invoke "py.test" "-v"))))))
  1852. (native-inputs
  1853. `(("python-pytest" ,python-pytest)
  1854. ("python-requests" ,python-requests)
  1855. ("python-six" ,python-six)))
  1856. (propagated-inputs
  1857. `(("python-werkzeug" ,python-werkzeug)))
  1858. (synopsis "Py.test plugin to test server connections locally")
  1859. (description "Pytest-localserver is a plugin for the pytest testing
  1860. framework which enables you to test server connections locally.")
  1861. (home-page "https://pypi.org/project/pytest-localserver/")
  1862. (license license:expat)))
  1863. (define-public python-pytest-xprocess
  1864. (package
  1865. (name "python-pytest-xprocess")
  1866. (version "0.18.1")
  1867. (source (origin
  1868. (method url-fetch)
  1869. (uri (pypi-uri "pytest-xprocess" version))
  1870. (sha256
  1871. (base32
  1872. "0rm2rchrr63imn44xk5slwydxf8gvy579524qcxq7dc42pnk17zx"))))
  1873. (build-system python-build-system)
  1874. (native-inputs
  1875. `(("python-setuptools-scm" ,python-setuptools-scm)))
  1876. (propagated-inputs
  1877. `(("python-pytest" ,python-pytest)
  1878. ("python-psutil" ,python-psutil)))
  1879. (synopsis "Pytest plugin to manage external processes across test runs")
  1880. (description "Pytest-xprocess is an experimental py.test plugin for managing
  1881. processes across test runs.")
  1882. (home-page "https://github.com/pytest-dev/pytest-xprocess/")
  1883. (license license:expat)))
  1884. (define-public python-pytest-subtesthack
  1885. (package
  1886. (name "python-pytest-subtesthack")
  1887. (version "0.1.1")
  1888. (source (origin
  1889. (method url-fetch)
  1890. (uri (pypi-uri "pytest-subtesthack" version))
  1891. (sha256
  1892. (base32
  1893. "15kzcr5pchf3id4ikdvlv752rc0j4d912n589l4rifp8qsj19l1x"))))
  1894. (build-system python-build-system)
  1895. (propagated-inputs
  1896. `(("python-pytest" ,python-pytest)))
  1897. (synopsis "Set-up and tear-down fixtures for unit tests")
  1898. (description "This plugin allows you to set up and tear down fixtures within
  1899. unit test functions that use @code{py.test}. This is useful for using
  1900. @command{hypothesis} inside py.test, as @command{hypothesis} will call the test
  1901. function multiple times, without setting up or tearing down fixture state as is
  1902. normally the case.")
  1903. (home-page "https://github.com/untitaker/pytest-subtesthack/")
  1904. (license license:unlicense)))
  1905. (define-public python2-pytest-subtesthack
  1906. (package-with-python2 python-pytest-subtesthack))
  1907. (define-public python-pytest-sugar
  1908. (package
  1909. (name "python-pytest-sugar")
  1910. (version "0.9.3")
  1911. (source
  1912. (origin
  1913. (method url-fetch)
  1914. (uri (pypi-uri "pytest-sugar" version))
  1915. (sha256
  1916. (base32 "1i0hv3h49zvl62jbiyjag84carbrp3zprqzxffdr291nxavvac0n"))))
  1917. (build-system python-build-system)
  1918. (propagated-inputs
  1919. `(("python-packaging" ,python-packaging)
  1920. ("python-pytest" ,python-pytest)
  1921. ("python-termcolor" ,python-termcolor)))
  1922. (home-page "https://pivotfinland.com/pytest-sugar/")
  1923. (synopsis "Plugin for pytest that changes the default look and feel")
  1924. (description
  1925. "@code{pytest-sugar} is a plugin for py.test that changes the default
  1926. look and feel of py.test, using a progress bar and showing failures and errors
  1927. instantly.")
  1928. (license license:bsd-3)))
  1929. (define-public python-hypothesis
  1930. (package
  1931. (name "python-hypothesis")
  1932. (version "6.0.2")
  1933. (source (origin
  1934. (method url-fetch)
  1935. (uri (pypi-uri "hypothesis" version))
  1936. (sha256
  1937. (base32
  1938. "0wj7ip779naf2n076nylf2gi0sjz68z1ir9d9r2rgs7br18naqdf"))))
  1939. (build-system python-build-system)
  1940. (arguments
  1941. ;; XXX: Tests are not distributed with the PyPI archive.
  1942. '(#:tests? #f))
  1943. (propagated-inputs
  1944. `(("python-attrs" ,python-attrs-bootstrap)
  1945. ("python-sortedcontainers" ,python-sortedcontainers)))
  1946. (synopsis "Library for property based testing")
  1947. (description "Hypothesis is a library for testing your Python code against a
  1948. much larger range of examples than you would ever want to write by hand. It’s
  1949. based on the Haskell library, Quickcheck, and is designed to integrate
  1950. seamlessly into your existing Python unit testing work flow.")
  1951. (home-page "https://github.com/HypothesisWorks/hypothesis-python")
  1952. (license license:mpl2.0)
  1953. (properties `((python2-variant . ,(delay python2-hypothesis))))))
  1954. ;; This is the last version of Hypothesis that supports Python 2.
  1955. (define-public python2-hypothesis
  1956. (let ((hypothesis (package-with-python2
  1957. (strip-python2-variant python-hypothesis))))
  1958. (package (inherit hypothesis)
  1959. (version "4.57.1")
  1960. (source (origin
  1961. (method url-fetch)
  1962. (uri (pypi-uri "hypothesis" version))
  1963. (sha256
  1964. (base32
  1965. "183gpxbfcdhdqzlahkji5a71n6lmvgqsbkcb0ihqad51n2j6jhrw"))))
  1966. (propagated-inputs
  1967. `(("python2-enum34" ,python2-enum34)
  1968. ,@(package-propagated-inputs hypothesis))))))
  1969. (define-public python-hypothesmith
  1970. (package
  1971. (name "python-hypothesmith")
  1972. (version "0.1.8")
  1973. (source
  1974. (origin
  1975. (method url-fetch)
  1976. (uri (pypi-uri "hypothesmith" version))
  1977. (sha256
  1978. (base32
  1979. "02j101m5grjrbvrgjap17jsxd1hgawkylmyswcn33vf42mxh9zzr"))))
  1980. (build-system python-build-system)
  1981. (propagated-inputs
  1982. `(("python-hypothesis" ,python-hypothesis)
  1983. ("python-lark-parser" ,python-lark-parser)
  1984. ("python-libcst" ,python-libcst-minimal)))
  1985. (home-page "https://github.com/Zac-HD/hypothesmith")
  1986. (synopsis "Strategies for generating Python programs")
  1987. (description
  1988. "This package contains hypothesis strategies for generating Python
  1989. programs, something like CSmith, a random generator of C programs.")
  1990. (license license:mpl2.0)))
  1991. (define-public python-lit
  1992. (package
  1993. (name "python-lit")
  1994. (version "0.5.1")
  1995. (source
  1996. (origin
  1997. (method url-fetch)
  1998. (uri (pypi-uri "lit" version))
  1999. (sha256
  2000. (base32
  2001. "0z651m3vkbk85y41larnsjxrszkbi58x9gzml3lb6ga7qwcrsg97"))))
  2002. (build-system python-build-system)
  2003. (arguments
  2004. `(#:phases
  2005. (modify-phases %standard-phases
  2006. (replace 'check
  2007. (lambda _
  2008. (invoke "python" "lit.py" "tests"))))))
  2009. (native-inputs
  2010. `(("llvm" ,llvm)))
  2011. (home-page "https://llvm.org/")
  2012. (synopsis "LLVM Software Testing Tool")
  2013. (description "@code{lit} is a portable tool for executing LLVM and Clang
  2014. style test suites, summarizing their results, and providing indication of
  2015. failures.")
  2016. (license license:ncsa)))
  2017. (define-public python2-lit
  2018. (package-with-python2 python-lit))
  2019. (define-public python-pytest-pep8
  2020. (package
  2021. (name "python-pytest-pep8")
  2022. (version "1.0.6")
  2023. (source (origin
  2024. (method url-fetch)
  2025. (uri (pypi-uri "pytest-pep8" version))
  2026. (sha256
  2027. (base32
  2028. "06032agzhw1i9d9qlhfblnl3dw5hcyxhagn7b120zhrszbjzfbh3"))))
  2029. (build-system python-build-system)
  2030. (arguments
  2031. `(#:tests? #f ; Fails with recent pytest and pep8. See upstream issues #8 and #12.
  2032. #:phases
  2033. (modify-phases %standard-phases
  2034. (add-after 'unpack 'fix-dependencies
  2035. (lambda _
  2036. (substitute* "setup.py"
  2037. (("'pytest-cache', ") "")))) ; Included in recent pytest
  2038. (replace 'check
  2039. (lambda* (#:key tests? inputs outputs #:allow-other-keys)
  2040. (when tests?
  2041. (add-installed-pythonpath inputs outputs)
  2042. (invoke "pytest" "-v")))))))
  2043. (native-inputs
  2044. `(("python-pytest" ,python-pytest)))
  2045. (propagated-inputs
  2046. `(("python-pep8" ,python-pep8)))
  2047. (home-page "https://bitbucket.org/pytest-dev/pytest-pep8")
  2048. (synopsis "Py.test plugin to check PEP8 requirements")
  2049. (description "Pytest plugin for checking PEP8 compliance.")
  2050. (license license:expat)))
  2051. (define-public python2-pytest-pep8
  2052. (package-with-python2 python-pytest-pep8))
  2053. (define-public python-pytest-flakes
  2054. (package
  2055. (name "python-pytest-flakes")
  2056. (version "4.0.1")
  2057. (source (origin
  2058. (method url-fetch)
  2059. (uri (pypi-uri "pytest-flakes" version))
  2060. (sha256
  2061. (base32
  2062. "0045h3hnrkn2jwr42jgy2j98npx4amwr6wxzi9j0nppaqz33l49p"))))
  2063. (build-system python-build-system)
  2064. (arguments
  2065. `(#:phases
  2066. (modify-phases %standard-phases
  2067. (delete 'check)
  2068. (add-after 'install 'check
  2069. (lambda* (#:key outputs inputs #:allow-other-keys)
  2070. ;; It's easier to run tests after install.
  2071. ;; Make installed package available for running the tests
  2072. (add-installed-pythonpath inputs outputs)
  2073. (invoke "py.test" "-vv" "-k" "not test_syntax_error"))))))
  2074. (native-inputs
  2075. `(("python-coverage" ,python-coverage)
  2076. ("python-pytest" ,python-pytest)
  2077. ("python-pytest-cache" ,python-pytest-cache)
  2078. ("python-pytest-pep8" ,python-pytest-pep8)))
  2079. (propagated-inputs
  2080. `(("python-pyflakes" ,python-pyflakes)))
  2081. (home-page "https://github.com/fschulze/pytest-flakes")
  2082. (synopsis "Py.test plugin to check source code with pyflakes")
  2083. (description "Pytest plugin for checking Python source code with pyflakes.")
  2084. (license license:expat)))
  2085. (define-public python2-pytest-flakes
  2086. (package-with-python2 python-pytest-flakes))
  2087. (define-public python-coverage-test-runner
  2088. (package
  2089. (name "python-coverage-test-runner")
  2090. (version "1.15")
  2091. (source
  2092. (origin
  2093. (method url-fetch)
  2094. (uri (string-append
  2095. "http://git.liw.fi/cgi-bin/cgit/cgit.cgi/"
  2096. "coverage-test-runner/snapshot/coverage-test-runner-"
  2097. version ".tar.gz"))
  2098. (sha256
  2099. (base32
  2100. "1kjjb9llckycnfxag8zcvqsn4z1s3dwyw6b1n0avxydihgf30rny"))))
  2101. (build-system python-build-system)
  2102. (arguments
  2103. `(#:phases
  2104. (modify-phases %standard-phases
  2105. (replace 'check
  2106. (lambda _
  2107. (invoke "./testrun"))))))
  2108. (propagated-inputs
  2109. `(("python-coverage" ,python-coverage)))
  2110. (home-page "https://liw.fi/coverage-test-runner/")
  2111. (synopsis "Python module for running unit tests")
  2112. (description "@code{CoverageTestRunner} is a python module for running
  2113. unit tests and failing them if the unit test module does not exercise all
  2114. statements in the module it tests.")
  2115. (license license:gpl3+)))
  2116. (define-public python2-coverage-test-runner
  2117. (package-with-python2 python-coverage-test-runner))
  2118. (define-public python-pylint
  2119. (package
  2120. (name "python-pylint")
  2121. (version "2.9.6")
  2122. (source
  2123. (origin
  2124. (method git-fetch)
  2125. (uri (git-reference
  2126. (url "https://github.com/PyCQA/pylint")
  2127. (commit (string-append "v" version))))
  2128. (file-name (git-file-name name version))
  2129. (sha256
  2130. (base32 "15yw69v1cj6zkndk60c2g0dgl0khh8bfm1lrwhjffpdjfc7nkc9a"))))
  2131. (build-system python-build-system)
  2132. (native-inputs
  2133. `(("python-pytest" ,python-pytest)
  2134. ("python-pytest-benchmark" ,python-pytest-benchmark)
  2135. ("python-pytest-runner" ,python-pytest-runner)))
  2136. (propagated-inputs
  2137. `(("python-astroid" ,python-astroid)
  2138. ("python-isort" ,python-isort)
  2139. ("python-mccabe" ,python-mccabe)
  2140. ("python-toml" ,python-toml)))
  2141. (home-page "https://github.com/PyCQA/pylint")
  2142. (synopsis "Python source code analyzer which looks for coding standard
  2143. errors")
  2144. (description "Pylint is a Python source code analyzer which looks
  2145. for programming errors, helps enforcing a coding standard and sniffs
  2146. for some code smells (as defined in Martin Fowler's Refactoring book).
  2147. Pylint has many rules enabled by default, way too much to silence them
  2148. all on a minimally sized program. It's highly configurable and handle
  2149. pragmas to control it from within your code. Additionally, it is
  2150. possible to write plugins to add your own checks.")
  2151. (license license:gpl2+)))
  2152. (define-public python-paramunittest
  2153. (package
  2154. (name "python-paramunittest")
  2155. (version "0.2")
  2156. (source
  2157. (origin
  2158. (method url-fetch)
  2159. (uri (pypi-uri "ParamUnittest" version))
  2160. (sha256
  2161. (base32
  2162. "0kp793hws5xv1wvycxq7jw2pwy36f35k39jg8hx5qikij5a0jid1"))))
  2163. (build-system python-build-system)
  2164. (home-page
  2165. "https://github.com/rik0/ParamUnittest")
  2166. (synopsis
  2167. "Simple extension to have parametrized unit tests")
  2168. (description
  2169. "This package creates parameterized unit-tests that work with the standard
  2170. unittest package. A parameterized test case is automatically converted to multiple test
  2171. cases. Since they are TestCase subclasses, they work with other test suites that
  2172. recognize TestCases.")
  2173. (license license:bsd-2)))
  2174. (define-public python2-python-paramunittest
  2175. (package-with-python2 python-paramunittest))
  2176. (define-public python-pytest-warnings
  2177. (package
  2178. (name "python-pytest-warnings")
  2179. (version "0.2.0")
  2180. (source
  2181. (origin
  2182. (method url-fetch)
  2183. (uri (pypi-uri "pytest-warnings" version))
  2184. (sha256
  2185. (base32
  2186. "0gf2dpahpl5igb7jh1sr9acj3z3gp7zahqdqb69nk6wx01c8kc1g"))))
  2187. (build-system python-build-system)
  2188. (propagated-inputs
  2189. `(("pytest" ,python-pytest)))
  2190. (home-page "https://github.com/fschulze/pytest-warnings")
  2191. (synopsis "Pytest plugin to list Python warnings in pytest report")
  2192. (description
  2193. "Python-pytest-warnings is a pytest plugin to list Python warnings in
  2194. pytest report.")
  2195. (license license:expat)
  2196. (properties `((python2-variant . ,(delay python2-pytest-warnings))
  2197. ;; This package is part of pytest as of version 3.1.0.
  2198. (superseded . ,python-pytest)))))
  2199. (define-public python2-pytest-warnings
  2200. (package (inherit (package-with-python2
  2201. (strip-python2-variant python-pytest-warnings)))
  2202. (properties `((superseded . ,python2-pytest)))))
  2203. (define-public python-pytest-capturelog
  2204. (package
  2205. (name "python-pytest-capturelog")
  2206. (version "0.7")
  2207. (source
  2208. (origin
  2209. (method url-fetch)
  2210. (uri (pypi-uri "pytest-capturelog" version ".tar.gz"))
  2211. (sha256
  2212. (base32
  2213. "038049nyjl7di59ycnxvc9nydivc5m8np3hqq84j2iirkccdbs5n"))))
  2214. (build-system python-build-system)
  2215. (propagated-inputs
  2216. `(("pytest" ,python-pytest)))
  2217. (home-page "https://bitbucket.org/memedough/pytest-capturelog/overview")
  2218. (synopsis "Pytest plugin to catch log messages")
  2219. (description
  2220. "Python-pytest-catchlog is a pytest plugin to catch log messages.")
  2221. (license license:expat)))
  2222. (define-public python2-pytest-capturelog
  2223. (package-with-python2 python-pytest-capturelog))
  2224. (define-public python-pytest-catchlog
  2225. (package
  2226. (name "python-pytest-catchlog")
  2227. (version "1.2.2")
  2228. (source
  2229. (origin
  2230. (method url-fetch)
  2231. (uri (pypi-uri "pytest-catchlog" version ".zip"))
  2232. (sha256
  2233. (base32
  2234. "1w7wxh27sbqwm4jgwrjr9c2gy384aca5jzw9c0wzhl0pmk2mvqab"))))
  2235. (build-system python-build-system)
  2236. (native-inputs
  2237. `(("unzip" ,unzip)))
  2238. (propagated-inputs
  2239. `(("pytest" ,python-pytest)))
  2240. (home-page "https://github.com/eisensheng/pytest-catchlog")
  2241. (synopsis "Pytest plugin to catch log messages")
  2242. (description
  2243. "Python-pytest-catchlog is a pytest plugin to catch log messages. This is
  2244. a fork of pytest-capturelog.")
  2245. (license license:expat)))
  2246. (define-public python2-pytest-catchlog
  2247. (package-with-python2 python-pytest-catchlog))
  2248. (define-public python-nosexcover
  2249. (package
  2250. (name "python-nosexcover")
  2251. (version "1.0.11")
  2252. (source (origin
  2253. (method url-fetch)
  2254. (uri (pypi-uri "nosexcover" version))
  2255. (sha256
  2256. (base32
  2257. "10xqr12qv62k2flxwqhh8cr00cjhn7sfjrm6p35gd1x5bmjkr319"))))
  2258. (build-system python-build-system)
  2259. (propagated-inputs
  2260. `(("python-coverage" ,python-coverage)
  2261. ("python-nose" ,python-nose)))
  2262. (home-page "https://github.com/cmheisel/nose-xcover")
  2263. (synopsis "Extends nose.plugins.cover to add Cobertura-style XML reports")
  2264. (description "Nose-xcover is a companion to the built-in
  2265. @code{nose.plugins.cover}. This plugin will write out an XML coverage report
  2266. to a file named coverage.xml.
  2267. It will honor all the options you pass to the Nose coverage plugin,
  2268. especially -cover-package.")
  2269. (license license:expat)))
  2270. (define-public python2-nosexcover
  2271. (package-with-python2 python-nosexcover))
  2272. (define-public python-discover
  2273. (package
  2274. (name "python-discover")
  2275. (version "0.4.0")
  2276. (source
  2277. (origin
  2278. (method url-fetch)
  2279. (uri (pypi-uri "discover" version))
  2280. (sha256
  2281. (base32
  2282. "0y8d0zwiqar51kxj8lzmkvwc3b8kazb04gk5zcb4nzg5k68zmhq5"))))
  2283. (build-system python-build-system)
  2284. (home-page "https://pypi.org/project/discover/")
  2285. (synopsis
  2286. "Python test discovery for unittest")
  2287. (description
  2288. "Discover provides test discovery for unittest, a feature that has been
  2289. backported from Python 2.7 for Python 2.4+.")
  2290. (license license:bsd-3)))
  2291. (define-public python2-discover
  2292. (package-with-python2 python-discover))
  2293. (define-public behave
  2294. (package
  2295. (name "behave")
  2296. (version "1.2.6")
  2297. (source (origin
  2298. (method url-fetch)
  2299. (uri (pypi-uri "behave" version))
  2300. (sha256
  2301. (base32
  2302. "11hsz365qglvpp1m1w16239c3kiw15lw7adha49lqaakm8kj6rmr"))
  2303. (patches (search-patches
  2304. "behave-skip-a-couple-of-tests.patch"))))
  2305. (build-system python-build-system)
  2306. (native-inputs
  2307. `(("python-mock" ,python-mock)
  2308. ("python-nose" ,python-nose)
  2309. ("python-pathpy" ,python-pathpy)
  2310. ("python-pyhamcrest" ,python-pyhamcrest)
  2311. ("python-pytest" ,python-pytest)))
  2312. (propagated-inputs
  2313. `(("python-parse" ,python-parse)
  2314. ("python-parse-type" ,python-parse-type)))
  2315. (arguments
  2316. '(#:test-target "behave_test"))
  2317. (home-page "https://github.com/behave/behave")
  2318. (synopsis "Python behavior-driven development")
  2319. (description
  2320. "Behave is a tool for behavior-driven development in python.
  2321. Behavior-driven development (or BDD) is an agile software development
  2322. technique that encourages collaboration between developers, QA and
  2323. non-technical or business participants in a software project. Behave uses
  2324. tests written in a natural language style, backed up by Python code.")
  2325. (license license:x11)))
  2326. (define-public python-behave-web-api
  2327. (package
  2328. (name "python-behave-web-api")
  2329. (version "1.0.6")
  2330. (source
  2331. (origin
  2332. (method url-fetch)
  2333. (uri (pypi-uri "behave-web-api" version))
  2334. (sha256
  2335. (base32
  2336. "03kpq2xsy1gab3jy0dccbxlsg7vwfy4lagss0qldwmx3xz6b3i19"))))
  2337. (build-system python-build-system)
  2338. (arguments
  2339. `(#:phases
  2340. (modify-phases %standard-phases
  2341. (add-after 'unpack 'fix-dependencies
  2342. (lambda _
  2343. (substitute* "setup.py"
  2344. (("'wheel'") "") ; We don't use it.
  2345. (("'ordereddict==1.1'") "")) ; Python >= 2.7 has it built-in.
  2346. #t)))))
  2347. (propagated-inputs
  2348. `(("behave" ,behave)
  2349. ("python-requests" ,python-requests)))
  2350. (home-page "https://github.com/jefersondaniel/behave-web-api")
  2351. (synopsis "Provides testing for JSON APIs with Behave for Python")
  2352. (description "This package provides testing utility modules for testing
  2353. JSON APIs with Behave.")
  2354. (license license:expat)))
  2355. (define-public python-rednose
  2356. (package
  2357. (name "python-rednose")
  2358. (version "1.2.3")
  2359. (source
  2360. (origin
  2361. (method url-fetch)
  2362. (uri (pypi-uri "rednose" version))
  2363. (sha256
  2364. (base32
  2365. "11x5nx5b4wdq04s7vj1gcdl07jvvkfb37p0r5lg773gr5rr8mj6h"))))
  2366. (build-system python-build-system)
  2367. (arguments
  2368. `(#:phases (modify-phases %standard-phases
  2369. (add-after 'unpack 'patch-setup.py
  2370. (lambda _
  2371. ;; Six is only required for tests and later versions
  2372. ;; work fine.
  2373. (substitute* "setup.py"
  2374. (("six==1.10.0") "six"))
  2375. #t)))))
  2376. (propagated-inputs
  2377. `(("python-colorama" ,python-colorama)
  2378. ("python-termstyle" ,python-termstyle)))
  2379. (native-inputs
  2380. `(("python-six" ,python-six)
  2381. ("python-nose" ,python-nose)))
  2382. (home-page "https://github.com/JBKahn/rednose")
  2383. (synopsis "Colored output for Python nosetests")
  2384. (description "This package provides colored output for the
  2385. @command{nosetests} command of the Python Nose unit test framework.")
  2386. (license license:bsd-3)))
  2387. (define-public python2-rednose
  2388. (package-with-python2 python-rednose))
  2389. (define-public python-nose-random
  2390. (package
  2391. (name "python-nose-random")
  2392. (version "1.0.0")
  2393. (source
  2394. (origin
  2395. (method git-fetch)
  2396. (uri (git-reference
  2397. (url "https://github.com/fzumstein/nose-random")
  2398. (commit version)))
  2399. (file-name (git-file-name name version))
  2400. (sha256
  2401. (base32
  2402. "1dvip61r2frjv35mv6mmfjc07402z73pjbndfp3mhxyjn2zhksw2"))))
  2403. (build-system python-build-system)
  2404. (native-inputs
  2405. `(("python-nose" ,python-nose)))
  2406. (home-page "https://github.com/fzumstein/nose-random")
  2407. (synopsis "Nose plugin to facilitate randomized unit testing with
  2408. Python")
  2409. (description "Python nose-random is designed to facilitate
  2410. Monte-Carlo style unit testing. The idea is to improve testing by
  2411. running your code against a large number of randomly generated input
  2412. scenarios.")
  2413. (license license:expat)))
  2414. (define-public python-nose-randomly
  2415. (package
  2416. (name "python-nose-randomly")
  2417. (version "1.2.6")
  2418. (source
  2419. (origin
  2420. (method url-fetch)
  2421. (uri (pypi-uri "nose-randomly" version))
  2422. (sha256
  2423. (base32 "0z662rqhfk4bjmg806mn4frb8nz4gbh7mrddsrhfffp1g4yklj3y"))))
  2424. (build-system python-build-system)
  2425. (native-inputs
  2426. `(("python-nose" ,python-nose)
  2427. ("python-numpy" ,python-numpy)))
  2428. (home-page "https://github.com/adamchainz/nose-randomly")
  2429. (synopsis
  2430. "Nose plugin to randomly order tests and control random.seed")
  2431. (description
  2432. "This is a @code{Nose} plugin to randomly order tests which can be quite
  2433. powerful in discovering hidden flaws in the tests themselves, while helping to
  2434. reduce inter-test dependencies. It also helps in controlling @code{random.seed},
  2435. by resetting it to a repeatable number for each test, enabling the tests to
  2436. create data based on random numbers and yet remain repeatable.")
  2437. (license license:bsd-3)))
  2438. (define-public python2-nose-randomly
  2439. (package-with-python2 python-nose-randomly))
  2440. (define-public python-nose-timer
  2441. (package
  2442. (name "python-nose-timer")
  2443. (version "0.7.5")
  2444. (source
  2445. (origin
  2446. (method url-fetch)
  2447. (uri (pypi-uri "nose-timer" version))
  2448. (sha256
  2449. (base32 "05wzkc88vbzw62pqkvhl33211b90kns0lny70b7qw62rcg4flzk4"))))
  2450. (build-system python-build-system)
  2451. (propagated-inputs
  2452. `(("python-nose" ,python-nose)
  2453. ("python-termcolor" ,python-termcolor)))
  2454. (home-page "https://github.com/mahmoudimus/nose-timer")
  2455. (synopsis "Timer plugin for nosetests")
  2456. (description "Shows how much time was needed to run individual tests.")
  2457. (license license:expat)))
  2458. (define-public python2-nose-timer
  2459. (package-with-python2 python-nose-timer))
  2460. (define-public python-freezegun
  2461. (package
  2462. (name "python-freezegun")
  2463. (version "0.3.14")
  2464. (source
  2465. (origin
  2466. (method url-fetch)
  2467. (uri (pypi-uri "freezegun" version))
  2468. (sha256
  2469. (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
  2470. (build-system python-build-system)
  2471. (native-inputs
  2472. `(("python-mock" ,python-mock)
  2473. ("python-pytest" ,python-pytest)))
  2474. (propagated-inputs
  2475. `(("python-six" ,python-six)
  2476. ("python-dateutil" ,python-dateutil)))
  2477. (arguments
  2478. `(#:phases
  2479. (modify-phases %standard-phases
  2480. ;; The tests are normally executed via `make test`, but the PyPi
  2481. ;; package does not include the Makefile.
  2482. (replace 'check
  2483. (lambda _
  2484. (invoke "pytest" "-vv"))))))
  2485. (home-page "https://github.com/spulec/freezegun")
  2486. (synopsis "Test utility for mocking the datetime module")
  2487. (description
  2488. "FreezeGun is a library that allows your python tests to travel through
  2489. time by mocking the datetime module.")
  2490. (license license:asl2.0)))
  2491. (define-public python2-freezegun
  2492. (package-with-python2 python-freezegun))
  2493. (define-public python-flexmock
  2494. (package
  2495. (name "python-flexmock")
  2496. (version "0.10.4")
  2497. (source (origin
  2498. (method url-fetch)
  2499. (uri (pypi-uri "flexmock" version))
  2500. (sha256
  2501. (base32
  2502. "0b6qw3grhgx58kxlkj7mdma7xdvlj02zabvcf7w2qifnfjwwwcsh"))))
  2503. (build-system python-build-system)
  2504. (home-page "https://flexmock.readthedocs.org")
  2505. (synopsis "Testing library for Python")
  2506. (description
  2507. "flexmock is a testing library for Python that makes it easy to create
  2508. mocks, stubs and fakes.")
  2509. (license license:bsd-3)))
  2510. (define-public python2-flexmock
  2511. (package-with-python2 python-flexmock))
  2512. (define-public python-flaky
  2513. (package
  2514. (name "python-flaky")
  2515. (version "3.5.3")
  2516. (source (origin
  2517. (method url-fetch)
  2518. (uri (pypi-uri "flaky" version))
  2519. (sha256
  2520. (base32
  2521. "1nm1kjf857z5aw7v642ffsy1vwf255c6wjvmil71kckjyd0mxg8j"))))
  2522. (build-system python-build-system)
  2523. (arguments
  2524. ;; TODO: Tests require 'coveralls' and 'genty' which are not in Guix yet.
  2525. '(#:tests? #f))
  2526. (home-page "https://github.com/box/flaky")
  2527. (synopsis "Automatically rerun flaky tests")
  2528. (description
  2529. "Flaky is a plugin for @code{nose} or @code{py.test} that automatically
  2530. reruns flaky tests.
  2531. Ideally, tests reliably pass or fail, but sometimes test fixtures must rely
  2532. on components that aren't 100% reliable. With flaky, instead of removing
  2533. those tests or marking them to @code{@@skip}, they can be automatically
  2534. retried.")
  2535. (license license:asl2.0)))
  2536. (define-public python2-flaky
  2537. (package-with-python2 python-flaky))
  2538. (define-public python-pyhamcrest
  2539. (package
  2540. (name "python-pyhamcrest")
  2541. (version "2.0.2")
  2542. (source (origin
  2543. ;; Tests not distributed from pypi release.
  2544. (method git-fetch)
  2545. (uri (git-reference
  2546. (url "https://github.com/hamcrest/PyHamcrest")
  2547. (commit (string-append "V" version))))
  2548. (file-name (git-file-name name version))
  2549. (sha256
  2550. (base32
  2551. "05kdzlhs2kvj82pfca13qszszcj6dyrk4b9pbr46x06sq2s4qyls"))))
  2552. (native-inputs ;all native inputs are for tests
  2553. `(("python-pytest-cov" ,python-pytest-cov)
  2554. ("python-mock" ,python-mock)
  2555. ("python-pytest" ,python-pytest)
  2556. ("python-hypothesis" ,python-hypothesis)))
  2557. (build-system python-build-system)
  2558. (arguments
  2559. `(#:phases (modify-phases %standard-phases
  2560. (replace 'check
  2561. (lambda _
  2562. (invoke "pytest" "-vv"))))))
  2563. (home-page "http://hamcrest.org/")
  2564. (synopsis "Hamcrest matchers for Python")
  2565. (description "PyHamcrest is a framework for writing matcher objects,
  2566. allowing you to declaratively define \"match\" rules.")
  2567. (license license:bsd-3)))
  2568. (define-public unittest-cpp
  2569. (package
  2570. (name "unittest-cpp")
  2571. (version "2.0.0")
  2572. (source (origin
  2573. (method git-fetch)
  2574. (uri (git-reference
  2575. (url "https://github.com/unittest-cpp/unittest-cpp")
  2576. (commit (string-append "v" version))))
  2577. (file-name (git-file-name name version))
  2578. (sha256
  2579. (base32 "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i"))))
  2580. (arguments
  2581. `(#:tests? #f)) ; It's run after build automatically.
  2582. (build-system cmake-build-system)
  2583. (home-page "https://github.com/unittest-cpp/unittest-cpp")
  2584. (synopsis "Lightweight unit testing framework for C++")
  2585. (description "UnitTest++ is a lightweight unit testing framework for C++.
  2586. It was designed to do test-driven development on a wide variety of platforms.
  2587. Simplicity, portability, speed, and small footprint are all very important
  2588. aspects of UnitTest++. UnitTest++ is mostly standard C++ and makes minimal use
  2589. of advanced library and language features, which means it should be easily
  2590. portable to just about any platform.")
  2591. (license license:expat)))
  2592. (define-public libfaketime
  2593. (package
  2594. (name "libfaketime")
  2595. (version "0.9.9")
  2596. (home-page "https://github.com/wolfcw/libfaketime")
  2597. (source (origin
  2598. (method git-fetch)
  2599. (uri (git-reference
  2600. (url home-page)
  2601. (commit (string-append "v" version))))
  2602. (sha256
  2603. (base32
  2604. "1gi1xciqga5hl2xlk7rc3j8wy47ag97pi7ngmdl6ny1d11b2wn1z"))
  2605. (file-name (git-file-name name version))))
  2606. (build-system gnu-build-system)
  2607. (arguments
  2608. `(#:phases (modify-phases %standard-phases
  2609. (add-after 'unpack 'embed-date-reference
  2610. (lambda* (#:key inputs #:allow-other-keys)
  2611. (let ((coreutils (assoc-ref inputs "coreutils")))
  2612. (substitute* "src/faketime.c"
  2613. (("\"date\"")
  2614. (string-append "\"" coreutils "/bin/date\""))))))
  2615. (replace 'configure
  2616. (lambda* (#:key outputs #:allow-other-keys)
  2617. (let ((out (assoc-ref outputs "out")))
  2618. (setenv "CC" ,(cc-for-target))
  2619. (setenv "PREFIX" out)
  2620. ;; XXX: Without this flag, the CLOCK_REALTIME test hangs
  2621. ;; indefinitely. See README.packagers for more information.
  2622. ;; There are specific instructions to not enable more flags
  2623. ;; than absolutely needed.
  2624. ,(if (target-ppc64le?)
  2625. `(setenv "FAKETIME_COMPILE_CFLAGS"
  2626. "-DFORCE_MONOTONIC_FIX -DFORCE_PTHREAD_NONVER")
  2627. `(setenv "FAKETIME_COMPILE_CFLAGS"
  2628. "-DFORCE_MONOTONIC_FIX")))))
  2629. (add-before 'check 'pre-check
  2630. (lambda _
  2631. (substitute* "test/functests/test_exclude_mono.sh"
  2632. (("/bin/bash") (which "bash"))))))
  2633. #:test-target "test"))
  2634. (native-inputs
  2635. `(("perl" ,perl))) ;for tests
  2636. (inputs
  2637. `(("coreutils" ,coreutils)))
  2638. (synopsis "Fake the system time for single applications")
  2639. (description
  2640. "The libfaketime library allows users to modify the system time that an
  2641. application \"sees\". It is meant to be loaded using the dynamic linker's
  2642. @code{LD_PRELOAD} environment variable. The @command{faketime} command
  2643. provides a simple way to achieve this.")
  2644. (license license:gpl2)))
  2645. (define-public umockdev
  2646. (package
  2647. (name "umockdev")
  2648. (version "0.14.4")
  2649. (source (origin
  2650. (method url-fetch)
  2651. (uri (string-append "https://github.com/martinpitt/umockdev/"
  2652. "releases/download/" version "/"
  2653. "umockdev-" version ".tar.xz"))
  2654. (sha256
  2655. (base32
  2656. "0xmi24ckpps32k7hc139psgbsnsf4g106sv4l9m445m46amkxggd"))))
  2657. (build-system gnu-build-system)
  2658. (arguments
  2659. `(#:phases
  2660. (modify-phases %standard-phases
  2661. (add-after 'unpack 'fix-test
  2662. (lambda _
  2663. (substitute* "tests/test-umockdev.c"
  2664. (("/run") "/tmp"))
  2665. #t)))))
  2666. (native-inputs
  2667. `(("vala" ,vala)
  2668. ("gobject-introspection" ,gobject-introspection)
  2669. ("gtk-doc" ,gtk-doc/stable)
  2670. ("pkg-config" ,pkg-config)
  2671. ;; For tests.
  2672. ("python" ,python)
  2673. ("which" ,which)))
  2674. (inputs
  2675. `(("glib" ,glib)
  2676. ("eudev" ,eudev)
  2677. ("libgudev" ,libgudev)))
  2678. (home-page "https://github.com/martinpitt/umockdev/")
  2679. (synopsis "Mock hardware devices for creating unit tests")
  2680. (description "umockdev mocks hardware devices for creating integration
  2681. tests for hardware related libraries and programs. It also provides tools to
  2682. record the properties and behaviour of particular devices, and to run a
  2683. program or test suite under a test bed with the previously recorded devices
  2684. loaded.")
  2685. (license license:lgpl2.1+)))
  2686. (define-public virtest
  2687. ;; No releases yet, so we take the commit that "vc" expects.
  2688. (let ((commit "f7d03ef39fceba168745bd29e1b20af6e7971e04")
  2689. (revision "0"))
  2690. (package
  2691. (name "virtest")
  2692. (version (git-version "0.0" revision commit))
  2693. (home-page "https://github.com/mattkretz/virtest")
  2694. (source (origin
  2695. (method git-fetch)
  2696. (uri (git-reference (url home-page) (commit commit)))
  2697. (file-name (git-file-name name version))
  2698. (sha256
  2699. (base32
  2700. "07pjyb0mk7y2w1dg1bhl26nb7416xa1mw16ifj6mmps5y6aq054l"))))
  2701. (build-system cmake-build-system)
  2702. (arguments
  2703. `(#:phases (modify-phases %standard-phases
  2704. (add-after 'unpack 'adjust-install-directory
  2705. (lambda _
  2706. ;; Vc is the only consumer of this library, and expects
  2707. ;; to find it in "virtest/vir/" instead of "vir/vir/".
  2708. (substitute* "CMakeLists.txt"
  2709. (("DESTINATION include/vir")
  2710. "DESTINATION include/virtest"))
  2711. #t)))))
  2712. (synopsis "Header-only test framework")
  2713. (description
  2714. "@code{virtest} is a small header-only test framework for C++. It
  2715. grew out of the @dfn{Vc} project.")
  2716. (license license:bsd-3))))
  2717. (define-public python-pyfakefs
  2718. (package
  2719. (name "python-pyfakefs")
  2720. (version "3.7.1")
  2721. (source (origin
  2722. (method url-fetch)
  2723. ;; We use the PyPI URL because there is no proper release
  2724. ;; available from GitHub. The GitHub project only provides
  2725. ;; autogenerated tarballs, which are known to change in place.
  2726. (uri (pypi-uri "pyfakefs" version))
  2727. (sha256
  2728. (base32
  2729. "1cp2yw96fa2qkgi39xa3nlr3inf8wb5rgh9kdq53256ca2r8pdhy"))
  2730. (patches (search-patches
  2731. "python-pyfakefs-remove-bad-test.patch"))
  2732. (file-name (string-append name "-" version ".tar.gz"))))
  2733. (arguments
  2734. `(#:phases
  2735. (modify-phases %standard-phases
  2736. (add-after 'unpack 'patch-testsuite
  2737. (lambda _
  2738. ;; Time difference is larger than expected.
  2739. (substitute* "pyfakefs/tests/fake_filesystem_unittest_test.py"
  2740. (("(\\s+)def test_copy_real_file" all indent)
  2741. (string-append
  2742. indent
  2743. "@unittest.skip('disabled by guix')\n"
  2744. all)))))
  2745. ;; The default test suite does not run these extra tests.
  2746. (add-after 'check 'check-pytest-plugin
  2747. (lambda _
  2748. (invoke
  2749. "python" "-m" "pytest"
  2750. "pyfakefs/pytest_tests/pytest_plugin_test.py"))))))
  2751. (native-inputs
  2752. `(("python-pytest" ,python-pytest)))
  2753. (build-system python-build-system)
  2754. ;; Guix lint doesn't like that this is a permanent redirect to the GitHub
  2755. ;; page, but the pyfakefs documentation asks us to use this specific URL
  2756. ;; when linking to the project. Honor their request.
  2757. (home-page "http://pyfakefs.org/")
  2758. ;; TRANSLATORS: In the synopsis, "Mock" is a verb.
  2759. (synopsis "Mock file system interactions in tests")
  2760. (description
  2761. "This package provides a Python library intended for use in automated
  2762. tests. One difficulty when testing software is that the code under test might
  2763. need to read or write to files in the local file system. If the file system
  2764. is not set up in just the right way, it might cause a spurious error during
  2765. the test. The pyfakefs library provides a solution to problems like this by
  2766. mocking file system interactions. In other words, it arranges for the code
  2767. under test to interact with a fake file system instead of the real file
  2768. system. The code under test requires no modification to work with pyfakefs.")
  2769. (license license:asl2.0)))
  2770. ;; This minimal variant is used to avoid a circular dependency between
  2771. ;; python2-importlib-metadata, which requires pyfakefs for its tests, and
  2772. ;; python2-pytest, which requires python2-importlib-metadata.
  2773. (define-public python2-pyfakefs-bootstrap
  2774. (hidden-package
  2775. (package
  2776. (inherit (package-with-python2 python-pyfakefs))
  2777. (name "python2-pyfakefs-bootstrap")
  2778. (native-inputs '())
  2779. (arguments
  2780. `(#:python ,python-2
  2781. #:tests? #f)))))
  2782. (define-public python-aiounittest
  2783. (package
  2784. (name "python-aiounittest")
  2785. (version "1.4.0")
  2786. ;; Pypi package lacks tests.
  2787. (source
  2788. (origin (method git-fetch)
  2789. (uri (git-reference
  2790. (url "https://github.com/kwarunek/aiounittest.git")
  2791. (commit version)))
  2792. (file-name (git-file-name name version))
  2793. (sha256
  2794. (base32
  2795. "0hql5mw62lclrpblbh7xvinwjfcdcfvhhlvl7xlq2hi9isjq1c8r"))))
  2796. (build-system python-build-system)
  2797. (arguments
  2798. '(#:phases (modify-phases %standard-phases
  2799. (replace 'check
  2800. (lambda* (#:key tests? #:allow-other-keys)
  2801. (if tests?
  2802. (invoke "nosetests" "-v")
  2803. (format #t "test suite not run~%"))
  2804. #t)))))
  2805. (propagated-inputs `(("python-wrapt" ,python-wrapt)))
  2806. (native-inputs
  2807. `(("python-coverage" ,python-coverage)
  2808. ("python-nose" ,python-nose)))
  2809. (home-page
  2810. "https://github.com/kwarunek/aiounittest")
  2811. (synopsis "Test asyncio code more easily")
  2812. (description "Aiounittest is a library that helps write tests using
  2813. asynchronous code in Python (asyncio).")
  2814. (license license:expat)))
  2815. (define-public python-pytest-dependency
  2816. (package
  2817. (name "python-pytest-dependency")
  2818. (version "0.5.1")
  2819. (source
  2820. (origin
  2821. (method url-fetch)
  2822. (uri (pypi-uri "pytest-dependency" version))
  2823. (sha256
  2824. (base32
  2825. "0swl3mxca7nnjbb5grfzrm3fa2750h9vjsha0f2kyrljc6895a62"))))
  2826. (build-system python-build-system)
  2827. (propagated-inputs
  2828. `(("python-pytest" ,python-pytest)))
  2829. (home-page
  2830. "https://github.com/RKrahl/pytest-dependency")
  2831. (synopsis "Manage dependencies of tests")
  2832. (description "This pytest plugin manages dependencies of tests. It allows
  2833. to mark some tests as dependent from other tests. These tests will then be
  2834. skipped if any of the dependencies did fail or has been skipped.")
  2835. (license license:asl2.0)))
  2836. (define-public python-pytest-datadir
  2837. (package
  2838. (name "python-pytest-datadir")
  2839. (version "1.3.1")
  2840. (source
  2841. (origin
  2842. (method url-fetch)
  2843. (uri (pypi-uri "pytest-datadir" version))
  2844. (sha256
  2845. (base32
  2846. "066bg6wlzgq2pqnjp73dfrcmk8951xw3aqcxa3p1axgqimrixbyk"))))
  2847. (build-system python-build-system)
  2848. (native-inputs
  2849. `(("python-setuptools-scm" ,python-setuptools-scm)))
  2850. (propagated-inputs
  2851. `(("python-pytest" ,python-pytest)
  2852. ("python-wheel" ,python-wheel)))
  2853. (home-page "https://github.com/gabrielcnr/pytest-datadir")
  2854. (synopsis "Pytest plugin for manipulating test data directories and files")
  2855. (description
  2856. "This package provides a Pytest plugin for manipulating test data
  2857. directories and files.")
  2858. (license license:expat)))
  2859. (define-public python-pytest-regressions
  2860. (package
  2861. (name "python-pytest-regressions")
  2862. (version "2.2.0")
  2863. (source
  2864. (origin
  2865. (method url-fetch)
  2866. (uri (pypi-uri "pytest-regressions" version))
  2867. (sha256
  2868. (base32
  2869. "05jpsvv8rj8i4x24fphpnar5dl4s6d6bw6ikjk5d8v96rdviz9qm"))))
  2870. (build-system python-build-system)
  2871. (propagated-inputs
  2872. `(("python-pytest-datadir" ,python-pytest-datadir)
  2873. ("python-pyyaml" ,python-pyyaml)))
  2874. (native-inputs
  2875. `(("python-matplotlib" ,python-matplotlib)
  2876. ("python-numpy" ,python-numpy)
  2877. ("python-pandas" ,python-pandas)
  2878. ("python-pillow" ,python-pillow)
  2879. ("python-pre-commit" ,python-pre-commit)
  2880. ("python-restructuredtext-lint"
  2881. ,python-restructuredtext-lint)
  2882. ("python-tox" ,python-tox)
  2883. ("python-setuptools-scm" ,python-setuptools-scm)
  2884. ("python-pytest" ,python-pytest)))
  2885. (home-page "https://github.com/ESSS/pytest-regressions")
  2886. (synopsis "Easy to use fixtures to write regression tests")
  2887. (description
  2888. "This plugin makes it simple to test general data, images, files, and numeric
  2889. tables by saving expected data in a data directory (courtesy of pytest-datadir)
  2890. that can be used to verify that future runs produce the same data.")
  2891. (license license:expat)))