Merge branch 'master' into core-updates
[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 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages check)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages autotools)
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system trivial))
31
32 (define-public check
33 (package
34 (name "check")
35 (version "0.9.14")
36 (source
37 (origin
38 (method url-fetch)
39 (uri (string-append "mirror://sourceforge/check/check/"
40 version "/check-" version ".tar.gz"))
41 (sha256
42 (base32
43 "02l4g79d81s07hzywcv1knwj5dyrwjiq2pgxaz7kidxi8m364wn2"))))
44 (build-system gnu-build-system)
45 (home-page "http://check.sourceforge.net/")
46 (synopsis "Unit test framework for C")
47 (description
48 "Check is a unit testing framework for C. It features a simple
49 interface for defining unit tests, putting little in the way of the
50 developer. Tests are run in a separate address space, so Check can
51 catch both assertion failures and code errors that cause segmentation
52 faults or other signals. The output from unit tests can be used within
53 source code editors and IDEs.")
54 (license lgpl2.1+)))
55
56 (define-public cunit
57 (package
58 (name "cunit")
59 (version "2.1-3")
60 (source
61 (origin
62 (method url-fetch)
63 (uri (string-append "mirror://sourceforge/cunit/CUnit/"
64 version "/CUnit-" version ".tar.bz2"))
65 (sha256
66 (base32
67 "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm"))))
68 (build-system gnu-build-system)
69 (arguments '(#:phases
70 (alist-cons-before
71 'configure 'autoconf
72 (lambda _
73 (zero? (system* "autoreconf" "-vfi")))
74 %standard-phases)))
75 (native-inputs
76 `(("automake" ,automake)
77 ("autoconf" ,autoconf)
78 ("libtool" ,libtool)))
79 (home-page "http://cunit.sourceforge.net/")
80 (synopsis "Automated testing framework for C")
81 (description
82 "CUnit is a lightweight system for writing, administering, and running
83 unit tests in C. It provides C programmers with basic testing functionality
84 with a flexible variety of user interfaces.")
85 (license gpl2+)))
86
87 (define-public cppunit
88 (package
89 (name "cppunit")
90 (version "1.12.1")
91 (source (origin
92 (method url-fetch)
93 (uri (string-append "mirror://sourceforge/cppunit/" name "/"
94 name "-"
95 version ".tar.gz"))
96 (sha256
97 (base32
98 "0jm49v5rmc5qw34vqs56gy8xja1dhci73bmh23cig4kcir6a0a5c"))))
99 ;; Explicitly link with libdl. This is expected to be done by packages
100 ;; relying on cppunit for their tests. However, not all of them do.
101 ;; If we added the linker flag to such packages, we would pollute all
102 ;; binaries, not only those used for testing.
103 (arguments
104 `(#:make-flags '("LDFLAGS=-ldl")))
105 (build-system gnu-build-system)
106 (home-page "http://sourceforge.net/projects/cppunit/")
107 (synopsis "Unit testing framework for C++")
108 (description "CppUnit is the C++ port of the famous JUnit framework for
109 unit testing. Test output is in XML for automatic testing and GUI based for
110 supervised tests.")
111 (license lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball
112
113 (define-public catch-framework
114 (package
115 (name "catch")
116 (version "1.1.3") ;Sub-minor is the build number
117 (source (origin
118 (method git-fetch)
119 (uri (git-reference
120 (url "https://github.com/philsquared/Catch")
121 ;; Semi-arbitrary.
122 (commit "c51e86819d")))
123 (file-name (string-append name "-" version))
124 (sha256
125 (base32
126 "0kgi7wxxysgjbpisqfj4dj0k19cyyai92f001zi8gzkybd4fkgv5"))))
127 (build-system trivial-build-system)
128 (arguments
129 `(#:modules ((guix build utils))
130 #:builder (begin
131 (use-modules (guix build utils))
132 (let* ((source (assoc-ref %build-inputs "source"))
133 (output (assoc-ref %outputs "out"))
134 (incdir (string-append output "/include"))
135 (docdir (string-append output "/share/doc/catch-"
136 ,version)))
137 (begin
138 (for-each mkdir-p (list incdir docdir))
139 (install-file (string-append source
140 "/single_include/catch.hpp")
141 incdir)
142 (copy-recursively (string-append source "/docs")
143 docdir))))))
144 (home-page "http://catch-lib.net/")
145 (synopsis "Automated test framework for C++ and Objective-C")
146 (description
147 "Catch stands for C++ Automated Test Cases in Headers and is a
148 multi-paradigm automated test framework for C++ and Objective-C.")
149 (license boost1.0)))