]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
cmocka: New package
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Dec 2022 16:45:50 +0000 (16:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Dec 2022 16:45:50 +0000 (16:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
cmocka/cmocka.nm [new file with mode: 0644]

diff --git a/cmocka/cmocka.nm b/cmocka/cmocka.nm
new file mode 100644 (file)
index 0000000..df528ee
--- /dev/null
@@ -0,0 +1,83 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = cmocka
+version    = 1.1.5
+release    = 1
+
+groups     = System/Libraries
+url        = https://cmocka.org
+license    = ASL 2.0
+summary    = An elegant unit testing framework for C with support for mock objects
+
+description
+       There are a variety of C unit testing frameworks available however many of them
+       are fairly complex and require the latest compiler technology. Some development
+       requires the use of old compilers which makes it difficult to use some unit
+       testing frameworks. In addition many unit testing frameworks assume the code
+       being tested is an application or module that is targeted to the same platform
+       that will ultimately execute the test. Because of this assumption many
+       frameworks require the inclusion of standard C library headers in the code
+       module being tested which may collide with the custom or incomplete
+       implementation of the C library utilized by the code under test.
+
+       Cmocka only requires a test application is linked with the standard C library
+       which minimizes conflicts with standard C library headers. Also, CMocka tries
+       to avoid the use of some of the newer features of C compilers.
+
+       This results in CMocka being a relatively small library that can be used to
+       test a variety of exotic code. If a developer wishes to simply test an
+       application with the latest compiler then other unit testing frameworks may be
+       preferable.
+
+       This is the successor of Google's Cmockery.
+end
+
+source_dl = https://cmocka.org/files/1.1/
+sources   = %{thisapp}.tar.xz
+
+build
+       requires
+               cmake
+               make
+       end
+
+       # Disable LTO
+       LTO_CFLAGS =
+
+       build
+               mkdir build && cd build
+
+               %{cmake} \
+                       -DUNIT_TESTING=ON \
+                       ..
+
+               make %{PARALLELISMFLAGS}
+       end
+
+       test
+               cd build
+
+               make test
+       end
+
+       install
+               cd build
+
+               make install DESTDIR="%{BUILDROOT}"
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end