Added ccache support.

pull/1295/head
Josh Haberman 9 years ago
parent 57be1d7eb2
commit d33e93b833
  1. 9
      tools/docker/Dockerfile
  2. 4
      tools/run_tests/jenkins.sh
  3. 8
      tools/run_tests/tests.sh
  4. 7
      tools/run_tests/travis.sh

@ -36,6 +36,7 @@ RUN apt-get update && apt-get install -y \
autotools-dev \ autotools-dev \
build-essential \ build-essential \
bzip2 \ bzip2 \
ccache \
curl \ curl \
gcc \ gcc \
git \ git \
@ -53,5 +54,13 @@ RUN apt-get update && apt-get install -y \
wget \ wget \
zip && apt-get clean zip && apt-get clean
# Prepare ccache
RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
RUN ln -s /usr/bin/ccache /usr/local/bin/g++
RUN ln -s /usr/bin/ccache /usr/local/bin/cc
RUN ln -s /usr/bin/ccache /usr/local/bin/c++
RUN ln -s /usr/bin/ccache /usr/local/bin/clang
RUN ln -s /usr/bin/ccache /usr/local/bin/clang++
# Define the default command. # Define the default command.
CMD ["bash"] CMD ["bash"]

@ -5,9 +5,13 @@ BUILD_DIR=/tmp/protobuf
source $MY_DIR/tests.sh source $MY_DIR/tests.sh
# Set value used in tests.sh.
PARALLELISM=-j8
rm -rf $BUILD_DIR rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR mkdir -p $BUILD_DIR
cd $BUILD_DIR cd $BUILD_DIR
git clone /var/local/jenkins/protobuf git clone /var/local/jenkins/protobuf
cd protobuf cd protobuf
build_cpp build_cpp

@ -4,7 +4,7 @@
# For when some other test needs the C++ main build, including protoc and # For when some other test needs the C++ main build, including protoc and
# libprotobuf. # libprotobuf.
internal_build_cpp() { internal_build_cpp() {
if [ $(uname -s) == "Linux" && "$TRAVIS" == "true" ]; then if [[ $(uname -s) == "Linux" && "$TRAVIS" == "true" ]]; then
# Install GCC 4.8 to replace the default GCC 4.6. We need 4.8 for more # Install GCC 4.8 to replace the default GCC 4.6. We need 4.8 for more
# decent C++ 11 support in order to compile conformance tests. # decent C++ 11 support in order to compile conformance tests.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
@ -15,19 +15,19 @@ internal_build_cpp() {
./autogen.sh ./autogen.sh
./configure ./configure
make -j2 make $PARALLELISM
} }
build_cpp() { build_cpp() {
internal_build_cpp internal_build_cpp
make check -j2 make check $PARALLELISM
cd conformance && make test_cpp && cd .. cd conformance && make test_cpp && cd ..
} }
build_cpp_distcheck() { build_cpp_distcheck() {
./autogen.sh ./autogen.sh
./configure ./configure
make distcheck -j2 make distcheck $PARALLELISM
} }
build_csharp() { build_csharp() {

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
my_dir="$(dirname "$0")" MY_DIR="$(dirname "$0")"
source $my_dir/tests.sh source $MY_DIR/tests.sh
# Note: travis currently does not support testing more than one language so the # Note: travis currently does not support testing more than one language so the
# .travis.yml cheats and claims to only be cpp. If they add multiple language # .travis.yml cheats and claims to only be cpp. If they add multiple language
@ -14,6 +14,9 @@ source $my_dir/tests.sh
# -------- main -------- # -------- main --------
# Set value used in tests.sh.
PARALLELISM=-j2
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
echo " echo "
Usage: $0 { cpp | Usage: $0 { cpp |

Loading…
Cancel
Save