forked from puppetlabs/pxp-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis_target.sh
executable file
·49 lines (41 loc) · 1.21 KB
/
.travis_target.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -ev
if [ ${TRAVIS_TARGET} == MODULES ]; then
cd modules
bundle install
bundle exec rspec spec
exit
fi
get_gettext() {
wget https://s3.amazonaws.com/kylo-pl-bucket/gettext-0.19.6_install.tar.bz2
tar xjvf gettext-0.19.6_install.tar.bz2 --strip 1 -C $USERDIR
rm -f ../locales/pxp-agent.pot
}
if [ ${TRAVIS_TARGET} == CPPCHECK ]; then
# grab a pre-built cppcheck from s3
wget https://s3.amazonaws.com/kylo-pl-bucket/pcre-8.36_install.tar.bz2
tar xjvf pcre-8.36_install.tar.bz2 --strip 1 -C $USERDIR
wget https://s3.amazonaws.com/kylo-pl-bucket/cppcheck-1.69_install.tar.bz2
tar xjvf cppcheck-1.69_install.tar.bz2 --strip 1 -C $USERDIR
elif [ ${TRAVIS_TARGET} == DEBUG ]; then
# Install coveralls.io update utility
pip install --user cpp-coveralls
get_gettext
else
get_gettext
fi
# Generate build files
if [ ${TRAVIS_TARGET} == DEBUG ]; then
TARGET_OPTS="-DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=ON"
fi
cmake $TARGET_OPTS -DCMAKE_PREFIX_PATH=$USERDIR -DCMAKE_INSTALL_PREFIX=$USERDIR .
if [ ${TRAVIS_TARGET} == CPPLINT ]; then
make cpplint
elif [ ${TRAVIS_TARGET} == CPPCHECK ]; then
make cppcheck
else
make -j2
make test ARGS=-V
# Make sure installation succeeds
make install
fi