Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / check.scm
CommitLineData
233e7676
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
4ac696c6 3;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
3bfc99c7 4;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
28edab7a 5;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
2259442b 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
dd6e70f9 7;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
5f6aba6b 8;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
d8989c23 9;;;
233e7676 10;;; This file is part of GNU Guix.
d8989c23 11;;;
233e7676 12;;; GNU Guix is free software; you can redistribute it and/or modify it
d8989c23
NK
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
233e7676 17;;; GNU Guix is distributed in the hope that it will be useful, but
d8989c23
NK
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
233e7676 23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
d8989c23 24
1ffa7090 25(define-module (gnu packages check)
59a43334 26 #:use-module (gnu packages)
f767bcca 27 #:use-module (gnu packages autotools)
5f6aba6b 28 #:use-module (gnu packages python)
d8989c23
NK
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
31 #:use-module (guix download)
3bfc99c7 32 #:use-module (guix git-download)
2259442b 33 #:use-module (guix build-system cmake)
3bfc99c7
EB
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system trivial))
d8989c23
NK
36
37(define-public check
38 (package
39 (name "check")
f4d9339c 40 (version "0.10.0")
d8989c23
NK
41 (source
42 (origin
43 (method url-fetch)
f4d9339c
EF
44 (uri (string-append "https://github.com/libcheck/check/files/71408/"
45 "/check-" version ".tar.gz"))
d8989c23
NK
46 (sha256
47 (base32
f4d9339c 48 "0lhhywf5nxl3dd0hdakra3aasl590756c9kmvyifb3vgm9k0gxgm"))))
d8989c23 49 (build-system gnu-build-system)
f4d9339c 50 (home-page "https://libcheck.github.io/check/")
35b9e423 51 (synopsis "Unit test framework for C")
d8989c23 52 (description
35b9e423 53 "Check is a unit testing framework for C. It features a simple
d8989c23
NK
54interface for defining unit tests, putting little in the way of the
55developer. Tests are run in a separate address space, so Check can
56catch both assertion failures and code errors that cause segmentation
35b9e423 57faults or other signals. The output from unit tests can be used within
d8989c23
NK
58source code editors and IDEs.")
59 (license lgpl2.1+)))
34352662 60
f767bcca
RW
61(define-public cunit
62 (package
63 (name "cunit")
64 (version "2.1-3")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
69 version "/CUnit-" version ".tar.bz2"))
70 (sha256
71 (base32
72 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
73 (build-system gnu-build-system)
74 (arguments '(#:phases
75 (alist-cons-before
76 'configure 'autoconf
77 (lambda _
78 (zero? (system* "autoreconf" "-vfi")))
79 %standard-phases)))
80 (native-inputs
81 `(("automake" ,automake)
82 ("autoconf" ,autoconf)
83 ("libtool" ,libtool)))
84 (home-page "http://cunit.sourceforge.net/")
85 (synopsis "Automated testing framework for C")
86 (description
87 "CUnit is a lightweight system for writing, administering, and running
88unit tests in C. It provides C programmers with basic testing functionality
89with a flexible variety of user interfaces.")
90 (license gpl2+)))
91
34352662
JD
92(define-public cppunit
93 (package
94 (name "cppunit")
34a6f4dc 95 (version "1.13.2")
34352662
JD
96 (source (origin
97 (method url-fetch)
34a6f4dc
EF
98 (uri (string-append "http://dev-www.libreoffice.org/src/"
99 name "-" version ".tar.gz"))
34352662
JD
100 (sha256
101 (base32
34a6f4dc 102 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
28edab7a
AE
103 ;; Explicitly link with libdl. This is expected to be done by packages
104 ;; relying on cppunit for their tests. However, not all of them do.
105 ;; If we added the linker flag to such packages, we would pollute all
106 ;; binaries, not only those used for testing.
107 (arguments
108 `(#:make-flags '("LDFLAGS=-ldl")))
34352662 109 (build-system gnu-build-system)
34a6f4dc 110 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
34352662
JD
111 (synopsis "Unit testing framework for C++")
112 (description "CppUnit is the C++ port of the famous JUnit framework for
72b030c0 113unit testing. Test output is in XML for automatic testing and GUI based for
34352662
JD
114supervised tests.")
115 (license lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
3bfc99c7
EB
116
117(define-public catch-framework
118 (package
119 (name "catch")
a232ce42 120 (version "1.3.5") ;Sub-minor is the build number
3bfc99c7
EB
121 (source (origin
122 (method git-fetch)
123 (uri (git-reference
124 (url "https://github.com/philsquared/Catch")
14a17ef6 125 ;; Semi-arbitrary.
a232ce42 126 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
3bfc99c7
EB
127 (file-name (string-append name "-" version))
128 (sha256
129 (base32
a232ce42 130 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
3bfc99c7
EB
131 (build-system trivial-build-system)
132 (arguments
133 `(#:modules ((guix build utils))
134 #:builder (begin
135 (use-modules (guix build utils))
136 (let* ((source (assoc-ref %build-inputs "source"))
137 (output (assoc-ref %outputs "out"))
138 (incdir (string-append output "/include"))
139 (docdir (string-append output "/share/doc/catch-"
140 ,version)))
141 (begin
142 (for-each mkdir-p (list incdir docdir))
96c46210 143 (install-file (string-append source
3bfc99c7 144 "/single_include/catch.hpp")
96c46210 145 incdir)
3bfc99c7
EB
146 (copy-recursively (string-append source "/docs")
147 docdir))))))
148 (home-page "http://catch-lib.net/")
149 (synopsis "Automated test framework for C++ and Objective-C")
150 (description
151 "Catch stands for C++ Automated Test Cases in Headers and is a
152multi-paradigm automated test framework for C++ and Objective-C.")
153 (license boost1.0)))
2259442b
EF
154
155(define-public cmocka
156 (package
157 (name "cmocka")
158 (version "1.0.1")
159 (source (origin
160 (method url-fetch)
161 (uri (string-append "https://cmocka.org/files/1.0/cmocka-"
162 version ".tar.xz"))
163 (sha256
164 (base32
165 "0fvm6rdalqcxckbddch8ycdw6n2ckldblv117n09chi2l7bm0q5k"))))
166 (build-system cmake-build-system)
167 (arguments
168 `(#:tests? #f)) ; No test target
169 (home-page "https://cmocka.org/")
170 (synopsis "Unit testing framework for C")
171 (description "Cmocka is a unit testing framework for C with support for
172mock objects. It only requires the standard C library, and works with
173different compilers. Cmocka supports several different message output formats
174like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
175format.")
176 (license asl2.0)))
dd6e70f9
RJ
177
178(define-public cppcheck
179 (package
180 (name "cppcheck")
181 (version "1.72")
182 (source (origin
183 (method url-fetch)
184 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
185 version ".tar.gz"))
186 (sha256
187 (base32 "0zxaixhqi4vmj7xj56gzadggcbjhbjjm6abyr86qlan23sg98667"))
188 (file-name (string-append name "-" version ".tar.gz"))))
189 (build-system cmake-build-system)
190 (home-page "http://cppcheck.sourceforge.net")
191 (synopsis "Static C/C++ code analyzer")
192 (description "Cppcheck is a static code analyzer for C and C++. Unlike
193C/C++ compilers and many other analysis tools it does not detect syntax errors
194in the code. Cppcheck primarily detects the types of bugs that the compilers
195normally do not detect. The goal is to detect only real errors in the code
196(i.e. have zero false positives).")
197 (license gpl3+)))
5f6aba6b
LG
198
199(define-public googletest
200 (package
201 (name "googletest")
202 (version "1.7.0")
203 (source
204 (origin
205 (method url-fetch)
206 (uri (string-append "https://github.com/google/googletest/archive/"
207 "release-" version ".tar.gz"))
208 (file-name (string-append name "-" version ".tar.gz"))
209 (sha256
210 (base32
211 "1k0nf1l9cb3prdmsvaajl5i31bx86c1mw0d5jgzykz7rzm36afpp"))))
212 (build-system gnu-build-system)
213 (native-inputs
214 `(("python-2" ,python-2)
215 ("autoconf" ,autoconf)
216 ("automake" ,automake)
217 ("libtool" ,libtool)))
218 (arguments
219 `(#:phases
220 (modify-phases %standard-phases
221 (add-before 'configure 'autoconf
222 (lambda _
223 (zero? (system* "autoreconf" "-vfi"))))
224 (add-before 'autoconf 'generate-headers
225 (lambda _
226 (begin
227 (delete-file "include/gtest/gtest-param-test.h")
228 (system* "python2" "scripts/pump.py"
229 "include/gtest/gtest-param-test.h.pump")
230 (delete-file "include/gtest/internal/gtest-tuple.h")
231 (system* "python2" "scripts/pump.py"
232 "include/gtest//internal/gtest-tuple.h.pump")
233 (delete-file
234 "include/gtest/internal/gtest-param-util-generated.h")
235 (system*
236 "python2" "scripts/pump.py"
237 "include/gtest/internal/gtest-param-util-generated.h.pump")
238 (delete-file "include/gtest/internal/gtest-type-util.h")
239 (system* "python2" "scripts/pump.py"
240 "include/gtest/internal/gtest-type-util.h.pump"))))
241 (replace 'install
242 (lambda _
243 (let ((out (assoc-ref %outputs "out")))
244 (begin
245 (install-file "lib/.libs/libgtest_main.a"
246 (string-append out "/lib"))
247 (install-file "lib/.libs/libgtest.a"
248 (string-append out "/lib"))
249 (copy-recursively "include"
250 (string-append out "/include")))))))))
251 (home-page "https://github.com/google/googletest/")
252 (synopsis "Test discovery and XUnit test framework")
253 (description "Google Test features an XUnit test framework, automated test
254discovery, death tests, assertions, parameterized tests and XML test report
255generation.")
256 (license bsd-3)))