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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
46 (uri (string-append "https://github.com/libcheck/check/files/71408/"
47 "/check-" version ".tar.gz"))
50 "0lhhywf5nxl3dd0hdakra3aasl590756c9kmvyifb3vgm9k0gxgm"))))
51 (build-system gnu-build-system)
52 (home-page "https://libcheck.github.io/check/")
53 (synopsis "Unit test framework for C")
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.")
70 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
71 version "/CUnit-" version ".tar.bz2"))
74 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
75 (build-system gnu-build-system)
80 (zero? (system* "autoreconf" "-vfi")))
83 `(("automake" ,automake)
84 ("autoconf" ,autoconf)
85 ("libtool" ,libtool)))
86 (home-page "http://cunit.sourceforge.net/")
87 (synopsis "Automated testing framework for C")
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.")
94 (define-public cppunit
100 (uri (string-append "http://dev-www.libreoffice.org/src/"
101 name "-" version ".tar.gz"))
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.
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
117 (license lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
119 (define-public catch-framework
122 (version "1.3.5") ;Sub-minor is the build number
126 (url "https://github.com/philsquared/Catch")
128 (commit "ae5ee2cf63d6d67bd1369b512d2a7b60b571c907")))
129 (file-name (string-append name "-" version))
132 "1yfb3lxv929szqy1nw9xw3d45wzkppziqshkjxvrb1fdmf46x564"))))
133 (build-system trivial-build-system)
135 `(#:modules ((guix build utils))
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-"
144 (for-each mkdir-p (list incdir docdir))
145 (install-file (string-append source
146 "/single_include/catch.hpp")
148 (copy-recursively (string-append source "/docs")
150 (home-page "http://catch-lib.net/")
151 (synopsis "Automated test framework for C++ and Objective-C")
153 "Catch stands for C++ Automated Test Cases in Headers and is a
154 multi-paradigm automated test framework for C++ and Objective-C.")
157 (define-public cmocka
163 (uri (string-append "https://cmocka.org/files/"
164 (version-major+minor version) "/cmocka-"
168 "1283zi9qf5613g8iadm1fxmjh4rzxqd5np2j3lcpgairf25g8bph"))))
169 (build-system cmake-build-system)
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
181 (define-public cppcheck
187 (uri (string-append "https://github.com/danmar/cppcheck/archive/"
190 (base32 "1qf7l0hx2k2qsc1rm3gh00bc0hwf9wqkrvrk08141yjj2js2y8lw"))
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).")
202 (define-public googletest
209 (uri (string-append "https://github.com/google/googletest/archive/"
210 "release-" version ".tar.gz"))
211 (file-name (string-append name "-" version ".tar.gz"))
214 "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq"))))
215 (build-system cmake-build-system)
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