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