1
0

Merge pull request #2380 from cuberite/travis

Use container-based infrastructure
This commit is contained in:
Tiger Wang 2015-08-20 17:18:08 +01:00
commit a341419b04
6 changed files with 25 additions and 15 deletions

View File

@ -1,20 +1,17 @@
language: cpp
sudo: false
compiler:
- clang
- gcc
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
install:
- sudo apt-get install -qq g++-4.8
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90
# lua, needed for style checking and possibly later on for bindings generation
- sudo apt-get install -qq lua5.1
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- lua5.1
script: ./CIbuild.sh
@ -26,3 +23,4 @@ notifications:
email:
on_success: change
on_failure: always

View File

@ -6,6 +6,11 @@ export MCSERVER_BUILD_SERIES_NAME="Travis $CC $TRAVIS_MCSERVER_BUILD_TYPE"
export MCSERVER_BUILD_ID=$TRAVIS_JOB_NUMBER
export MCSERVER_BUILD_DATETIME=`date`
if [ "$CXX" == "g++" ]; then
# This is a temporary workaround to allow the identification of GCC-4.8 by CMake, required for C++11 features
# Travis Docker containers don't allow sudo, which update-alternatives needs, and it seems no alternative to this command is provided, hence:
export CXX="/usr/bin/g++-4.8"
fi
cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1;
echo "Checking basic style..."

View File

@ -266,11 +266,18 @@ macro(set_exe_flags)
add_flags_cxx("-Wno-documentation")
endif()
if ("${CLANG_VERSION}" VERSION_GREATER 3.5)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wno-reserved-id-macro HAS_NO_RESERVED_ID_MACRO)
check_cxx_compiler_flag(-Wno-documentation-unknown-command HAS_NO_DOCUMENTATION_UNKNOWN)
if (HAS_NO_RESERVED_ID_MACRO)
# Use this flag to ignore error for a reserved macro problem in sqlite 3
add_flags_cxx("-Wno-reserved-id-macro")
endif()
if (HAS_NO_DOCUMENTATION_UNKNOWN)
# Ignore another problem in sqlite
add_flags_cxx("-Wno-documentation-unknown-command")
endif()
add_flags_cxx("-Wno-format-pedantic")
endif()
endif()
endif()

View File

@ -868,7 +868,7 @@ cLuaState::cStackValue cLuaState::WalkToValue(const AString & a_Name)
// Remove the previous value from the stack (keep only the new one):
lua_remove(m_LuaState, -2);
} // for elem - path[]
return std::move(cStackValue(*this));
return cStackValue(*this);
}

View File

@ -1040,7 +1040,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm
{
// Sum up all the enchantments' weights:
int AllWeights = 0;
for (const auto Enchantment : a_Enchantments)
for (const auto & Enchantment : a_Enchantments)
{
AllWeights += Enchantment.m_Weight;
}
@ -1054,7 +1054,7 @@ cEnchantments cEnchantments::SelectEnchantmentFromVector(const cWeightedEnchantm
// Pick a random enchantment:
cNoise Noise(a_Seed);
int RandomNumber = Noise.IntNoise1DInt(AllWeights) / 7 % AllWeights;
for (const auto Enchantment : a_Enchantments)
for (const auto & Enchantment : a_Enchantments)
{
RandomNumber -= Enchantment.m_Weight;
if (RandomNumber <= 0)

View File

@ -724,7 +724,7 @@ void cProtocol180::SendMapData(const cMap & a_Map, int a_DataStartX, int a_DataS
Pkt.WriteBEUInt8(static_cast<UInt8>(a_Map.GetScale()));
Pkt.WriteVarInt32(static_cast<UInt32>(a_Map.GetDecorators().size()));
for (const auto Decorator : a_Map.GetDecorators())
for (const auto & Decorator : a_Map.GetDecorators())
{
Pkt.WriteBEUInt8(static_cast<Byte>((static_cast<Int32>(Decorator.GetType()) << 4) | (Decorator.GetRot() & 0xF)));
Pkt.WriteBEUInt8(static_cast<UInt8>(Decorator.GetPixelX()));