Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmocka; fi

- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./testing/install_cmocka.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PKG_CONFIG_PATH=/home/travis/lib/pkgconfig ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/home/travis/lib/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then . ./testing/install_cmocka.sh; fi

script:
- make test
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ OBJ = boat.o sailing.o wind.o physics.o testing/test_sailing.o
$(CC) -c -o $@ $< $(CFLAGS)

test: $(OBJ)
echo ${PKG_CONFIG_PATH}
echo ${LD_LIBRARY_PATH}
$(CC) -coverage -o test_sailing $^ $(CFLAGS) $(shell pkg-config --libs --cflags cmocka)

clean:
Expand Down
9 changes: 6 additions & 3 deletions testing/install_cmocka.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env bash

wget https://cmocka.org/files/1.0/cmocka-1.0.1.tar.xz
tar vxf cmocka-1.0.1.tar.xz
cd cmocka-1.0.1/
wget https://cmocka.org/files/1.1/cmocka-1.1.3.tar.xz
tar vxf cmocka-1.1.3.tar.xz
cd cmocka-1.1.3/
mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=~ -DCMAKE_BUILD_TYPE=Release ..
make
make install

cd ../..

export PKG_CONFIG_PATH=/home/travis/lib/pkgconfig
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/home/travis/lib/