tests.sh 18 KB

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