Andreas Schneider e35201d
BuildRequires:  cmake
Andreas Schneider e35201d
BuildRequires:  doxygen
Andreas Schneider e35201d
BuildRequires:  glibc-devel
Andreas Schneider e35201d
Andreas Schneider e35201d
Name:           cmocka
Andreas Schneider b80544e
Version:        1.0.1
Andreas Schneider b246bf1
Release:        1%{?dist}
Andreas Schneider e35201d
Andreas Schneider e35201d
License:        ASL 2.0
Andreas Schneider e35201d
Group:          Development/Tools
Andreas Schneider e35201d
Summary:        Lightweight library to simplify and generalize unit tests for C
Andreas Schneider 68df794
Url:            http://cmocka.org
Andreas Schneider e35201d
Andreas Schneider b246bf1
Source0:        https://open.cryptomilk.org/attachments/download/54/%{name}-%{version}.tar.xz
Andreas Schneider e35201d
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Andreas Schneider e35201d
Andreas Schneider e35201d
%description
Andreas Schneider e35201d
There are a variety of C unit testing frameworks available however many of them
Andreas Schneider e35201d
are fairly complex and require the latest compiler technology. Some development
Andreas Schneider e35201d
requires the use of old compilers which makes it difficult to use some unit
Andreas Schneider e35201d
testing frameworks. In addition many unit testing frameworks assume the code
Andreas Schneider e35201d
being tested is an application or module that is targeted to the same platform
Andreas Schneider e35201d
that will ultimately execute the test. Because of this assumption many
Andreas Schneider e35201d
frameworks require the inclusion of standard C library headers in the code
Andreas Schneider e35201d
module being tested which may collide with the custom or incomplete
Andreas Schneider e35201d
implementation of the C library utilized by the code under test.
Andreas Schneider e35201d
Andreas Schneider e35201d
Cmocka only requires a test application is linked with the standard C library
Andreas Schneider e35201d
which minimizes conflicts with standard C library headers. Also, CMocka tries
Andreas Schneider e35201d
to avoid the use of some of the newer features of C compilers.
Andreas Schneider e35201d
Andreas Schneider e35201d
This results in CMocka being a relatively small library that can be used to
Andreas Schneider e35201d
test a variety of exotic code. If a developer wishes to simply test an
Andreas Schneider e35201d
application with the latest compiler then other unit testing frameworks may be
Andreas Schneider e35201d
preferable.
Andreas Schneider e35201d
Andreas Schneider e35201d
This is the successor of Google's Cmockery.
Andreas Schneider e35201d
Andreas Schneider e35201d
%package -n libcmocka
Andreas Schneider e35201d
Group:          Development/Libraries
Andreas Schneider e35201d
Summary:        Lightweight library to simplify and generalize unit tests for C
Andreas Schneider e35201d
Andreas Schneider b246bf1
Conflicts: cmockery2
Andreas Schneider b246bf1
Andreas Schneider e35201d
%description -n libcmocka
Andreas Schneider e35201d
There are a variety of C unit testing frameworks available however many of them
Andreas Schneider e35201d
are fairly complex and require the latest compiler technology. Some development
Andreas Schneider e35201d
requires the use of old compilers which makes it difficult to use some unit
Andreas Schneider e35201d
testing frameworks. In addition many unit testing frameworks assume the code
Andreas Schneider e35201d
being tested is an application or module that is targeted to the same platform
Andreas Schneider e35201d
that will ultimately execute the test. Because of this assumption many
Andreas Schneider e35201d
frameworks require the inclusion of standard C library headers in the code
Andreas Schneider e35201d
module being tested which may collide with the custom or incomplete
Andreas Schneider e35201d
implementation of the C library utilized by the code under test.
Andreas Schneider e35201d
Andreas Schneider e35201d
CMocka only requires a test application is linked with the standard C library
Andreas Schneider e35201d
which minimizes conflicts with standard C library headers. Also, CMocka tries
Andreas Schneider e35201d
to avoid the use of some of the newer features of C compilers.
Andreas Schneider e35201d
Andreas Schneider e35201d
This results in CMocka being a relatively small library that can be used to
Andreas Schneider e35201d
test a variety of exotic code. If a developer wishes to simply test an
Andreas Schneider e35201d
application with the latest compiler then other unit testing frameworks may be
Andreas Schneider e35201d
preferable.
Andreas Schneider e35201d
Andreas Schneider e35201d
This is the successor of Google's Cmockery.
Andreas Schneider e35201d
Andreas Schneider e35201d
%package -n libcmocka-static
Andreas Schneider e35201d
Group:          Development/Libraries
Andreas Schneider e35201d
Summary:        Lightweight library to simplify and generalize unit tests for C
Andreas Schneider e35201d
Andreas Schneider e35201d
%description -n libcmocka-static
Andreas Schneider e35201d
Static version of the cmocka library.
Andreas Schneider e35201d
Andreas Schneider e35201d
%package -n libcmocka-devel
Andreas Schneider e35201d
Group:          Development/Libraries
Andreas Schneider e35201d
Summary:        Development headers for the cmocka library
Andreas Schneider e35201d
Requires:       libcmocka = %{version}-%{release}
Andreas Schneider e35201d
Andreas Schneider b246bf1
Conflicts: cmockery2-devel
Andreas Schneider b246bf1
Andreas Schneider e35201d
%description -n libcmocka-devel
Andreas Schneider e35201d
Development headers for the cmocka unit testing library.
Andreas Schneider e35201d
Andreas Schneider e35201d
%prep
Andreas Schneider e35201d
%setup -q
Andreas Schneider e35201d
Andreas Schneider e35201d
%build
Andreas Schneider 68df794
if test ! -e "obj"; then
Andreas Schneider 68df794
  mkdir obj
Andreas Schneider e35201d
fi
Andreas Schneider 68df794
pushd obj
Andreas Schneider e35201d
%cmake \
Andreas Schneider e35201d
  -DWITH_STATIC_LIB=ON \
Andreas Schneider b246bf1
  -DWITH_CMOCKERY_SUPPORT=ON \
Andreas Schneider e35201d
  -DUNIT_TESTING=ON \
Andreas Schneider 8a2f018
  -DCMAKE_SKIP_RPATH:BOOL=OFF \
Andreas Schneider e35201d
  %{_builddir}/%{name}-%{version}
Andreas Schneider e35201d
Andreas Schneider e35201d
make %{?_smp_mflags} VERBOSE=1
Andreas Schneider 68df794
make doc
Andreas Schneider 68df794
popd
Andreas Schneider e35201d
Andreas Schneider e35201d
%install
Andreas Schneider 68df794
pushd obj
Andreas Schneider e35201d
make DESTDIR=%{buildroot} install
Andreas Schneider e35201d
popd
Andreas Schneider b246bf1
ln -s libcmocka.so %{buildroot}%{_libdir}/libcmockery.so
Andreas Schneider e35201d
Andreas Schneider e35201d
%post -n libcmocka -p /sbin/ldconfig
Andreas Schneider e35201d
Andreas Schneider e35201d
%postun -n libcmocka -p /sbin/ldconfig
Andreas Schneider e35201d
Andreas Schneider e35201d
%clean
Andreas Schneider e35201d
%{__rm} -rf %{buildroot}
Andreas Schneider e35201d
Andreas Schneider e35201d
%check
Andreas Schneider 68df794
pushd obj
Andreas Schneider d5a9456
make test || cat Testing/Temporary/LastTest.log
Andreas Schneider e35201d
popd
Andreas Schneider e35201d
Andreas Schneider e35201d
%files -n libcmocka
Andreas Schneider e35201d
%doc AUTHORS README ChangeLog COPYING
Andreas Schneider e35201d
%{_libdir}/libcmocka.so.*
Andreas Schneider e35201d
Andreas Schneider e35201d
%files -n libcmocka-static
Andreas Schneider e35201d
%{_libdir}/libcmocka.a
Andreas Schneider e35201d
Andreas Schneider e35201d
%files -n libcmocka-devel
Andreas Schneider 68df794
%doc obj/doc/html
Andreas Schneider e35201d
%{_includedir}/cmocka.h
Andreas Schneider b246bf1
%{_includedir}/cmocka_pbc.h
Andreas Schneider b246bf1
%{_includedir}/cmockery/cmockery.h
Andreas Schneider b246bf1
%{_includedir}/cmockery/pbc.h
Andreas Schneider e35201d
%{_libdir}/libcmocka.so
Andreas Schneider b246bf1
%{_libdir}/libcmockery.so
Andreas Schneider 0742237
%{_libdir}/pkgconfig/cmocka.pc
Andreas Schneider 14a4372
%{_libdir}/cmake/cmocka/cmocka-config-version.cmake
Andreas Schneider 14a4372
%{_libdir}/cmake/cmocka/cmocka-config.cmake
Andreas Schneider e35201d
Andreas Schneider e35201d
%changelog
Andreas Schneider b80544e
* Thu Mar 12 2015 Andreas Schneider <asn@redhat.com> - 1.0.1-1
Andreas Schneider b80544e
- Update to version 1.0.1:
Andreas Schneider b80544e
  * Added a macro for assert_ptr_equal().
Andreas Schneider b80544e
  * Fixed test_realloc() if 0 size is passed.
Andreas Schneider b80544e
  * Fixed objects packaging bug.
Andreas Schneider b80544e
  * Fixed building with newer gcc versions.
Andreas Schneider b80544e
Andreas Schneider b246bf1
* Mon Feb 16 2015 Andreas Schneider <asn@redhat.com> - 1.0.0-1
Andreas Schneider b246bf1
- Update to version 1.0.0:
Andreas Schneider b246bf1
  * Added new test runner with group fixtures. The old runner is deprecated
Andreas Schneider b246bf1
  * Added an extensible message output formatter
Andreas Schneider b246bf1
  * Added jUnit XML message output
Andreas Schneider b246bf1
  * Added subunit message output
Andreas Schneider b246bf1
  * Added Test Anything Protocol message output
Andreas Schneider b246bf1
  * Added skip() command
Andreas Schneider b246bf1
  * Added test_realloc()
Andreas Schneider b246bf1
  * Added a cmockery compat header
Andreas Schneider b246bf1
  * Fixed a lot of bugs on Windows
Andreas Schneider b246bf1
Andreas Schneider 8a2f018
* Wed Aug 06 2014 - Andreas Schneider <asn@redhat.com> - 0.4.1-3
Andreas Schneider 8a2f018
- Fix building on rhel6 with bad %cmake macro.
Andreas Schneider 8a2f018
Andreas Schneider 14a4372
* Mon May 26 2014 - Andreas Schneider <asn@redhat.com> - 0.4.1-1
Andreas Schneider 14a4372
- Update to version 0.4.1.
Andreas Schneider 14a4372
Andreas Schneider 140f728
* Fri Apr 11 2014 - Andreas Schneider <asn@redhat.com> - 0.4.0-1
Andreas Schneider 140f728
- Update to version 0.4.0.
Andreas Schneider 140f728
Andreas Schneider 68df794
* Wed Nov 06 2013 - Andreas Schneider <asn@redhat.com> - 0.3.2-1
Andreas Schneider 68df794
- Update to version 0.3.2.
Andreas Schneider 68df794
- Include API documentation.
Andreas Schneider 68df794
0aeb855
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-2
0aeb855
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
0aeb855
Andreas Schneider b7f8497
* Wed Jul 10 2013 - Andreas Schneider <asn@redhat.com> - 0.3.0-2
Andreas Schneider b7f8497
- Update to version 0.3.1.
Andreas Schneider b7f8497
- Fixed cmocka issues on big endian.
Andreas Schneider b7f8497
- resolves: #975044
Andreas Schneider b7f8497
Andreas Schneider 0742237
* Wed Jun 05 2013 - Andreas Schneider <asn@redhat.com> - 0.3.0-1
Andreas Schneider 0742237
- Update to version 0.3.0.
Andreas Schneider 0742237
9c9e0ce
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-4
9c9e0ce
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
9c9e0ce
Andreas Schneider e35201d
* Fri Jan 18 2013 - Andreas Schneider <asn@redhat.com> - 0.2.0-3
Andreas Schneider e35201d
- Fixed typo in Source URL.
Andreas Schneider e35201d
Andreas Schneider e35201d
* Thu Jan 17 2013 - Andreas Schneider <asn@redhat.com> - 0.2.0-2
Andreas Schneider e35201d
- Fixed Source URL.
Andreas Schneider e35201d
- Fixed package groups.
Andreas Schneider e35201d
Andreas Schneider e35201d
* Tue Jan 15 2013 - Andreas Schneider <asn@redhat.com> - 0.2.0-1
Andreas Schneider e35201d
- Initial version 0.2.0