blob: 3a6c297a66969604e9a72a31d5284cbc6e27386a [file] [log] [blame]
Billy Donahuebbb54ef2015-08-31 02:19:39 -04001#!/usr/bin/env sh
Billy Donahue520d30c2015-08-31 09:54:37 -04002set -evx
Herbert Thielend96a0382017-09-04 18:19:06 +02003
4# if possible, ask for the precise number of processors,
5# otherwise take 2 processors as reasonable default; see
6# https://docs.travis-ci.com/user/speeding-up-the-build/#Makefile-optimization
7if [ -x /usr/bin/getconf ]; then
8 MAKEFLAGS=j$(/usr/bin/getconf _NPROCESSORS_ONLN)
9else
10 MAKEFLAGS="j2"
11fi
12export MAKEFLAGS
13
Billy Donahuebbb54ef2015-08-31 02:19:39 -040014env | sort
15
Billy Donahuefbb0b962015-09-01 02:24:48 -040016mkdir build || true
Herbert Thielend33861d2017-08-29 17:41:26 +020017cd build
Billy Donahue6fc49052015-09-01 02:41:55 -040018cmake -Dgtest_build_samples=ON \
Billy Donahue6fc49052015-09-01 02:41:55 -040019 -Dgtest_build_tests=ON \
20 -Dgmock_build_tests=ON \
deki517b3bd2015-09-07 18:23:25 -040021 -DCMAKE_CXX_FLAGS=$CXX_FLAGS \
Herbert Thielencc246ec2017-08-30 11:59:36 +020022 -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
Herbert Thielend33861d2017-08-29 17:41:26 +020023 ..
Billy Donahuefefba422015-08-31 10:29:11 -040024make
Arkadiy Shapkin43c0ae32016-06-25 01:29:18 +030025CTEST_OUTPUT_ON_FAILURE=1 make test