cmocka - Unit testing framework for C ChangeLog

HOWTO


# cmocka 1.1.7
# ============
# Prerequisites:
# CMake >= 3.5.0
# Doxygen

# GitLab cmocka repository mirror

# If you ever want to remove cmocka, skip down to the bottom for info

# Get the source tarball
cd
test -f installed/cmocka-1.1.7.tar.xz &&
mv -f installed/cmocka-1.1.7.tar.xz .
test ! -f cmocka-1.1.7.tar.xz &&
wget https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz

# Verify tarball w/ gpg:
( gpg --list-keys 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D > /dev/null 2>&1 ||
  gpg --recv-keys 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D ) &&
wget -nc https://cmocka.org/files/1.1/cmocka-1.1.7.tar.xz.asc &&
  gpg --verify cmocka-1.1.7.tar.xz.asc && rm -f cmocka-1.1.7.tar.xz.asc

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "cmocka-*" -exec rm -r {} \;
tar xJvf ~/cmocka-1.1.7.tar.xz
cd cmocka-1.1.7
test $UID = 0 && chown -R root:root .

# Read ./README.md, ./INSTALL.md
# If upgrading read ./ChangeLog

# Create a build directory
mkdir build
cd build

# Configure the build
# The default prefix is /usr/local
# It will figure out lib|lib64
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug \
-DUNIT_TESTING=ON ..

# Build it
make

# Test it (if you added -DUNIT_TESTING=ON)
make test

# Become root to install it
su

# Install it
make install
ldconfig

# Become your non-root user again
exit

# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/cmocka-*.tar.*
mv cmocka-1.1.7.tar.xz installed/


# If you ever want to uninstall cmocka, this should do it:
# (look for install_manifest.txt in your source build directory
#  for a list of files that were installed)
su
( cd /usr/include ; rm -f cmocka.h cmocka_pbc.h )
( cd /usr/lib
   test -d ./cmake/cmocka && rm -r ./cmake/cmocka
   rm -f pkgconfig/cmocka.pc libcmocka.* )
test -d /usr/lib64 &&
( cd /usr/lib64
   test -d ./cmake/cmocka && rm -r ./cmake/cmocka
   rm -f pkgconfig/cmocka.pc libcmocka.* )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "cmocka-*" -exec rm -r {} \;
rm -f ~/installed/cmocka-*.tar.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EST -0500)
HOWTO last updated: 2024-04-09 12:13am
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]