Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.73 KB

cmocka-mem-pool.md

File metadata and controls

64 lines (43 loc) · 1.73 KB

Installing cmocka and running the C programming assignment

host platform independent procedure

all versions as of 2018-01-23


Prerequisites

  1. An installation as in virual-dev-env or equivalent.

  2. An installation as in java-n-clion.

Installing the cmocka unit testing framework for C

  1. Download the generic Linux archive cmocka-1.1.1.tar.xz.

  2. Unpack and create a build directory.

cd
tar xvf ~/Downloads/cmocka-1.1.1.tar.xz
cd cmocka-1.1.1
mkdir build
cd build
  1. Build and install the cmocka library.
cmake ..
make
sudo make install
  1. On Ubuntu, this will install the library in the default location /usr/local/lib.

    find / -name "*cmocka*"
    

    will output, among other things,

    /usr/local/include/cmocka_pbc.h
    /usr/local/include/cmocka.h
    /usr/local/lib/libcmocka.so.0
    /usr/local/lib/cmake/cmocka
    /usr/local/lib/cmake/cmocka/cmocka-config.cmake
    /usr/local/lib/cmake/cmocka/cmocka-config-version.cmake
    /usr/local/lib/libcmocka.so
    /usr/local/lib/libcmocka.so.0.4.1
    /usr/local/lib/pkgconfig/cmocka.pc
    

Running the test suite for the C programming assignment

  1. Get a fresh fork of the C Programming Assignment 3 from Github.

  2. Clone under ~/git-repos.

  3. Open CLion and open the ~/git-repos/msl-clang-003 project. The CMakeLists.txt has been modified to work with the installed cmocka library. You should be able to build the project and run the test suite.