tests.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. #!/bin/bash
  2. #
  3. # Build and runs tests for the protobuf project. We use this script to run
  4. # tests on kokoro (Ubuntu and MacOS). It can run locally as well but you
  5. # will need to make sure the required compilers/tools are available.
  6. # For when some other test needs the C++ main build, including protoc and
  7. # libprotobuf.
  8. LAST_RELEASED=3.9.0
  9. internal_build_cpp() {
  10. if [ -f src/protoc ]; then
  11. # Already built.
  12. return
  13. fi
  14. # Initialize any submodules.
  15. git submodule update --init --recursive
  16. ./autogen.sh
  17. ./configure CXXFLAGS="-fPIC -std=c++11" # -fPIC is needed for python cpp test.
  18. # See python/setup.py for more details
  19. make -j$(nproc)
  20. }
  21. build_cpp() {
  22. internal_build_cpp
  23. make check -j$(nproc) || (cat src/test-suite.log; false)
  24. cd conformance && make test_cpp && cd ..
  25. # The benchmark code depends on cmake, so test if it is installed before
  26. # trying to do the build.
  27. if [[ $(type cmake 2>/dev/null) ]]; then
  28. # Verify benchmarking code can build successfully.
  29. cd benchmarks && make cpp-benchmark && cd ..
  30. else
  31. echo ""
  32. echo "WARNING: Skipping validation of the bench marking code, cmake isn't installed."
  33. echo ""
  34. fi
  35. }
  36. build_cpp_tcmalloc() {
  37. internal_build_cpp
  38. ./configure LIBS=-ltcmalloc && make clean && make \
  39. PTHREAD_CFLAGS='-pthread -DGOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN' \
  40. check
  41. cd src
  42. PPROF_PATH=/usr/bin/google-pprof HEAPCHECK=strict ./protobuf-test
  43. }
  44. build_cpp_distcheck() {
  45. grep -q -- "-Og" src/Makefile.am &&
  46. echo "The -Og flag is incompatible with Clang versions older than 4.0." &&
  47. exit 1
  48. # Initialize any submodules.
  49. git submodule update --init --recursive
  50. ./autogen.sh
  51. ./configure
  52. make dist
  53. # List all files that should be included in the distribution package.
  54. git ls-files | grep "^\(java\|python\|objectivec\|csharp\|js\|ruby\|php\|cmake\|examples\|src/google/protobuf/.*\.proto\)" |\
  55. grep -v ".gitignore" | grep -v "java/compatibility_tests" | grep -v "java/lite/proguard.pgcfg" |\
  56. grep -v "python/compatibility_tests" | grep -v "python/docs" | grep -v "python/.repo-metadata.json" |\
  57. grep -v "csharp/compatibility_tests" > dist.lst
  58. # Unzip the dist tar file.
  59. DIST=`ls *.tar.gz`
  60. tar -xf $DIST
  61. cd ${DIST//.tar.gz}
  62. # Check if every file exists in the dist tar file.
  63. FILES_MISSING=""
  64. for FILE in $(<../dist.lst); do
  65. [ -f "$FILE" ] || {
  66. echo "$FILE is not found!"
  67. FILES_MISSING="$FILE $FILES_MISSING"
  68. }
  69. done
  70. cd ..
  71. if [ ! -z "$FILES_MISSING" ]; then
  72. echo "Missing files in EXTRA_DIST: $FILES_MISSING"
  73. exit 1
  74. fi
  75. # Do the regular dist-check for C++.
  76. make distcheck -j$(nproc)
  77. }
  78. build_dist_install() {
  79. # Initialize any submodules.
  80. git submodule update --init --recursive
  81. ./autogen.sh
  82. ./configure
  83. make dist
  84. # Unzip the dist tar file and install it.
  85. DIST=`ls *.tar.gz`
  86. tar -xf $DIST
  87. pushd ${DIST//.tar.gz}
  88. ./configure && make check -j4 && make install
  89. export LD_LIBRARY_PATH=/usr/local/lib
  90. # Try to install Java
  91. pushd java
  92. use_java jdk7
  93. $MVN install
  94. popd
  95. # Try to install Python
  96. virtualenv --no-site-packages venv
  97. source venv/bin/activate
  98. pushd python
  99. python setup.py clean build sdist
  100. pip install dist/protobuf-*.tar.gz
  101. popd
  102. deactivate
  103. rm -rf python/venv
  104. }
  105. build_csharp() {
  106. # Required for conformance tests and to regenerate protos.
  107. internal_build_cpp
  108. NUGET=/usr/local/bin/nuget.exe
  109. # Disable some unwanted dotnet options
  110. export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
  111. export DOTNET_CLI_TELEMETRY_OPTOUT=true
  112. # TODO(jtattermusch): is this still needed with "first time experience"
  113. # disabled?
  114. # Perform "dotnet new" once to get the setup preprocessing out of the
  115. # way. That spews a lot of output (including backspaces) into logs
  116. # otherwise, and can cause problems. It doesn't matter if this step
  117. # is performed multiple times; it's cheap after the first time anyway.
  118. # (It also doesn't matter if it's unnecessary, which it will be on some
  119. # systems. It's necessary on Jenkins in order to avoid unprintable
  120. # characters appearing in the JUnit output.)
  121. mkdir dotnettmp
  122. (cd dotnettmp; dotnet new > /dev/null)
  123. rm -rf dotnettmp
  124. # Check that the protos haven't broken C# codegen.
  125. # TODO(jonskeet): Fail if regenerating creates any changes.
  126. csharp/generate_protos.sh
  127. csharp/buildall.sh
  128. cd conformance && make test_csharp && cd ..
  129. # Run csharp compatibility test between 3.0.0 and the current version.
  130. csharp/compatibility_tests/v3.0.0/test.sh 3.0.0
  131. # Run csharp compatibility test between last released and the current version.
  132. csharp/compatibility_tests/v3.0.0/test.sh $LAST_RELEASED
  133. }
  134. build_golang() {
  135. # Go build needs `protoc`.
  136. internal_build_cpp
  137. # Add protoc to the path so that the examples build finds it.
  138. export PATH="`pwd`/src:$PATH"
  139. export GOPATH="$HOME/gocode"
  140. mkdir -p "$GOPATH/src/github.com/protocolbuffers"
  141. mkdir -p "$GOPATH/src/github.com/golang"
  142. rm -f "$GOPATH/src/github.com/protocolbuffers/protobuf"
  143. rm -f "$GOPATH/src/github.com/golang/protobuf"
  144. ln -s "`pwd`" "$GOPATH/src/github.com/protocolbuffers/protobuf"
  145. export PATH="$GOPATH/bin:$PATH"
  146. (cd $GOPATH/src/github.com/golang && git clone https://github.com/golang/protobuf.git && cd protobuf && git checkout v1.3.5)
  147. go install github.com/golang/protobuf/protoc-gen-go
  148. cd examples && PROTO_PATH="-I../src -I." make gotest && cd ..
  149. }
  150. use_java() {
  151. version=$1
  152. case "$version" in
  153. jdk8)
  154. export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
  155. export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
  156. ;;
  157. jdk7)
  158. export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
  159. export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
  160. ;;
  161. oracle7)
  162. export PATH=/usr/lib/jvm/java-7-oracle/bin:$PATH
  163. export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
  164. ;;
  165. esac
  166. MAVEN_LOCAL_REPOSITORY=/var/maven_local_repository
  167. MVN="$MVN -e -X -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$MAVEN_LOCAL_REPOSITORY"
  168. which java
  169. java -version
  170. $MVN -version
  171. }
  172. # --batch-mode suppresses download progress output that spams the logs.
  173. MVN="mvn --batch-mode"
  174. build_java() {
  175. version=$1
  176. dir=java_$version
  177. # Java build needs `protoc`.
  178. internal_build_cpp
  179. cp -r java $dir
  180. cd $dir && $MVN clean && $MVN test
  181. cd ../..
  182. }
  183. # The conformance tests are hard-coded to work with the $ROOT/java directory.
  184. # So this can't run in parallel with two different sets of tests.
  185. build_java_with_conformance_tests() {
  186. # Java build needs `protoc`.
  187. internal_build_cpp
  188. # This local installation avoids the problem caused by a new version not yet in Maven Central
  189. cd java/bom && $MVN install
  190. cd ../..
  191. cd java && $MVN test && $MVN install
  192. cd util && $MVN package assembly:single
  193. cd ../..
  194. cd conformance && make test_java && cd ..
  195. }
  196. build_java_jdk7() {
  197. use_java jdk7
  198. build_java_with_conformance_tests
  199. }
  200. build_java_oracle7() {
  201. use_java oracle7
  202. build_java oracle7
  203. }
  204. build_java_compatibility() {
  205. use_java jdk7
  206. internal_build_cpp
  207. # Use the unit-tests extracted from 2.5.0 to test the compatibility between
  208. # 3.0.0-beta-4 and the current version.
  209. cd java/compatibility_tests/v2.5.0
  210. ./test.sh 3.0.0-beta-4
  211. # Test the last released and current version.
  212. ./test.sh $LAST_RELEASED
  213. }
  214. build_java_linkage_monitor() {
  215. # Linkage Monitor checks compatibility with other Google libraries
  216. # https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor
  217. use_java jdk8
  218. internal_build_cpp
  219. # Linkage Monitor uses $HOME/.m2 local repository
  220. MVN="mvn -e -B -Dhttps.protocols=TLSv1.2"
  221. cd java
  222. # Installs the snapshot version locally
  223. $MVN install -Dmaven.test.skip=true
  224. # Linkage Monitor uses the snapshot versions installed in $HOME/.m2 to verify compatibility
  225. JAR=linkage-monitor-latest-all-deps.jar
  226. curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}"
  227. # Fails if there's new linkage errors compared with baseline
  228. java -jar $JAR com.google.cloud:libraries-bom
  229. }
  230. build_objectivec_ios() {
  231. # Reused the build script that takes care of configuring and ensuring things
  232. # are up to date. The OS X test runs the objc conformance test, so skip it
  233. # here.
  234. objectivec/DevTools/full_mac_build.sh \
  235. --core-only --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance "$@"
  236. }
  237. build_objectivec_ios_debug() {
  238. build_objectivec_ios --skip-xcode-release
  239. }
  240. build_objectivec_ios_release() {
  241. build_objectivec_ios --skip-xcode-debug
  242. }
  243. build_objectivec_osx() {
  244. # Reused the build script that takes care of configuring and ensuring things
  245. # are up to date.
  246. objectivec/DevTools/full_mac_build.sh \
  247. --core-only --skip-xcode-ios --skip-xcode-tvos
  248. }
  249. build_objectivec_tvos() {
  250. # Reused the build script that takes care of configuring and ensuring things
  251. # are up to date. The OS X test runs the objc conformance test, so skip it
  252. # here.
  253. objectivec/DevTools/full_mac_build.sh \
  254. --core-only --skip-xcode-ios --skip-xcode-osx --skip-objc-conformance "$@"
  255. }
  256. build_objectivec_tvos_debug() {
  257. build_objectivec_tvos --skip-xcode-release
  258. }
  259. build_objectivec_tvos_release() {
  260. build_objectivec_tvos --skip-xcode-debug
  261. }
  262. build_objectivec_cocoapods_integration() {
  263. objectivec/Tests/CocoaPods/run_tests.sh
  264. }
  265. build_python() {
  266. internal_build_cpp
  267. cd python
  268. if [ $(uname -s) == "Linux" ]; then
  269. envlist=py\{27,33,34,35,36\}-python
  270. else
  271. envlist=py\{27,36\}-python
  272. fi
  273. tox -e $envlist
  274. cd ..
  275. }
  276. build_python_version() {
  277. internal_build_cpp
  278. cd python
  279. envlist=$1
  280. tox -e $envlist
  281. cd ..
  282. }
  283. build_python27() {
  284. build_python_version py27-python
  285. }
  286. build_python33() {
  287. build_python_version py33-python
  288. }
  289. build_python34() {
  290. build_python_version py34-python
  291. }
  292. build_python35() {
  293. build_python_version py35-python
  294. }
  295. build_python36() {
  296. build_python_version py36-python
  297. }
  298. build_python37() {
  299. build_python_version py37-python
  300. }
  301. build_python38() {
  302. build_python_version py38-python
  303. }
  304. build_python_cpp() {
  305. internal_build_cpp
  306. export LD_LIBRARY_PATH=../src/.libs # for Linux
  307. export DYLD_LIBRARY_PATH=../src/.libs # for OS X
  308. cd python
  309. if [ $(uname -s) == "Linux" ]; then
  310. envlist=py\{27,33,34,35,36\}-cpp
  311. else
  312. envlist=py\{27,36\}-cpp
  313. fi
  314. tox -e $envlist
  315. cd ..
  316. }
  317. build_python_cpp_version() {
  318. internal_build_cpp
  319. export LD_LIBRARY_PATH=../src/.libs # for Linux
  320. export DYLD_LIBRARY_PATH=../src/.libs # for OS X
  321. cd python
  322. envlist=$1
  323. tox -e $envlist
  324. cd ..
  325. }
  326. build_python27_cpp() {
  327. build_python_cpp_version py27-cpp
  328. }
  329. build_python33_cpp() {
  330. build_python_cpp_version py33-cpp
  331. }
  332. build_python34_cpp() {
  333. build_python_cpp_version py34-cpp
  334. }
  335. build_python35_cpp() {
  336. build_python_cpp_version py35-cpp
  337. }
  338. build_python36_cpp() {
  339. build_python_cpp_version py36-cpp
  340. }
  341. build_python37_cpp() {
  342. build_python_cpp_version py37-cpp
  343. }
  344. build_python38_cpp() {
  345. build_python_cpp_version py38-cpp
  346. }
  347. build_python_compatibility() {
  348. internal_build_cpp
  349. # Use the unit-tests extracted from 2.5.0 to test the compatibility.
  350. cd python/compatibility_tests/v2.5.0
  351. # Test between 2.5.0 and the current version.
  352. ./test.sh 2.5.0
  353. # Test between 3.0.0-beta-1 and the current version.
  354. ./test.sh 3.0.0-beta-1
  355. # Test between last released and current version.
  356. ./test.sh $LAST_RELEASED
  357. }
  358. build_ruby23() {
  359. internal_build_cpp # For conformance tests.
  360. cd ruby && bash travis-test.sh ruby-2.3.8 && cd ..
  361. }
  362. build_ruby24() {
  363. internal_build_cpp # For conformance tests.
  364. cd ruby && bash travis-test.sh ruby-2.4 && cd ..
  365. }
  366. build_ruby25() {
  367. internal_build_cpp # For conformance tests.
  368. cd ruby && bash travis-test.sh ruby-2.5.1 && cd ..
  369. }
  370. build_ruby26() {
  371. internal_build_cpp # For conformance tests.
  372. cd ruby && bash travis-test.sh ruby-2.6.0 && cd ..
  373. }
  374. build_ruby27() {
  375. internal_build_cpp # For conformance tests.
  376. cd ruby && bash travis-test.sh ruby-2.7.0 && cd ..
  377. }
  378. build_javascript() {
  379. internal_build_cpp
  380. NODE_VERSION=node-v12.16.3-darwin-x64
  381. NODE_TGZ="$NODE_VERSION.tar.gz"
  382. pushd /tmp
  383. curl -OL https://nodejs.org/dist/v12.16.3/$NODE_TGZ
  384. tar zxvf $NODE_TGZ
  385. export PATH=$PATH:`pwd`/$NODE_VERSION/bin
  386. popd
  387. cd js && npm install && npm test && cd ..
  388. cd conformance && make test_nodejs && cd ..
  389. }
  390. use_php() {
  391. VERSION=$1
  392. export PATH=/usr/local/php-${VERSION}/bin:$PATH
  393. internal_build_cpp
  394. }
  395. use_php_zts() {
  396. VERSION=$1
  397. export PATH=/usr/local/php-${VERSION}-zts/bin:$PATH
  398. internal_build_cpp
  399. }
  400. build_php5.5() {
  401. use_php 5.5
  402. pushd php
  403. rm -rf vendor
  404. composer update
  405. composer test
  406. popd
  407. (cd conformance && make test_php)
  408. }
  409. build_php5.6() {
  410. use_php 5.6
  411. pushd php
  412. rm -rf vendor
  413. composer update
  414. composer test
  415. popd
  416. (cd conformance && make test_php)
  417. }
  418. build_php5.6_mac() {
  419. # Install PHP
  420. curl -s https://php-osx.liip.ch/install.sh | bash -s 5.6
  421. PHP_FOLDER=`find /usr/local -type d -name "php5-5.6*"` # The folder name may change upon time
  422. test ! -z "$PHP_FOLDER"
  423. export PATH="$PHP_FOLDER/bin:$PATH"
  424. internal_build_cpp
  425. # Run pure-PHP tests only.
  426. pushd php
  427. rm -rf vendor
  428. composer update
  429. composer test
  430. popd
  431. (cd conformance && make test_php)
  432. }
  433. build_php7.0() {
  434. use_php 7.0
  435. pushd php
  436. rm -rf vendor
  437. composer update
  438. composer test
  439. popd
  440. (cd conformance && make test_php)
  441. }
  442. build_php7.0_c() {
  443. IS_64BIT=$1
  444. use_php 7.0
  445. php/tests/test.sh
  446. pushd conformance
  447. if [ "$IS_64BIT" = "true" ]
  448. then
  449. make test_php_c
  450. else
  451. make test_php_c_32
  452. fi
  453. popd
  454. }
  455. build_php7.0_mixed() {
  456. use_php 7.0
  457. pushd php
  458. rm -rf vendor
  459. composer update
  460. tests/compile_extension.sh
  461. tests/generate_protos.sh
  462. php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
  463. popd
  464. }
  465. build_php7.0_zts_c() {
  466. IS_64BIT=$1
  467. use_php_zts 7.0
  468. php/tests/test.sh
  469. pushd conformance
  470. if [ "$IS_64BIT" = "true" ]
  471. then
  472. make test_php_c
  473. else
  474. make test_php_c_32
  475. fi
  476. popd
  477. }
  478. build_php7.0_mac() {
  479. internal_build_cpp
  480. # Install PHP
  481. curl -s https://php-osx.liip.ch/install.sh | bash -s 7.0
  482. PHP_FOLDER=`find /usr/local -type d -name "php5-7.0*"` # The folder name may change upon time
  483. test ! -z "$PHP_FOLDER"
  484. export PATH="$PHP_FOLDER/bin:$PATH"
  485. # Install valgrind
  486. echo "#! /bin/bash" > valgrind
  487. chmod ug+x valgrind
  488. sudo mv valgrind /usr/local/bin/valgrind
  489. # Test
  490. php/tests/test.sh
  491. (cd conformance && make test_php_c)
  492. }
  493. build_php7.3_mac() {
  494. internal_build_cpp
  495. # Install PHP
  496. # We can't test PHP 7.4 with these binaries yet:
  497. # https://github.com/liip/php-osx/issues/276
  498. curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3
  499. PHP_FOLDER=`find /usr/local -type d -name "php5-7.3*"` # The folder name may change upon time
  500. test ! -z "$PHP_FOLDER"
  501. export PATH="$PHP_FOLDER/bin:$PATH"
  502. # Install valgrind
  503. echo "#! /bin/bash" > valgrind
  504. chmod ug+x valgrind
  505. sudo mv valgrind /usr/local/bin/valgrind
  506. # Test
  507. php/tests/test.sh
  508. (cd conformance && make test_php_c)
  509. }
  510. build_php_compatibility() {
  511. internal_build_cpp
  512. php/tests/compatibility_test.sh $LAST_RELEASED
  513. }
  514. build_php_multirequest() {
  515. use_php 7.4
  516. php/tests/multirequest.sh
  517. }
  518. build_php7.1() {
  519. use_php 7.1
  520. pushd php
  521. rm -rf vendor
  522. composer update
  523. composer test
  524. popd
  525. (cd conformance && make test_php)
  526. }
  527. build_php7.1_c() {
  528. IS_64BIT=$1
  529. use_php 7.1
  530. php/tests/test.sh
  531. pushd conformance
  532. if [ "$IS_64BIT" = "true" ]
  533. then
  534. make test_php_c
  535. else
  536. make test_php_c_32
  537. fi
  538. popd
  539. }
  540. build_php7.1_mixed() {
  541. use_php 7.1
  542. pushd php
  543. rm -rf vendor
  544. composer update
  545. tests/compile_extension.sh
  546. tests/generate_protos.sh
  547. php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
  548. popd
  549. }
  550. build_php7.1_zts_c() {
  551. IS_64BIT=$1
  552. use_php_zts 7.1
  553. php/tests/test.sh
  554. pushd conformance
  555. if [ "$IS_64BIT" = "true" ]
  556. then
  557. make test_php_c
  558. else
  559. make test_php_c_32
  560. fi
  561. popd
  562. }
  563. build_php7.4() {
  564. use_php 7.4
  565. pushd php
  566. rm -rf vendor
  567. composer update
  568. composer test
  569. popd
  570. (cd conformance && make test_php)
  571. }
  572. build_php7.4_c() {
  573. IS_64BIT=$1
  574. use_php 7.4
  575. php/tests/test.sh
  576. pushd conformance
  577. if [ "$IS_64BIT" = "true" ]
  578. then
  579. make test_php_c
  580. else
  581. make test_php_c_32
  582. fi
  583. popd
  584. }
  585. build_php7.4_mixed() {
  586. use_php 7.4
  587. pushd php
  588. rm -rf vendor
  589. composer update
  590. tests/compile_extension.sh
  591. tests/generate_protos.sh
  592. php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
  593. popd
  594. }
  595. build_php7.4_zts_c() {
  596. IS_64BIT=$1
  597. use_php_zts 7.4
  598. php/tests/test.sh
  599. pushd conformance
  600. if [ "$IS_64BIT" = "true" ]
  601. then
  602. make test_php_c
  603. else
  604. make test_php_c_32
  605. fi
  606. popd
  607. }
  608. build_php_all_32() {
  609. build_php5.5
  610. build_php5.6
  611. build_php7.0
  612. build_php7.1
  613. build_php7.4
  614. build_php7.0_c $1
  615. build_php7.1_c $1
  616. build_php7.4_c $1
  617. build_php7.0_mixed
  618. build_php7.1_mixed
  619. build_php7.4_mixed
  620. build_php7.0_zts_c $1
  621. build_php7.1_zts_c $1
  622. build_php7.4_zts_c $1
  623. }
  624. build_php_all() {
  625. build_php_all_32 true
  626. build_php_multirequest
  627. build_php_compatibility
  628. }
  629. build_benchmark() {
  630. use_php 7.2
  631. cd kokoro/linux/benchmark && ./run.sh
  632. }
  633. # -------- main --------
  634. if [ "$#" -ne 1 ]; then
  635. echo "
  636. Usage: $0 { cpp |
  637. cpp_distcheck |
  638. csharp |
  639. java_jdk7 |
  640. java_oracle7 |
  641. java_compatibility |
  642. java_linkage_monitor |
  643. objectivec_ios |
  644. objectivec_ios_debug |
  645. objectivec_ios_release |
  646. objectivec_osx |
  647. objectivec_tvos |
  648. objectivec_tvos_debug |
  649. objectivec_tvos_release |
  650. objectivec_cocoapods_integration |
  651. python |
  652. python_cpp |
  653. python_compatibility |
  654. ruby23 |
  655. ruby24 |
  656. ruby25 |
  657. ruby26 |
  658. ruby27 |
  659. jruby |
  660. ruby_all |
  661. php5.5 |
  662. php5.6 |
  663. php7.0 |
  664. php7.0_c |
  665. php_compatibility |
  666. php7.1 |
  667. php7.1_c |
  668. php_all |
  669. dist_install |
  670. benchmark)
  671. "
  672. exit 1
  673. fi
  674. set -e # exit immediately on error
  675. set -x # display all commands
  676. cd $(dirname $0)
  677. eval "build_$1"