Fix Travis CI build
This commit is contained in:
parent
621864b50c
commit
fc71242e25
32
.travis.yml
32
.travis.yml
@ -18,34 +18,6 @@ addons:
|
|||||||
- libcrypto++-dev
|
- libcrypto++-dev
|
||||||
- libfuse-dev
|
- libfuse-dev
|
||||||
install:
|
install:
|
||||||
# Use new clang on linux
|
- .travisci/install.sh
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
|
|
||||||
# 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)
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ] && ["${CXX}" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
|
||||||
# Detect number of CPU cores
|
|
||||||
- export NUMCORES=`grep -c ^processor /proc/cpuinfo` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi
|
|
||||||
- echo Using $NUMCORES cores
|
|
||||||
# Install dependencies
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./travis.install_boost.sh; fi
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then brew cask install osxfuse && brew install cryptopp; fi
|
|
||||||
# By default, travis only fetches the newest 50 commits. We need more in case we're further from the last version tag, so the build doesn't fail because it can't generate the version number.
|
|
||||||
- git fetch --unshallow
|
|
||||||
# Setup target directory
|
|
||||||
- mkdir cmake
|
|
||||||
- cd cmake
|
|
||||||
- cmake --version
|
|
||||||
# Use /dev/urandom when /dev/random is accessed, because travis doesn't have enough entropy
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo cp -a /dev/urandom /dev/random; fi
|
|
||||||
script:
|
script:
|
||||||
- cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug
|
- .travisci/build_and_test.sh
|
||||||
- make -j$NUMCORES
|
|
||||||
- ./test/gitversion/gitversion-test
|
|
||||||
- ./test/cpp-utils/cpp-utils-test
|
|
||||||
# TODO Also run on osx once fixed
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./test/fspp/fspp-test || exit 1; fi
|
|
||||||
- ./test/parallelaccessstore/parallelaccessstore-test
|
|
||||||
- ./test/blockstore/blockstore-test
|
|
||||||
- ./test/blobstore/blobstore-test
|
|
||||||
# TODO Also run on osx once fixed
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./test/cryfs/cryfs-test || exit 1; fi
|
|
||||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./test/cryfs-cli/cryfs-cli-test || exit 1; fi
|
|
||||||
|
33
.travisci/build_and_test.sh
Executable file
33
.travisci/build_and_test.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Detect number of CPU cores
|
||||||
|
export NUMCORES=`grep -c ^processor /proc/cpuinfo`
|
||||||
|
if [ ! -n "$NUMCORES" ]; then
|
||||||
|
export NUMCORES=`sysctl -n hw.ncpu`
|
||||||
|
fi
|
||||||
|
echo Using $NUMCORES cores
|
||||||
|
|
||||||
|
# Setup target directory
|
||||||
|
mkdir cmake
|
||||||
|
cd cmake
|
||||||
|
cmake --version
|
||||||
|
|
||||||
|
# Build
|
||||||
|
cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug
|
||||||
|
make -j$NUMCORES
|
||||||
|
|
||||||
|
# Test
|
||||||
|
./test/gitversion/gitversion-test
|
||||||
|
./test/cpp-utils/cpp-utils-test
|
||||||
|
./test/parallelaccessstore/parallelaccessstore-test
|
||||||
|
./test/blockstore/blockstore-test
|
||||||
|
./test/blobstore/blobstore-test
|
||||||
|
|
||||||
|
# TODO Also run on osx once fixed
|
||||||
|
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
||||||
|
./test/fspp/fspp-test
|
||||||
|
./test/cryfs/cryfs-test
|
||||||
|
./test/cryfs-cli/cryfs-cli-test
|
||||||
|
fi
|
31
.travisci/install.sh
Executable file
31
.travisci/install.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Use new clang on linux
|
||||||
|
if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ "$CXX" = "clang++" ]; then
|
||||||
|
export CXX="clang++-3.7" CC="clang-3.7"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
if [ "${TRAVIS_OS_NAME}" == "osx" ] && ["${CXX}" = "g++" ]; then
|
||||||
|
export CXX="g++-4.8" CC="gcc-4.8"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
||||||
|
./.travisci/install_boost.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
|
||||||
|
brew cask install osxfuse
|
||||||
|
brew install cryptopp
|
||||||
|
fi
|
||||||
|
|
||||||
|
# By default, travis only fetches the newest 50 commits. We need more in case we're further from the last version tag, so the build doesn't fail because it can't generate the version number.
|
||||||
|
git fetch --unshallow
|
||||||
|
|
||||||
|
# Use /dev/urandom when /dev/random is accessed, because travis doesn't have enough entropy
|
||||||
|
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
||||||
|
sudo cp -a /dev/urandom /dev/random
|
||||||
|
fi
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "ErrorCodes.h"
|
#include "ErrorCodes.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
void ModifyBaseBlock(const blockstore::BlockId &blockId) {
|
void ModifyBaseBlock(const blockstore::BlockId &blockId) {
|
||||||
auto block = baseBlockStore->load(blockId).value();
|
auto block = baseBlockStore->load(blockId).value();
|
||||||
byte* middle_byte = static_cast<CryptoPP::byte*>(block.data()) + 10;
|
CryptoPP::byte* middle_byte = static_cast<CryptoPP::byte*>(block.data()) + 10;
|
||||||
*middle_byte = *middle_byte + 1;
|
*middle_byte = *middle_byte + 1;
|
||||||
baseBlockStore->store(blockId, block);
|
baseBlockStore->store(blockId, block);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
void modifyBlock(const blockstore::BlockId &blockId) {
|
void modifyBlock(const blockstore::BlockId &blockId) {
|
||||||
auto block = blockStore->load(blockId).value();
|
auto block = blockStore->load(blockId).value();
|
||||||
byte* first_byte = static_cast<byte*>(block.data());
|
CryptoPP::byte* first_byte = static_cast<CryptoPP::byte*>(block.data());
|
||||||
*first_byte = *first_byte + 1;
|
*first_byte = *first_byte + 1;
|
||||||
blockStore->store(blockId, block);
|
blockStore->store(blockId, block);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user