summaryrefslogtreecommitdiff
path: root/testing/source/vtown/deps/cryfs/.travisci/build_and_test.sh
blob: deb90903bfbc9178edfff5a91cb4740cf6f7b1d4 (plain)
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
49
50
#!/bin/bash

set -ev

# If using gcc on mac, actually use it ("gcc" just links to clang, but "gcc-4.8" is gcc, https://github.com/travis-ci/travis-ci/issues/2423)
# Note: This must be here and not in install.sh, because environment variables can't be passed between scripts.
if [ "${CXX}" == "g++" ]; then
  echo Switch to actual g++ and not just the AppleClang symlink
  export CXX="g++-7" CC="gcc-7"
else
  echo Do not switch to actual g++ because we are not g++
fi

# Setup ccache
export PATH="/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_COMPILERCHECK=content
export CCACHE_COMPRESS=1
export CCACHE_SLOPPINESS=include_file_mtime
ccache --max-size=512M
ccache --show-stats

# Detect number of CPU cores
export NUMCORES=`sysctl -n hw.ncpu`
echo Using $NUMCORES cores

echo Using CXX compiler $CXX and C compiler $CC

# Setup target directory
mkdir cmake
cd cmake
cmake --version

# Build
echo Build target: ${BUILD_TARGET}
cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${BUILD_TARGET}
make -j$NUMCORES

ccache --show-stats

# Test
./test/gitversion/gitversion-test
./test/cpp-utils/cpp-utils-test
./test/parallelaccessstore/parallelaccessstore-test
./test/blockstore/blockstore-test
./test/blobstore/blobstore-test
./test/cryfs/cryfs-test

# TODO Also run once fixed
# ./test/fspp/fspp-test
# ./test/cryfs-cli/cryfs-cli-test