Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
07d69d04
Unverified
Commit
07d69d04
authored
Jul 16, 2018
by
Feng Xiao
Committed by
GitHub
Jul 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4916 from xfxyjwf/docker
Add cpp tests under release docker image.
parents
78944e14
9de4e64c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
107 deletions
+29
-107
autogen.sh
autogen.sh
+5
-0
build.sh
kokoro/linux/cpp_distcheck/build.sh
+11
-3
pull_request_in_docker.sh
kokoro/linux/pull_request_in_docker.sh
+1
-1
map_entry.h
src/google/protobuf/map_entry.h
+6
-6
tests.sh
tests.sh
+6
-97
No files found.
autogen.sh
View file @
07d69d04
...
@@ -28,6 +28,11 @@ fi
...
@@ -28,6 +28,11 @@ fi
set
-ex
set
-ex
# The absence of a m4 directory in googletest causes autoreconf to fail when
# building under the CentOS docker image. It's a warning in regular build on
# Ubuntu/gLinux as well.
mkdir
-p
third_party/googletest/m4
# TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings.
# TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings.
autoreconf
-f
-i
-Wall
,no-obsolete
autoreconf
-f
-i
-Wall
,no-obsolete
...
...
kokoro/linux/cpp_distcheck/build.sh
View file @
07d69d04
...
@@ -5,7 +5,15 @@
...
@@ -5,7 +5,15 @@
# Change to repo root
# Change to repo root
cd
$(
dirname
$0
)
/../../..
cd
$(
dirname
$0
)
/../../..
# Prepare worker environment to run tests
source
kokoro/linux/prepare_build_linux_rc
./tests.sh cpp_distcheck
./tests.sh cpp_distcheck
# Run tests under release docker image.
DOCKER_IMAGE_NAME
=
protobuf/protoc_
$(
sha1sum
protoc-artifacts/Dockerfile |
cut
-f1
-d
" "
)
docker pull
$DOCKER_IMAGE_NAME
docker run
-v
$(
pwd
)
:/var/local/protobuf
--rm
$DOCKER_IMAGE_NAME
\
bash
-l
/var/local/protobuf/tests.sh cpp
||
FAILED
=
"true"
if
[
"
$FAILED
"
=
"true"
]
;
then
exit
1
fi
kokoro/linux/pull_request_in_docker.sh
View file @
07d69d04
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
WORKSPACE_BASE
=
`
pwd
`
WORKSPACE_BASE
=
`
pwd
`
MY_DIR
=
"
$(
dirname
"
$0
"
)
"
MY_DIR
=
"
$(
dirname
"
$0
"
)
"
TEST_SCRIPT
=
$MY_DIR
/../.
./tests.sh
TEST_SCRIPT
=
./tests.sh
BUILD_DIR
=
/tmp/protobuf
BUILD_DIR
=
/tmp/protobuf
set
-e
# exit immediately on error
set
-e
# exit immediately on error
...
...
src/google/protobuf/map_entry.h
View file @
07d69d04
...
@@ -95,12 +95,12 @@ class MapEntry
...
@@ -95,12 +95,12 @@ class MapEntry
typedef
void
InternalArenaConstructable_
;
typedef
void
InternalArenaConstructable_
;
typedef
void
DestructorSkippable_
;
typedef
void
DestructorSkippable_
;
using
typename
MapEntryImpl
<
Derived
,
Message
,
Key
,
Value
,
kKeyFieldType
,
typedef
typename
MapEntryImpl
<
kValueFieldType
,
Derived
,
Message
,
Key
,
Value
,
kKeyFieldType
,
kValueFieldType
,
default_enum_value
>::
KeyTypeHandler
;
default_enum_value
>::
KeyTypeHandler
KeyTypeHandler
;
using
typename
MapEntryImpl
<
Derived
,
Message
,
Key
,
Value
,
kKeyFieldType
,
typedef
typename
MapEntryImpl
<
kValueFieldType
,
Derived
,
Message
,
Key
,
Value
,
kKeyFieldType
,
kValueFieldType
,
default_enum_value
>::
ValueTypeHandler
;
default_enum_value
>::
ValueTypeHandler
ValueTypeHandler
;
size_t
SpaceUsedLong
()
const
override
{
size_t
SpaceUsedLong
()
const
override
{
size_t
size
=
sizeof
(
Derived
);
size_t
size
=
sizeof
(
Derived
);
size
+=
KeyTypeHandler
::
SpaceUsedInMapEntryLong
(
this
->
key_
);
size
+=
KeyTypeHandler
::
SpaceUsedInMapEntryLong
(
this
->
key_
);
...
...
tests.sh
View file @
07d69d04
#!/bin/bash
#!/bin/bash
#
#
# Build and runs tests for the protobuf project. The tests as written here are
# Build and runs tests for the protobuf project. We use this script to run
# used by both Jenkins and Travis, though some specialized logic is required to
# tests on kokoro (Ubuntu and MacOS). It can run locally as well but you
# handle the differences between them.
# will need to make sure the required compilers/tools are available.
on_travis
()
{
if
[
"
$TRAVIS
"
==
"true"
]
;
then
"
$@
"
fi
}
# 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.
...
@@ -18,15 +12,6 @@ internal_build_cpp() {
...
@@ -18,15 +12,6 @@ internal_build_cpp() {
return
return
fi
fi
if
[[
$(
uname
-s
)
==
"Linux"
&&
"
$TRAVIS
"
==
"true"
]]
;
then
# 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.
sudo
add-apt-repository ppa:ubuntu-toolchain-r/test
-y
sudo
apt-get update
-qq
sudo
apt-get
install
-qq
g++-4.8
export
CXX
=
"g++-4.8"
CC
=
"gcc-4.8"
fi
# Initialize any submodules.
# Initialize any submodules.
git submodule update
--init
--recursive
git submodule update
--init
--recursive
...
@@ -43,8 +28,6 @@ build_cpp() {
...
@@ -43,8 +28,6 @@ build_cpp() {
# The benchmark code depends on cmake, so test if it is installed before
# The benchmark code depends on cmake, so test if it is installed before
# trying to do the build.
# trying to do the build.
# NOTE: The travis macOS images say they have cmake, but the xcode8.1 image
# appears to be missing it: https://github.com/travis-ci/travis-ci/issues/6996
if
[[
$(
type
cmake 2>/dev/null
)
]]
;
then
if
[[
$(
type
cmake 2>/dev/null
)
]]
;
then
# Verify benchmarking code can build successfully.
# Verify benchmarking code can build successfully.
cd
benchmarks
&&
make cpp-benchmark
&&
cd
..
cd
benchmarks
&&
make cpp-benchmark
&&
cd
..
...
@@ -121,10 +104,6 @@ build_golang() {
...
@@ -121,10 +104,6 @@ build_golang() {
# Add protoc to the path so that the examples build finds it.
# Add protoc to the path so that the examples build finds it.
export
PATH
=
"
`
pwd
`
/src:
$PATH
"
export
PATH
=
"
`
pwd
`
/src:
$PATH
"
# Install Go and the Go protobuf compiler plugin.
on_travis
sudo
apt-get update
-qq
on_travis
sudo
apt-get
install
-qq
golang
export
GOPATH
=
"
$HOME
/gocode"
export
GOPATH
=
"
$HOME
/gocode"
mkdir
-p
"
$GOPATH
/src/github.com/google"
mkdir
-p
"
$GOPATH
/src/github.com/google"
rm
-f
"
$GOPATH
/src/github.com/google/protobuf"
rm
-f
"
$GOPATH
/src/github.com/google/protobuf"
...
@@ -139,27 +118,17 @@ use_java() {
...
@@ -139,27 +118,17 @@ use_java() {
version
=
$1
version
=
$1
case
"
$version
"
in
case
"
$version
"
in
jdk7
)
jdk7
)
on_travis
sudo
apt-get
install
openjdk-7-jdk
export
PATH
=
/usr/lib/jvm/java-7-openjdk-amd64/bin:
$PATH
export
PATH
=
/usr/lib/jvm/java-7-openjdk-amd64/bin:
$PATH
export
JAVA_HOME
=
/usr/lib/jvm/java-7-openjdk-amd64
export
JAVA_HOME
=
/usr/lib/jvm/java-7-openjdk-amd64
;;
;;
oracle7
)
oracle7
)
if
[
"
$TRAVIS
"
==
"true"
]
;
then
sudo
apt-get
install
python-software-properties
# for apt-add-repository
echo
"oracle-java7-installer shared/accepted-oracle-license-v1-1 select true"
|
\
sudo
debconf-set-selections
yes
|
sudo
apt-add-repository ppa:webupd8team/java
yes
|
sudo
apt-get
install
oracle-java7-installer
fi
;
export
PATH
=
/usr/lib/jvm/java-7-oracle/bin:
$PATH
export
PATH
=
/usr/lib/jvm/java-7-oracle/bin:
$PATH
export
JAVA_HOME
=
/usr/lib/jvm/java-7-openjdk-amd64
export
JAVA_HOME
=
/usr/lib/jvm/java-7-openjdk-amd64
;;
;;
esac
esac
if
[
"
$TRAVIS
"
!=
"true"
]
;
then
MAVEN_LOCAL_REPOSITORY
=
/var/maven_local_repository
MAVEN_LOCAL_REPOSITORY
=
/var/maven_local_repository
MVN
=
"
$MVN
-e -X --offline -Dmaven.repo.local=
$MAVEN_LOCAL_REPOSITORY
"
MVN
=
"
$MVN
-e -X --offline -Dmaven.repo.local=
$MAVEN_LOCAL_REPOSITORY
"
fi
;
which java
which java
java
-version
java
-version
...
@@ -190,12 +159,6 @@ build_java_with_conformance_tests() {
...
@@ -190,12 +159,6 @@ build_java_with_conformance_tests() {
cd
conformance
&&
make test_java
&&
cd
..
cd
conformance
&&
make test_java
&&
cd
..
}
}
build_javanano
()
{
# Java build needs `protoc`.
internal_build_cpp
cd
javanano
&&
$MVN
test
&&
cd
..
}
build_java_jdk7
()
{
build_java_jdk7
()
{
use_java jdk7
use_java jdk7
build_java_with_conformance_tests
build_java_with_conformance_tests
...
@@ -213,38 +176,6 @@ build_java_compatibility() {
...
@@ -213,38 +176,6 @@ build_java_compatibility() {
./test.sh 3.0.0-beta-4
./test.sh 3.0.0-beta-4
}
}
build_javanano_jdk7
()
{
use_java jdk7
build_javanano
}
build_javanano_oracle7
()
{
use_java oracle7
build_javanano
}
internal_install_python_deps
()
{
if
[
"
$TRAVIS
"
!=
"true"
]
;
then
return
;
fi
# Install tox (OS X doesn't have pip).
if
[
$(
uname
-s
)
==
"Darwin"
]
;
then
brew upgrade python
python3
-m
pip
install
tox
else
sudo
pip
install
tox
fi
# Only install Python2.6/3.x on Linux.
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
sudo
apt-get
install
-y
python-software-properties
# for apt-add-repository
sudo
apt-add-repository
-y
ppa:fkrull/deadsnakes
sudo
apt-get update
-qq
sudo
apt-get
install
-y
python3.3 python3.3-dev
sudo
apt-get
install
-y
python3.4 python3.4-dev
sudo
apt-get
install
-y
python3.5 python3.5-dev
sudo
apt-get
install
-y
python3.6 python3.6-dev
fi
}
build_objectivec_ios
()
{
build_objectivec_ios
()
{
# Reused the build script that takes care of configuring and ensuring things
# Reused the build script that takes care of configuring and ensuring things
# are up to date. The OS X test runs the objc conformance test, so skip it
# are up to date. The OS X test runs the objc conformance test, so skip it
...
@@ -279,9 +210,7 @@ build_objectivec_cocoapods_integration() {
...
@@ -279,9 +210,7 @@ build_objectivec_cocoapods_integration() {
build_python
()
{
build_python
()
{
internal_build_cpp
internal_build_cpp
internal_install_python_deps
cd
python
cd
python
# Only test Python 2.6/3.x on Linux
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
envlist
=
py
\{
27,33,34,35,36
\}
-python
envlist
=
py
\{
27,33,34,35,36
\}
-python
else
else
...
@@ -293,11 +222,9 @@ build_python() {
...
@@ -293,11 +222,9 @@ build_python() {
build_python_cpp
()
{
build_python_cpp
()
{
internal_build_cpp
internal_build_cpp
internal_install_python_deps
export
LD_LIBRARY_PATH
=
../src/.libs
# for Linux
export
LD_LIBRARY_PATH
=
../src/.libs
# for Linux
export
DYLD_LIBRARY_PATH
=
../src/.libs
# for OS X
export
DYLD_LIBRARY_PATH
=
../src/.libs
# for OS X
cd
python
cd
python
# Only test Python 3.x on Linux
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
envlist
=
py
\{
27,33,34,35,36
\}
-cpp
envlist
=
py
\{
27,33,34,35,36
\}
-cpp
else
else
...
@@ -337,21 +264,12 @@ build_ruby25() {
...
@@ -337,21 +264,12 @@ build_ruby25() {
internal_build_cpp
# For conformance tests.
internal_build_cpp
# For conformance tests.
cd
ruby
&&
bash travis-test.sh ruby-2.5.0
&&
cd
..
cd
ruby
&&
bash travis-test.sh ruby-2.5.0
&&
cd
..
}
}
build_jruby
()
{
internal_build_cpp
# For conformance tests.
# TODO(xiaofeng): Upgrade to jruby-9.x. There are some broken jests to be
# fixed.
cd
ruby
&&
bash travis-test.sh jruby-1.7
&&
cd
..
}
build_ruby_all
()
{
build_ruby_all
()
{
build_ruby21
build_ruby21
build_ruby22
build_ruby22
build_ruby23
build_ruby23
build_ruby24
build_ruby24
build_ruby25
build_ruby25
# TODO(teboring): Disable jruby test temperarily for it randomly fails.
# https://grpc-testing.appspot.com/job/protobuf_pull_request/735/consoleFull.
# build_jruby
}
}
build_javascript
()
{
build_javascript
()
{
...
@@ -632,14 +550,6 @@ build_php_all() {
...
@@ -632,14 +550,6 @@ build_php_all() {
build_php_compatibility
build_php_compatibility
}
}
# 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
# support, this should probably get updated to install steps and/or
# rvm/gemfile/jdk/etc. entries rather than manually doing the work.
# .travis.yml uses matrix.exclude to block the cases where app-get can't be
# use to install things.
# -------- main --------
# -------- main --------
if
[
"$#"
-ne
1
]
;
then
if
[
"$#"
-ne
1
]
;
then
...
@@ -650,8 +560,6 @@ Usage: $0 { cpp |
...
@@ -650,8 +560,6 @@ Usage: $0 { cpp |
java_jdk7 |
java_jdk7 |
java_oracle7 |
java_oracle7 |
java_compatibility |
java_compatibility |
javanano_jdk7 |
javanano_oracle7 |
objectivec_ios |
objectivec_ios |
objectivec_ios_debug |
objectivec_ios_debug |
objectivec_ios_release |
objectivec_ios_release |
...
@@ -680,4 +588,5 @@ fi
...
@@ -680,4 +588,5 @@ fi
set
-e
# exit immediately on error
set
-e
# exit immediately on error
set
-x
# display all commands
set
-x
# display all commands
cd
$(
dirname
$0
)
eval
"build_
$1
"
eval
"build_
$1
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment