Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 1 | #!/bin/bash |
Josh Haberman | 67c727c | 2016-03-04 14:21:18 -0800 | [diff] [blame] | 2 | # |
| 3 | # Build and runs tests for the protobuf project. The tests as written here are |
| 4 | # used by both Jenkins and Travis, though some specialized logic is required to |
| 5 | # handle the differences between them. |
Thomas Van Lenten | c4d3638 | 2015-06-09 13:35:41 -0400 | [diff] [blame] | 6 | |
Josh Haberman | 0f8c25d | 2016-02-19 09:11:38 -0800 | [diff] [blame] | 7 | on_travis() { |
| 8 | if [ "$TRAVIS" == "true" ]; then |
| 9 | "$@" |
| 10 | fi |
| 11 | } |
| 12 | |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 13 | # For when some other test needs the C++ main build, including protoc and |
| 14 | # libprotobuf. |
| 15 | internal_build_cpp() { |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 16 | if [ -f src/protoc ]; then |
| 17 | # Already built. |
| 18 | return |
| 19 | fi |
| 20 | |
Josh Haberman | d33e93b | 2016-02-18 19:13:07 -0800 | [diff] [blame] | 21 | if [[ $(uname -s) == "Linux" && "$TRAVIS" == "true" ]]; then |
Feng Xiao | 9125863 | 2015-12-21 03:34:28 -0800 | [diff] [blame] | 22 | # Install GCC 4.8 to replace the default GCC 4.6. We need 4.8 for more |
| 23 | # decent C++ 11 support in order to compile conformance tests. |
| 24 | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 25 | sudo apt-get update -qq |
| 26 | sudo apt-get install -qq g++-4.8 |
| 27 | export CXX="g++-4.8" CC="gcc-4.8" |
| 28 | fi |
Feng Xiao | 1e2fece | 2015-12-18 15:16:07 -0800 | [diff] [blame] | 29 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 30 | ./autogen.sh |
Paul Yang | daba665 | 2016-10-07 16:09:26 -0700 | [diff] [blame] | 31 | ./configure CXXFLAGS="-fPIC" # -fPIC is needed for python cpp test. |
| 32 | # See python/setup.py for more details |
Josh Haberman | 67c727c | 2016-03-04 14:21:18 -0800 | [diff] [blame] | 33 | make -j2 |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | build_cpp() { |
| 37 | internal_build_cpp |
Josh Haberman | 67c727c | 2016-03-04 14:21:18 -0800 | [diff] [blame] | 38 | make check -j2 |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 39 | cd conformance && make test_cpp && cd .. |
Josh Haberman | cb36bde | 2016-04-29 09:52:20 -0700 | [diff] [blame] | 40 | |
Thomas Van Lenten | bc9d077 | 2016-12-08 16:19:58 -0500 | [diff] [blame] | 41 | # The benchmark code depends on cmake, so test if it is installed before |
| 42 | # trying to do the build. |
| 43 | # NOTE: The travis macOS images say they have cmake, but the xcode8.1 image |
| 44 | # appears to be missing it: https://github.com/travis-ci/travis-ci/issues/6996 |
| 45 | if [[ $(type cmake 2>/dev/null) ]]; then |
| 46 | # Verify benchmarking code can build successfully. |
| 47 | git submodule init |
| 48 | git submodule update |
| 49 | cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make && cd ../.. |
| 50 | cd benchmarks && make && ./generate-datasets && cd .. |
| 51 | else |
| 52 | echo "" |
| 53 | echo "WARNING: Skipping validation of the bench marking code, cmake isn't installed." |
| 54 | echo "" |
| 55 | fi |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | build_cpp_distcheck() { |
| 59 | ./autogen.sh |
| 60 | ./configure |
Feng Xiao | a4f68b1 | 2016-07-19 17:20:31 -0700 | [diff] [blame] | 61 | make dist |
| 62 | |
| 63 | # List all files that should be included in the distribution package. |
Jisi Liu | 55fdbe5 | 2017-08-23 11:35:48 -0700 | [diff] [blame] | 64 | git ls-files | grep "^\(java\|python\|objectivec\|csharp\|js\|ruby\|php\|cmake\|examples\|src/google/protobuf/.*\.proto\)" |\ |
Jie Luo | ea51149 | 2017-01-23 15:11:00 -0800 | [diff] [blame] | 65 | grep -v ".gitignore" | grep -v "java/compatibility_tests" |\ |
Jie Luo | 7288689 | 2017-02-09 16:49:52 -0800 | [diff] [blame] | 66 | grep -v "python/compatibility_tests" | grep -v "csharp/compatibility_tests" > dist.lst |
Feng Xiao | a4f68b1 | 2016-07-19 17:20:31 -0700 | [diff] [blame] | 67 | # Unzip the dist tar file. |
| 68 | DIST=`ls *.tar.gz` |
| 69 | tar -xf $DIST |
| 70 | cd ${DIST//.tar.gz} |
| 71 | # Check if every file exists in the dist tar file. |
| 72 | FILES_MISSING="" |
| 73 | for FILE in $(<../dist.lst); do |
| 74 | if ! file $FILE &>/dev/null; then |
| 75 | echo "$FILE is not found!" |
| 76 | FILES_MISSING="$FILE $FILES_MISSING" |
| 77 | fi |
| 78 | done |
| 79 | cd .. |
| 80 | if [ ! -z "$FILES_MISSING" ]; then |
| 81 | echo "Missing files in EXTRA_DIST: $FILES_MISSING" |
| 82 | exit 1 |
| 83 | fi |
| 84 | |
| 85 | # Do the regular dist-check for C++. |
Josh Haberman | 67c727c | 2016-03-04 14:21:18 -0800 | [diff] [blame] | 86 | make distcheck -j2 |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 87 | } |
| 88 | |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 89 | build_csharp() { |
Jon Skeet | 9a9a66e | 2017-10-25 08:03:50 +0100 | [diff] [blame] | 90 | # Required for conformance tests and to regenerate protos. |
Jon Skeet | b6defa7 | 2015-08-04 10:01:40 +0100 | [diff] [blame] | 91 | internal_build_cpp |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 92 | NUGET=/usr/local/bin/nuget.exe |
Jon Skeet | b6defa7 | 2015-08-04 10:01:40 +0100 | [diff] [blame] | 93 | |
Jon Skeet | 10a8fb4 | 2016-07-14 22:01:47 +0100 | [diff] [blame] | 94 | # Perform "dotnet new" once to get the setup preprocessing out of the |
| 95 | # way. That spews a lot of output (including backspaces) into logs |
| 96 | # otherwise, and can cause problems. It doesn't matter if this step |
| 97 | # is performed multiple times; it's cheap after the first time anyway. |
Jon Skeet | f26e8c2 | 2017-05-04 08:51:46 +0100 | [diff] [blame] | 98 | # (It also doesn't matter if it's unnecessary, which it will be on some |
| 99 | # systems. It's necessary on Jenkins in order to avoid unprintable |
| 100 | # characters appearing in the JUnit output.) |
Jon Skeet | 10a8fb4 | 2016-07-14 22:01:47 +0100 | [diff] [blame] | 101 | mkdir dotnettmp |
| 102 | (cd dotnettmp; dotnet new > /dev/null) |
| 103 | rm -rf dotnettmp |
| 104 | |
Jon Skeet | 9a9a66e | 2017-10-25 08:03:50 +0100 | [diff] [blame] | 105 | # Check that the protos haven't broken C# codegen. |
| 106 | # TODO(jonskeet): Fail if regenerating creates any changes. |
| 107 | csharp/generate_protos.sh |
| 108 | |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 109 | csharp/buildall.sh |
Josh Haberman | e891c29 | 2015-12-30 16:03:49 -0800 | [diff] [blame] | 110 | cd conformance && make test_csharp && cd .. |
Jie Luo | 7288689 | 2017-02-09 16:49:52 -0800 | [diff] [blame] | 111 | |
| 112 | # Run csharp compatibility test between 3.0.0 and the current version. |
| 113 | csharp/compatibility_tests/v3.0.0/test.sh 3.0.0 |
Jan Tattermusch | ddb36ef | 2015-05-18 17:34:02 -0700 | [diff] [blame] | 114 | } |
| 115 | |
Tim Swast | 7e31c4d | 2015-11-20 15:32:53 -0800 | [diff] [blame] | 116 | build_golang() { |
| 117 | # Go build needs `protoc`. |
| 118 | internal_build_cpp |
| 119 | # Add protoc to the path so that the examples build finds it. |
| 120 | export PATH="`pwd`/src:$PATH" |
| 121 | |
| 122 | # Install Go and the Go protobuf compiler plugin. |
Feng Xiao | 20fbb35 | 2016-07-21 18:04:56 -0700 | [diff] [blame] | 123 | on_travis sudo apt-get update -qq |
| 124 | on_travis sudo apt-get install -qq golang |
| 125 | |
Tim Swast | 7e31c4d | 2015-11-20 15:32:53 -0800 | [diff] [blame] | 126 | export GOPATH="$HOME/gocode" |
| 127 | mkdir -p "$GOPATH/src/github.com/google" |
Feng Xiao | 20fbb35 | 2016-07-21 18:04:56 -0700 | [diff] [blame] | 128 | rm -f "$GOPATH/src/github.com/google/protobuf" |
Tim Swast | 7e31c4d | 2015-11-20 15:32:53 -0800 | [diff] [blame] | 129 | ln -s "`pwd`" "$GOPATH/src/github.com/google/protobuf" |
| 130 | export PATH="$GOPATH/bin:$PATH" |
| 131 | go get github.com/golang/protobuf/protoc-gen-go |
| 132 | |
Feng Xiao | 8136ccb | 2017-09-12 12:00:20 -0700 | [diff] [blame] | 133 | cd examples && PROTO_PATH="-I../src -I." make gotest && cd .. |
Tim Swast | 7e31c4d | 2015-11-20 15:32:53 -0800 | [diff] [blame] | 134 | } |
| 135 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 136 | use_java() { |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 137 | version=$1 |
| 138 | case "$version" in |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 139 | jdk7) |
Josh Haberman | 0f8c25d | 2016-02-19 09:11:38 -0800 | [diff] [blame] | 140 | on_travis sudo apt-get install openjdk-7-jdk |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 141 | export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH |
Feng Xiao | ad49ed7 | 2016-07-21 11:37:46 -0700 | [diff] [blame] | 142 | export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 143 | ;; |
| 144 | oracle7) |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 145 | if [ "$TRAVIS" == "true" ]; then |
| 146 | sudo apt-get install python-software-properties # for apt-add-repository |
| 147 | echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | \ |
| 148 | sudo debconf-set-selections |
| 149 | yes | sudo apt-add-repository ppa:webupd8team/java |
| 150 | yes | sudo apt-get install oracle-java7-installer |
| 151 | fi; |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 152 | export PATH=/usr/lib/jvm/java-7-oracle/bin:$PATH |
Feng Xiao | ad49ed7 | 2016-07-21 11:37:46 -0700 | [diff] [blame] | 153 | export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 154 | ;; |
| 155 | esac |
| 156 | |
Josh Haberman | 1ee0fda | 2016-03-03 16:02:55 -0800 | [diff] [blame] | 157 | if [ "$TRAVIS" != "true" ]; then |
| 158 | MAVEN_LOCAL_REPOSITORY=/var/maven_local_repository |
| 159 | MVN="$MVN -e -X --offline -Dmaven.repo.local=$MAVEN_LOCAL_REPOSITORY" |
| 160 | fi; |
| 161 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 162 | which java |
| 163 | java -version |
Feng Xiao | ad49ed7 | 2016-07-21 11:37:46 -0700 | [diff] [blame] | 164 | $MVN -version |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 165 | } |
| 166 | |
Josh Haberman | d08c39c | 2016-02-20 12:03:39 -0800 | [diff] [blame] | 167 | # --batch-mode supresses download progress output that spams the logs. |
Josh Haberman | b28b3f6 | 2016-02-20 12:17:10 -0800 | [diff] [blame] | 168 | MVN="mvn --batch-mode" |
Josh Haberman | d08c39c | 2016-02-20 12:03:39 -0800 | [diff] [blame] | 169 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 170 | build_java() { |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame] | 171 | version=$1 |
| 172 | dir=java_$version |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 173 | # Java build needs `protoc`. |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 174 | internal_build_cpp |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame] | 175 | cp -r java $dir |
| 176 | cd $dir && $MVN clean && $MVN test |
Feng Xiao | 9e5fb55 | 2015-12-21 11:08:18 -0800 | [diff] [blame] | 177 | cd ../.. |
| 178 | } |
| 179 | |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame] | 180 | # The conformance tests are hard-coded to work with the $ROOT/java directory. |
| 181 | # So this can't run in parallel with two different sets of tests. |
Feng Xiao | 9e5fb55 | 2015-12-21 11:08:18 -0800 | [diff] [blame] | 182 | build_java_with_conformance_tests() { |
| 183 | # Java build needs `protoc`. |
| 184 | internal_build_cpp |
Josh Haberman | d08c39c | 2016-02-20 12:03:39 -0800 | [diff] [blame] | 185 | cd java && $MVN test && $MVN install |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame] | 186 | cd util && $MVN package assembly:single |
Feng Xiao | af81dcf | 2015-12-21 03:25:59 -0800 | [diff] [blame] | 187 | cd ../.. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 188 | cd conformance && make test_java && cd .. |
| 189 | } |
| 190 | |
| 191 | build_javanano() { |
| 192 | # Java build needs `protoc`. |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 193 | internal_build_cpp |
Josh Haberman | b28b3f6 | 2016-02-20 12:17:10 -0800 | [diff] [blame] | 194 | cd javanano && $MVN test && cd .. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 195 | } |
| 196 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 197 | build_java_jdk7() { |
| 198 | use_java jdk7 |
Feng Xiao | 9e5fb55 | 2015-12-21 11:08:18 -0800 | [diff] [blame] | 199 | build_java_with_conformance_tests |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 200 | } |
| 201 | build_java_oracle7() { |
| 202 | use_java oracle7 |
Josh Haberman | 2f3f1de | 2016-03-01 15:37:17 -0800 | [diff] [blame] | 203 | build_java oracle7 |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 204 | } |
Feng Xiao | baa4023 | 2016-07-29 14:11:21 -0700 | [diff] [blame] | 205 | build_java_compatibility() { |
| 206 | use_java jdk7 |
| 207 | internal_build_cpp |
| 208 | # Use the unit-tests extraced from 2.5.0 to test the compatibilty between |
| 209 | # 3.0.0-beta-4 and the current version. |
| 210 | cd java/compatibility_tests/v2.5.0 |
| 211 | ./test.sh 3.0.0-beta-4 |
| 212 | } |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 213 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 214 | build_javanano_jdk7() { |
| 215 | use_java jdk7 |
| 216 | build_javanano |
| 217 | } |
| 218 | build_javanano_oracle7() { |
| 219 | use_java oracle7 |
| 220 | build_javanano |
| 221 | } |
| 222 | |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 223 | internal_install_python_deps() { |
Josh Haberman | 483533d | 2016-02-19 12:48:33 -0800 | [diff] [blame] | 224 | if [ "$TRAVIS" != "true" ]; then |
| 225 | return; |
| 226 | fi |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 227 | # Install tox (OS X doesn't have pip). |
| 228 | if [ $(uname -s) == "Darwin" ]; then |
| 229 | sudo easy_install tox |
| 230 | else |
| 231 | sudo pip install tox |
| 232 | fi |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 233 | # Only install Python2.6/3.x on Linux. |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 234 | if [ $(uname -s) == "Linux" ]; then |
| 235 | sudo apt-get install -y python-software-properties # for apt-add-repository |
| 236 | sudo apt-add-repository -y ppa:fkrull/deadsnakes |
| 237 | sudo apt-get update -qq |
Jie Luo | c2aa26e | 2017-08-18 13:15:06 -0700 | [diff] [blame] | 238 | sudo apt-get install -y python3.3 python3.3-dev |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 239 | sudo apt-get install -y python3.4 python3.4-dev |
Jie Luo | 028d6f1 | 2017-08-22 10:36:52 -0700 | [diff] [blame] | 240 | sudo apt-get install -y python3.5 python3.5-dev |
| 241 | sudo apt-get install -y python3.6 python3.6-dev |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 242 | fi |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 243 | } |
| 244 | |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 245 | build_objectivec_ios() { |
Thomas Van Lenten | 368a2f4 | 2016-05-24 11:27:33 -0400 | [diff] [blame] | 246 | # Reused the build script that takes care of configuring and ensuring things |
| 247 | # are up to date. The OS X test runs the objc conformance test, so skip it |
| 248 | # here. |
| 249 | # Note: travis has xctool installed, and we've looked at using it in the past |
| 250 | # but it has ended up proving unreliable (bugs), an they are removing build |
| 251 | # support in favor of xcbuild (or just xcodebuild). |
| 252 | objectivec/DevTools/full_mac_build.sh \ |
| 253 | --core-only --skip-xcode-osx --skip-objc-conformance "$@" |
| 254 | } |
| 255 | |
| 256 | build_objectivec_ios_debug() { |
| 257 | build_objectivec_ios --skip-xcode-release |
| 258 | } |
| 259 | |
| 260 | build_objectivec_ios_release() { |
| 261 | build_objectivec_ios --skip-xcode-debug |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | build_objectivec_osx() { |
Thomas Van Lenten | 368a2f4 | 2016-05-24 11:27:33 -0400 | [diff] [blame] | 265 | # Reused the build script that takes care of configuring and ensuring things |
| 266 | # are up to date. |
| 267 | objectivec/DevTools/full_mac_build.sh \ |
| 268 | --core-only --skip-xcode-ios |
Thomas Van Lenten | 9642b82 | 2015-06-10 17:21:23 -0400 | [diff] [blame] | 269 | } |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 270 | |
Sergio Campamá | f0c1492 | 2016-06-14 11:26:01 -0700 | [diff] [blame] | 271 | build_objectivec_cocoapods_integration() { |
Sergio Campamá | f0c1492 | 2016-06-14 11:26:01 -0700 | [diff] [blame] | 272 | # Update pod to the latest version. |
| 273 | gem install cocoapods --no-ri --no-rdoc |
| 274 | objectivec/Tests/CocoaPods/run_tests.sh |
| 275 | } |
| 276 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 277 | build_python() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 278 | internal_build_cpp |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 279 | internal_install_python_deps |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 280 | cd python |
Dan O'Reilly | d9598ca | 2015-08-26 20:30:41 -0400 | [diff] [blame] | 281 | # Only test Python 2.6/3.x on Linux |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 282 | if [ $(uname -s) == "Linux" ]; then |
Jie Luo | 610e433 | 2017-08-22 16:23:21 -0700 | [diff] [blame] | 283 | envlist=py\{27,33,34,35,36\}-python |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 284 | else |
| 285 | envlist=py27-python |
| 286 | fi |
| 287 | tox -e $envlist |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 288 | cd .. |
| 289 | } |
| 290 | |
| 291 | build_python_cpp() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 292 | internal_build_cpp |
Dan O'Reilly | 5de2a81 | 2015-08-20 18:19:56 -0400 | [diff] [blame] | 293 | internal_install_python_deps |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 294 | export LD_LIBRARY_PATH=../src/.libs # for Linux |
| 295 | export DYLD_LIBRARY_PATH=../src/.libs # for OS X |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 296 | cd python |
Jie Luo | 610e433 | 2017-08-22 16:23:21 -0700 | [diff] [blame] | 297 | # Only test Python 3.x on Linux |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 298 | if [ $(uname -s) == "Linux" ]; then |
Jie Luo | 610e433 | 2017-08-22 16:23:21 -0700 | [diff] [blame] | 299 | envlist=py\{27,33,34,35,36\}-cpp |
Dan O'Reilly | 76f8a3f | 2015-08-21 18:51:47 -0400 | [diff] [blame] | 300 | else |
| 301 | envlist=py27-cpp |
| 302 | fi |
| 303 | tox -e $envlist |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 304 | cd .. |
| 305 | } |
| 306 | |
Jie Luo | ea51149 | 2017-01-23 15:11:00 -0800 | [diff] [blame] | 307 | build_python_compatibility() { |
| 308 | internal_build_cpp |
| 309 | # Use the unit-tests extraced from 2.5.0 to test the compatibilty. |
| 310 | cd python/compatibility_tests/v2.5.0 |
| 311 | # Test between 2.5.0 and the current version. |
| 312 | ./test.sh 2.5.0 |
| 313 | # Test between 3.0.0-beta-1 and the current version. |
| 314 | ./test.sh 3.0.0-beta-1 |
| 315 | } |
| 316 | |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 317 | build_ruby21() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 318 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 319 | cd ruby && bash travis-test.sh ruby-2.1 && cd .. |
| 320 | } |
| 321 | build_ruby22() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 322 | internal_build_cpp # For conformance tests. |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 323 | cd ruby && bash travis-test.sh ruby-2.2 && cd .. |
| 324 | } |
| 325 | build_jruby() { |
Josh Haberman | 181c7f2 | 2015-07-15 11:05:10 -0700 | [diff] [blame] | 326 | internal_build_cpp # For conformance tests. |
Feng Xiao | 20fbb35 | 2016-07-21 18:04:56 -0700 | [diff] [blame] | 327 | # TODO(xiaofeng): Upgrade to jruby-9.x. There are some broken jests to be |
| 328 | # fixed. |
| 329 | cd ruby && bash travis-test.sh jruby-1.7 && cd .. |
| 330 | } |
| 331 | build_ruby_all() { |
| 332 | build_ruby21 |
| 333 | build_ruby22 |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 334 | # TODO(teboring): Disable jruby test temperarily for it randomly fails. |
| 335 | # https://grpc-testing.appspot.com/job/protobuf_pull_request/735/consoleFull. |
Paul Yang | d8f54c4 | 2016-12-08 16:27:56 -0800 | [diff] [blame] | 336 | # build_jruby |
Chris Fallin | 20e94b2 | 2015-05-13 16:43:48 -0700 | [diff] [blame] | 337 | } |
| 338 | |
Josh Haberman | e9cf31e | 2015-12-21 15:18:17 -0800 | [diff] [blame] | 339 | build_javascript() { |
| 340 | internal_build_cpp |
Josh Haberman | 0d2d8bc | 2015-12-28 06:43:42 -0800 | [diff] [blame] | 341 | cd js && npm install && npm test && cd .. |
Josh Haberman | f873d32 | 2016-06-08 12:38:15 -0700 | [diff] [blame] | 342 | cd conformance && make test_nodejs && cd .. |
Josh Haberman | e9cf31e | 2015-12-21 15:18:17 -0800 | [diff] [blame] | 343 | } |
| 344 | |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 345 | generate_php_test_proto() { |
| 346 | internal_build_cpp |
| 347 | pushd php/tests |
| 348 | # Generate test file |
| 349 | rm -rf generated |
| 350 | mkdir generated |
Bo Yang | f46a01d | 2017-09-12 15:04:34 -0700 | [diff] [blame] | 351 | ../../src/protoc --php_out=generated \ |
| 352 | proto/test.proto \ |
| 353 | proto/test_include.proto \ |
| 354 | proto/test_no_namespace.proto \ |
| 355 | proto/test_prefix.proto \ |
| 356 | proto/test_php_namespace.proto \ |
| 357 | proto/test_empty_php_namespace.proto \ |
| 358 | proto/test_reserved_enum_lower.proto \ |
| 359 | proto/test_reserved_enum_upper.proto \ |
| 360 | proto/test_reserved_enum_value_lower.proto \ |
| 361 | proto/test_reserved_enum_value_upper.proto \ |
| 362 | proto/test_reserved_message_lower.proto \ |
| 363 | proto/test_reserved_message_upper.proto \ |
| 364 | proto/test_service.proto \ |
| 365 | proto/test_service_namespace.proto \ |
Paul Yang | c15a326 | 2017-08-02 07:42:27 -0700 | [diff] [blame] | 366 | proto/test_descriptors.proto |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 367 | pushd ../../src |
Paul Yang | bcda919 | 2017-11-03 12:30:09 -0700 | [diff] [blame] | 368 | ./protoc --php_out=../php/tests/generated -I../php/tests -I. \ |
| 369 | ../php/tests/proto/test_import_descriptor_proto.proto |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 370 | popd |
| 371 | popd |
| 372 | } |
| 373 | |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 374 | use_php() { |
| 375 | VERSION=$1 |
| 376 | PHP=`which php` |
| 377 | PHP_CONFIG=`which php-config` |
| 378 | PHPIZE=`which phpize` |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 379 | ln -sfn "/usr/local/php-${VERSION}/bin/php" $PHP |
| 380 | ln -sfn "/usr/local/php-${VERSION}/bin/php-config" $PHP_CONFIG |
| 381 | ln -sfn "/usr/local/php-${VERSION}/bin/phpize" $PHPIZE |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 382 | generate_php_test_proto |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 383 | } |
| 384 | |
Bo Yang | c96dd66 | 2016-10-04 17:32:08 +0000 | [diff] [blame] | 385 | use_php_zts() { |
| 386 | VERSION=$1 |
| 387 | PHP=`which php` |
| 388 | PHP_CONFIG=`which php-config` |
| 389 | PHPIZE=`which phpize` |
| 390 | ln -sfn "/usr/local/php-${VERSION}-zts/bin/php" $PHP |
| 391 | ln -sfn "/usr/local/php-${VERSION}-zts/bin/php-config" $PHP_CONFIG |
| 392 | ln -sfn "/usr/local/php-${VERSION}-zts/bin/phpize" $PHPIZE |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 393 | generate_php_test_proto |
Bo Yang | c96dd66 | 2016-10-04 17:32:08 +0000 | [diff] [blame] | 394 | } |
| 395 | |
Paul Yang | 51c5ff8 | 2016-10-25 17:27:05 -0700 | [diff] [blame] | 396 | use_php_bc() { |
| 397 | VERSION=$1 |
| 398 | PHP=`which php` |
| 399 | PHP_CONFIG=`which php-config` |
| 400 | PHPIZE=`which phpize` |
| 401 | ln -sfn "/usr/local/php-${VERSION}-bc/bin/php" $PHP |
| 402 | ln -sfn "/usr/local/php-${VERSION}-bc/bin/php-config" $PHP_CONFIG |
| 403 | ln -sfn "/usr/local/php-${VERSION}-bc/bin/phpize" $PHPIZE |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 404 | generate_php_test_proto |
Paul Yang | 51c5ff8 | 2016-10-25 17:27:05 -0700 | [diff] [blame] | 405 | } |
| 406 | |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 407 | build_php5.5() { |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 408 | use_php 5.5 |
Paul Yang | dd8d5f5 | 2017-03-08 14:31:34 -0800 | [diff] [blame] | 409 | |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 410 | pushd php |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 411 | rm -rf vendor |
| 412 | cp -r /usr/local/vendor-5.5 vendor |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 413 | wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit |
| 414 | phpunit |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 415 | popd |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 416 | pushd conformance |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 417 | make test_php |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 418 | popd |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 419 | } |
| 420 | |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 421 | build_php5.5_c() { |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 422 | use_php 5.5 |
| 423 | wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 424 | pushd php/tests |
| 425 | /bin/bash ./test.sh |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 426 | popd |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 427 | # TODO(teboring): Add it back |
| 428 | # pushd conformance |
| 429 | # make test_php_c |
| 430 | # popd |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 431 | } |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 432 | |
Bo Yang | c96dd66 | 2016-10-04 17:32:08 +0000 | [diff] [blame] | 433 | build_php5.5_zts_c() { |
| 434 | use_php_zts 5.5 |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 435 | wget https://phar.phpunit.de/phpunit-4.8.0.phar -O /usr/bin/phpunit |
Bo Yang | c96dd66 | 2016-10-04 17:32:08 +0000 | [diff] [blame] | 436 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 437 | # TODO(teboring): Add it back |
| 438 | # pushd conformance |
| 439 | # make test_php_zts_c |
| 440 | # popd |
Paul Yang | df83907 | 2016-11-10 11:20:50 -0800 | [diff] [blame] | 441 | } |
| 442 | |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 443 | build_php5.6() { |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 444 | use_php 5.6 |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 445 | pushd php |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 446 | rm -rf vendor |
| 447 | cp -r /usr/local/vendor-5.6 vendor |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 448 | wget https://phar.phpunit.de/phpunit-5.7.0.phar -O /usr/bin/phpunit |
| 449 | phpunit |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 450 | popd |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 451 | pushd conformance |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 452 | make test_php |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 453 | popd |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 454 | } |
| 455 | |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 456 | build_php5.6_c() { |
| 457 | use_php 5.6 |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 458 | wget https://phar.phpunit.de/phpunit-5.7.0.phar -O /usr/bin/phpunit |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 459 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 460 | # TODO(teboring): Add it back |
| 461 | # pushd conformance |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 462 | # make test_php_c |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 463 | # popd |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | build_php5.6_zts_c() { |
| 467 | use_php_zts 5.6 |
| 468 | wget https://phar.phpunit.de/phpunit-5.7.0.phar -O /usr/bin/phpunit |
| 469 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 470 | # TODO(teboring): Add it back |
| 471 | # pushd conformance |
| 472 | # make test_php_zts_c |
| 473 | # popd |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 474 | } |
| 475 | |
Bo Yang | 63448e6 | 2016-10-05 18:28:13 -0700 | [diff] [blame] | 476 | build_php5.6_mac() { |
Paul Yang | 46ae90d | 2016-12-08 11:16:49 -0800 | [diff] [blame] | 477 | generate_php_test_proto |
Bo Yang | 63448e6 | 2016-10-05 18:28:13 -0700 | [diff] [blame] | 478 | # Install PHP |
| 479 | curl -s https://php-osx.liip.ch/install.sh | bash -s 5.6 |
Paul Yang | 1f2dbc8 | 2016-11-08 11:38:34 -0800 | [diff] [blame] | 480 | PHP_FOLDER=`find /usr/local -type d -name "php5-5.6*"` # The folder name may change upon time |
| 481 | export PATH="$PHP_FOLDER/bin:$PATH" |
Bo Yang | 63448e6 | 2016-10-05 18:28:13 -0700 | [diff] [blame] | 482 | |
| 483 | # Install phpunit |
Paul Yang | c002743 | 2017-02-07 10:55:48 -0800 | [diff] [blame] | 484 | curl https://phar.phpunit.de/phpunit-5.6.10.phar -L -o phpunit.phar |
Bo Yang | 63448e6 | 2016-10-05 18:28:13 -0700 | [diff] [blame] | 485 | chmod +x phpunit.phar |
| 486 | sudo mv phpunit.phar /usr/local/bin/phpunit |
| 487 | |
| 488 | # Install valgrind |
| 489 | echo "#! /bin/bash" > valgrind |
| 490 | chmod ug+x valgrind |
| 491 | sudo mv valgrind /usr/local/bin/valgrind |
| 492 | |
| 493 | # Test |
| 494 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 495 | # TODO(teboring): Add it back |
| 496 | # pushd conformance |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 497 | # make test_php_c |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 498 | # popd |
Bo Yang | 63448e6 | 2016-10-05 18:28:13 -0700 | [diff] [blame] | 499 | } |
| 500 | |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 501 | build_php7.0() { |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 502 | use_php 7.0 |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 503 | pushd php |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 504 | rm -rf vendor |
| 505 | cp -r /usr/local/vendor-7.0 vendor |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 506 | wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit |
| 507 | phpunit |
Paul Yang | e3e38b8 | 2016-12-08 14:39:20 -0800 | [diff] [blame] | 508 | popd |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 509 | pushd conformance |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 510 | make test_php |
Paul Yang | 3975664 | 2017-02-01 12:47:58 -0800 | [diff] [blame] | 511 | popd |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 512 | } |
| 513 | |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 514 | build_php7.0_c() { |
| 515 | use_php 7.0 |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 516 | wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 517 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 518 | # TODO(teboring): Add it back |
| 519 | # pushd conformance |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 520 | # make test_php_c |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 521 | # popd |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 522 | } |
| 523 | |
| 524 | build_php7.0_zts_c() { |
| 525 | use_php_zts 7.0 |
| 526 | wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit |
| 527 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 528 | # TODO(teboring): Add it back. |
| 529 | # pushd conformance |
| 530 | # make test_php_zts_c |
| 531 | # popd |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | build_php7.0_mac() { |
| 535 | generate_php_test_proto |
| 536 | # Install PHP |
| 537 | curl -s https://php-osx.liip.ch/install.sh | bash -s 7.0 |
| 538 | PHP_FOLDER=`find /usr/local -type d -name "php7-7.0*"` # The folder name may change upon time |
| 539 | export PATH="$PHP_FOLDER/bin:$PATH" |
| 540 | |
| 541 | # Install phpunit |
| 542 | curl https://phar.phpunit.de/phpunit-5.6.0.phar -L -o phpunit.phar |
| 543 | chmod +x phpunit.phar |
| 544 | sudo mv phpunit.phar /usr/local/bin/phpunit |
| 545 | |
| 546 | # Install valgrind |
| 547 | echo "#! /bin/bash" > valgrind |
| 548 | chmod ug+x valgrind |
| 549 | sudo mv valgrind /usr/local/bin/valgrind |
| 550 | |
| 551 | # Test |
| 552 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 553 | # TODO(teboring): Add it back |
| 554 | # pushd conformance |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 555 | # make test_php_c |
Paul Yang | ecca6ea | 2017-06-30 12:14:09 -0700 | [diff] [blame] | 556 | # popd |
Bo Yang | 34cdaf4 | 2016-10-03 21:59:58 +0000 | [diff] [blame] | 557 | } |
| 558 | |
Paul Yang | 25abd7b | 2017-05-05 11:14:11 -0700 | [diff] [blame] | 559 | build_php_compatibility() { |
| 560 | internal_build_cpp |
| 561 | php/tests/compatibility_test.sh |
| 562 | } |
| 563 | |
Paul Yang | 2231931 | 2017-05-10 15:59:59 -0700 | [diff] [blame] | 564 | build_php7.1() { |
| 565 | use_php 7.1 |
| 566 | pushd php |
| 567 | rm -rf vendor |
| 568 | cp -r /usr/local/vendor-7.1 vendor |
| 569 | wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit |
| 570 | phpunit |
| 571 | popd |
| 572 | pushd conformance |
| 573 | # TODO(teboring): Add it back |
| 574 | # make test_php |
| 575 | popd |
| 576 | } |
| 577 | |
| 578 | build_php7.1_c() { |
| 579 | use_php 7.1 |
| 580 | wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit |
| 581 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
| 582 | pushd conformance |
| 583 | # make test_php_c |
| 584 | popd |
| 585 | } |
| 586 | |
| 587 | build_php7.1_zts_c() { |
| 588 | use_php_zts 7.1 |
| 589 | wget https://phar.phpunit.de/phpunit-5.6.0.phar -O /usr/bin/phpunit |
| 590 | cd php/tests && /bin/bash ./test.sh && cd ../.. |
| 591 | pushd conformance |
| 592 | # make test_php_c |
| 593 | popd |
| 594 | } |
| 595 | |
Paul Yang | 25abd7b | 2017-05-05 11:14:11 -0700 | [diff] [blame] | 596 | build_php_all_32() { |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 597 | build_php5.5 |
| 598 | build_php5.6 |
| 599 | build_php7.0 |
Paul Yang | 2231931 | 2017-05-10 15:59:59 -0700 | [diff] [blame] | 600 | build_php7.1 |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 601 | build_php5.5_c |
| 602 | build_php5.6_c |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 603 | build_php7.0_c |
Paul Yang | 2231931 | 2017-05-10 15:59:59 -0700 | [diff] [blame] | 604 | build_php7.1_c |
Bo Yang | c96dd66 | 2016-10-04 17:32:08 +0000 | [diff] [blame] | 605 | build_php5.5_zts_c |
Paul Yang | 190b527 | 2017-04-19 16:23:51 -0700 | [diff] [blame] | 606 | build_php5.6_zts_c |
| 607 | build_php7.0_zts_c |
Paul Yang | 2231931 | 2017-05-10 15:59:59 -0700 | [diff] [blame] | 608 | build_php7.1_zts_c |
Paul Yang | 51c5ff8 | 2016-10-25 17:27:05 -0700 | [diff] [blame] | 609 | } |
| 610 | |
Paul Yang | 25abd7b | 2017-05-05 11:14:11 -0700 | [diff] [blame] | 611 | build_php_all() { |
| 612 | build_php_all_32 |
| 613 | build_php_compatibility |
| 614 | } |
| 615 | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 616 | # Note: travis currently does not support testing more than one language so the |
| 617 | # .travis.yml cheats and claims to only be cpp. If they add multiple language |
| 618 | # support, this should probably get updated to install steps and/or |
| 619 | # rvm/gemfile/jdk/etc. entries rather than manually doing the work. |
| 620 | |
| 621 | # .travis.yml uses matrix.exclude to block the cases where app-get can't be |
| 622 | # use to install things. |
| 623 | |
| 624 | # -------- main -------- |
| 625 | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 626 | if [ "$#" -ne 1 ]; then |
| 627 | echo " |
| 628 | Usage: $0 { cpp | |
Feng Xiao | a4f68b1 | 2016-07-19 17:20:31 -0700 | [diff] [blame] | 629 | cpp_distcheck | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 630 | csharp | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 631 | java_jdk7 | |
| 632 | java_oracle7 | |
Feng Xiao | baa4023 | 2016-07-29 14:11:21 -0700 | [diff] [blame] | 633 | java_compatibility | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 634 | javanano_jdk7 | |
| 635 | javanano_oracle7 | |
| 636 | objectivec_ios | |
Thomas Van Lenten | 368a2f4 | 2016-05-24 11:27:33 -0400 | [diff] [blame] | 637 | objectivec_ios_debug | |
| 638 | objectivec_ios_release | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 639 | objectivec_osx | |
Sergio Campamá | f0c1492 | 2016-06-14 11:26:01 -0700 | [diff] [blame] | 640 | objectivec_cocoapods_integration | |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 641 | python | |
| 642 | python_cpp | |
Jie Luo | ea51149 | 2017-01-23 15:11:00 -0800 | [diff] [blame] | 643 | python_compatibility | |
Josh Haberman | ffc8118 | 2016-02-22 15:39:29 -0800 | [diff] [blame] | 644 | ruby21 | |
| 645 | ruby22 | |
Feng Xiao | 20fbb35 | 2016-07-21 18:04:56 -0700 | [diff] [blame] | 646 | jruby | |
Bo Yang | fd332d1 | 2016-09-30 00:07:47 +0000 | [diff] [blame] | 647 | ruby_all | |
| 648 | php5.5 | |
| 649 | php5.5_c | |
| 650 | php5.6 | |
| 651 | php5.6_c | |
| 652 | php7.0 | |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 653 | php7.0_c | |
Paul Yang | 25abd7b | 2017-05-05 11:14:11 -0700 | [diff] [blame] | 654 | php_compatibility | |
Paul Yang | 2231931 | 2017-05-10 15:59:59 -0700 | [diff] [blame] | 655 | php7.1 | |
| 656 | php7.1_c | |
Bo Yang | c8bd36e | 2016-09-30 19:07:33 +0000 | [diff] [blame] | 657 | php_all) |
Josh Haberman | 738393b | 2016-02-18 20:10:23 -0800 | [diff] [blame] | 658 | " |
| 659 | exit 1 |
| 660 | fi |
| 661 | |
| 662 | set -e # exit immediately on error |
| 663 | set -x # display all commands |
| 664 | eval "build_$1" |