tests.sh 18 KB

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