gnu: Add cpupower.
[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 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages check)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages python)
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system trivial))
36
37 (define-public check
38 (package
39 (name "check")
40 (version "0.9.14")
41 (source
42 (origin
43 (method url-fetch)
44 (uri (string-append "mirror://sourceforge/check/check/"
45 version "/check-" version ".tar.gz"))
46 (sha256
47 (base32
48 "02l4g79d81s07hzywcv1knwj5dyrwjiq2pgxaz7kidxi8m364wn2"))))
49 (build-system gnu-build-system)
50 (home-page "https://libcheck.github.io/check/")
51 (synopsis "Unit test framework for C")
52 (description
53 "Check is a unit testing framework for C. It features a simple
54 interface for defining unit tests, putting little in the way of the
55 developer. Tests are run in a separate address space, so Check can
56 catch both assertion failures and code errors that cause segmentation
57 faults or other signals. The output from unit tests can be used within
58 source code editors and IDEs.")
59 (license lgpl2.1+)))
60
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
88 unit tests in C. It provides C programmers with basic testing functionality
89 with a flexible variety of user interfaces.")
90 (license gpl2+)))
91
92 (define-public cppunit
93 (package
94 (name "cppunit")
95 (version "1.13.2")
96 (source (origin
97 (method url-fetch)
98 (uri (string-append "http://dev-www.libreoffice.org/src/"
99 name "-" version ".tar.gz"))
100 (sha256
101 (base32
102 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
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")))
109 (build-system gnu-build-system)
110 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
111 (synopsis "Unit testing framework for C++")
112 (description "CppUnit is the C++ port of the famous JUnit framework for
113 unit testing. Test output is in XML for automatic testing and GUI based for
114 supervised tests.")
115 (license lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
116
117 (define-public catch-framework
118 (package
119 (name "catch")
120 (version "1.3.5") ;Sub-minor is the build number
121 (source (origin
122 (method git-fetch)
123 (uri (git-reference
124 (url "https://github.com/philsquared/Catch")
125 ;; Semi-arbitrary.
126 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
127 (file-name (string-append name "-" version))
128 (sha256
129 (base32
130 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
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))
143 (install-file (string-append source
144 "/single_include/catch.hpp")
145 incdir)
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
152 multi-paradigm automated test framework for C++ and Objective-C.")
153 (license boost1.0)))
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
172 mock objects. It only requires the standard C library, and works with
173 different compilers. Cmocka supports several different message output formats
174 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
175 format.")
176 (license asl2.0)))
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
193 C/C++ compilers and many other analysis tools it does not detect syntax errors
194 in the code. Cppcheck primarily detects the types of bugs that the compilers
195 normally do not detect. The goal is to detect only real errors in the code
196 (i.e. have zero false positives).")
197 (license gpl3+)))
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
254 discovery, death tests, assertions, parameterized tests and XML test report
255 generation.")
256 (license bsd-3)))