Skip to content

Commit 24b9992

Browse files
committed
deps: add cmocka as submodule for unit testing
1 parent e7f3570 commit 24b9992

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "test/lib/cmocka"]
2+
path = test/lib/cmocka
3+
url = git://git.cryptomilk.org/projects/cmocka.git

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ before_install:
4040
- pip install --user cpp-coveralls
4141

4242
script:
43+
- sh ./build-deps.sh
4344
- sh ./autogen.sh
4445
- if [[ "$CC" == "gcc" && "$CODE_COVERAGE" == "ON" ]]; then
4546
./configure CFLAGS="-ftest-coverage -fprofile-arcs";

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ MIT. check the LICENSE file
8888
### Unix (Autotools)
8989
9090
```text
91+
$ sh ./build-deps.sh # run only once (dependencies)
92+
$
9193
$ sh autogen.sh
9294
$ ./configure
9395
$ make

build-deps.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! /bin/sh
2+
#
3+
# Copyright (c), Recep Aslantas.
4+
#
5+
# MIT License (MIT), http://opensource.org/licenses/MIT
6+
# Full license can be found in the LICENSE file
7+
#
8+
9+
# check if deps are pulled
10+
git submodule update --init --recursive
11+
12+
# fix glibtoolize
13+
14+
cd $(dirname "$0")
15+
16+
if [ "$(uname)" = "Darwin" ]; then
17+
libtoolBin=$(which glibtoolize)
18+
libtoolBinDir=$(dirname "${libtoolBin}")
19+
ln -s $libtoolBin "${libtoolBinDir}/libtoolize"
20+
fi
21+
22+
# general deps: gcc make autoconf automake libtool cmake
23+
24+
# test - cmocka
25+
cd ./test/lib/cmocka
26+
mkdir build
27+
cd build
28+
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
29+
make -j8
30+
cd ../../../../

test/lib/cmocka

Submodule cmocka added at 5f61d2f

0 commit comments

Comments
 (0)