diff --git a/kokoro/linux/cpp_tcmalloc/build.sh b/kokoro/linux/cpp_tcmalloc/build.sh new file mode 100755 index 0000000000..3c77b11e70 --- /dev/null +++ b/kokoro/linux/cpp_tcmalloc/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Build file to set up and run tests + +# Change to repo root +cd $(dirname $0)/../../.. + +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/cpp_tcmalloc +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="cpp_tcmalloc" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/cpp_tcmalloc/continuous.cfg b/kokoro/linux/cpp_tcmalloc/continuous.cfg new file mode 100644 index 0000000000..46312a9be2 --- /dev/null +++ b/kokoro/linux/cpp_tcmalloc/continuous.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/cpp_tcmalloc/build.sh" +timeout_mins: 1440 diff --git a/kokoro/linux/cpp_tcmalloc/presubmit.cfg b/kokoro/linux/cpp_tcmalloc/presubmit.cfg new file mode 100644 index 0000000000..46312a9be2 --- /dev/null +++ b/kokoro/linux/cpp_tcmalloc/presubmit.cfg @@ -0,0 +1,5 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/cpp_tcmalloc/build.sh" +timeout_mins: 1440 diff --git a/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile b/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile new file mode 100644 index 0000000000..0ce9982ad4 --- /dev/null +++ b/kokoro/linux/dockerfile/test/cpp_tcmalloc/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:jessie + +# Install dependencies. We start with the basic ones require to build protoc +# and the C++ build +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + git \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + parallel \ + time \ + wget \ + && apt-get clean + +# Install dependencies for TC malloc +RUN apt-get install -y \ + google-perftools \ + libgoogle-perftools4 \ + libgoogle-perftools-dev diff --git a/tests.sh b/tests.sh index 5b369485e2..2f453bdc80 100755 --- a/tests.sh +++ b/tests.sh @@ -38,6 +38,15 @@ build_cpp() { fi } +build_cpp_tcmalloc() { + internal_build_cpp + ./configure LIBS=-ltcmalloc && make clean && make \ + PTHREAD_CFLAGS='-pthread -DGOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN' \ + check + cd src + PPROF_PATH=/usr/bin/google-pprof HEAPCHECK=draconian ./protobuf-test +} + build_cpp_distcheck() { # Initialize any submodules. git submodule update --init --recursive