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>
10 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 utils)
30 #:use-module (guix licenses)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system trivial))
45 (uri (string-append "https://github.com/libcheck/check/files/71408/"
46 "/check-" version ".tar.gz"))
49 "0lhhywf5nxl3dd0hdakra3aasl590756c9kmvyifb3vgm9k0gxgm"))))
50 (build-system gnu-build-system)
51 (home-page "https://libcheck.github.io/check/")
52 (synopsis "Unit test framework for C")
54 "Check is a unit testing framework for C. It features a simple
55 interface for defining unit tests, putting little in the way of the
56 developer. Tests are run in a separate address space, so Check can
57 catch both assertion failures and code errors that cause segmentation
58 faults or other signals. The output from unit tests can be used within
59 source code editors and IDEs.")
69 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
70 version "/CUnit-" version ".tar.bz2"))
73 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
74 (build-system gnu-build-system)
79 (zero? (system* "autoreconf" "-vfi")))
82 `(("automake" ,automake)
83 ("autoconf" ,autoconf)
84 ("libtool" ,libtool)))
85 (home-page "http://cunit.sourceforge.net/")
86 (synopsis "Automated testing framework for C")
88 "CUnit is a lightweight system for writing, administering, and running
89 unit tests in C. It provides C programmers with basic testing functionality
90 with a flexible variety of user interfaces.")
93 (define-public cppunit
99 (uri (string-append "http://dev-www.libreoffice.org/src/"
100 name "-" version ".tar.gz"))
103 "17s2kzmkw3kfjhpp72rfppyd7syr7bdq5s69syj2nvrlwd3d4irz"))))
104 ;; Explicitly link with libdl. This is expected to be done by packages
105 ;; relying on cppunit for their tests. However, not all of them do.
106 ;; If we added the linker flag to such packages, we would pollute all
107 ;; binaries, not only those used for testing.
109 `(#:make-flags '("LDFLAGS=-ldl")))
110 (build-system gnu-build-system)
111 (home-page "https://wiki.freedesktop.org/www/Software/cppunit/")
112 (synopsis "Unit testing framework for C++")
113 (description "CppUnit is the C++ port of the famous JUnit framework for
114 unit testing. Test output is in XML for automatic testing and GUI based for
116 (license lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
118 (define-public catch-framework
121 (version "1.3.5") ;Sub-minor is the build number
125 (url "https://github.com/philsquared/Catch")
127 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
128 (file-name (string-append name "-" version))
131 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
132 (build-system trivial-build-system)
134 `(#:modules ((guix build utils))
136 (use-modules (guix build utils))
137 (let* ((source (assoc-ref %build-inputs "source"))
138 (output (assoc-ref %outputs "out"))
139 (incdir (string-append output "/include"))
140 (docdir (string-append output "/share/doc/catch-"
143 (for-each mkdir-p (list incdir docdir))
144 (install-file (string-append source
145 "/single_include/catch.hpp")
147 (copy-recursively (string-append source "/docs")
149 (home-page "http://catch-lib.net/")
150 (synopsis "Automated test framework for C++ and Objective-C")
152 "Catch stands for C++ Automated Test Cases in Headers and is a
153 multi-paradigm automated test framework for C++ and Objective-C.")
156 (define-public cmocka
162 (uri (string-append "https://cmocka.org/files/"
163 (version-major+minor version) "/cmocka-"
167 "0c0k8ax16fgh39nsva09q4jsh83g9nxihkwj9d5666763fzx6q79"))))
168 (build-system cmake-build-system)
170 `(#:tests? #f)) ; No test target
171 (home-page "https://cmocka.org/")
172 (synopsis "Unit testing framework for C")
173 (description "Cmocka is a unit testing framework for C with support for
174 mock objects. It only requires the standard C library, and works with
175 different compilers. Cmocka supports several different message output formats
176 like Test Anything Protocol, Subunit, xUnit XML or the original cmockery output
180 (define-public cppcheck
186 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
189 (base32 "1fn26p0xvfrdbhxjhy6aqhkk63n3fvrdb2ygcn9wg4vaandhmbkn"))
190 (file-name (string-append name "-" version ".tar.gz"))))
191 (build-system cmake-build-system)
192 (home-page "http://cppcheck.sourceforge.net")
193 (synopsis "Static C/C++ code analyzer")
194 (description "Cppcheck is a static code analyzer for C and C++. Unlike
195 C/C++ compilers and many other analysis tools it does not detect syntax errors
196 in the code. Cppcheck primarily detects the types of bugs that the compilers
197 normally do not detect. The goal is to detect only real errors in the code
198 (i.e. have zero false positives).")
201 (define-public googletest
208 (uri (string-append "https://github.com/google/googletest/archive/"
209 "release-" version ".tar.gz"))
210 (file-name (string-append name "-" version ".tar.gz"))
213 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
214 (build-system cmake-build-system)
216 `(("python-2" ,python-2)))
217 (home-page "https://github.com/google/googletest/")
218 (synopsis "Test discovery and XUnit test framework")
219 (description "Google Test features an XUnit test framework, automated test
220 discovery, death tests, assertions, parameterized tests and XML test report