Billy Donahue | bbb54ef | 2015-08-31 02:19:39 -0400 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Billy Donahue | 520d30c | 2015-08-31 09:54:37 -0400 | [diff] [blame] | 2 | set -evx |
Herbert Thielen | d96a038 | 2017-09-04 18:19:06 +0200 | [diff] [blame^] | 3 | |
| 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 |
| 7 | if [ -x /usr/bin/getconf ]; then |
| 8 | MAKEFLAGS=j$(/usr/bin/getconf _NPROCESSORS_ONLN) |
| 9 | else |
| 10 | MAKEFLAGS="j2" |
| 11 | fi |
| 12 | export MAKEFLAGS |
| 13 | |
Billy Donahue | bbb54ef | 2015-08-31 02:19:39 -0400 | [diff] [blame] | 14 | env | sort |
| 15 | |
Billy Donahue | fbb0b96 | 2015-09-01 02:24:48 -0400 | [diff] [blame] | 16 | mkdir build || true |
Herbert Thielen | d33861d | 2017-08-29 17:41:26 +0200 | [diff] [blame] | 17 | cd build |
Billy Donahue | 6fc4905 | 2015-09-01 02:41:55 -0400 | [diff] [blame] | 18 | cmake -Dgtest_build_samples=ON \ |
Billy Donahue | 6fc4905 | 2015-09-01 02:41:55 -0400 | [diff] [blame] | 19 | -Dgtest_build_tests=ON \ |
| 20 | -Dgmock_build_tests=ON \ |
deki | 517b3bd | 2015-09-07 18:23:25 -0400 | [diff] [blame] | 21 | -DCMAKE_CXX_FLAGS=$CXX_FLAGS \ |
Herbert Thielen | cc246ec | 2017-08-30 11:59:36 +0200 | [diff] [blame] | 22 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ |
Herbert Thielen | d33861d | 2017-08-29 17:41:26 +0200 | [diff] [blame] | 23 | .. |
Billy Donahue | fefba42 | 2015-08-31 10:29:11 -0400 | [diff] [blame] | 24 | make |
Arkadiy Shapkin | 43c0ae3 | 2016-06-25 01:29:18 +0300 | [diff] [blame] | 25 | CTEST_OUTPUT_ON_FAILURE=1 make test |