xref: /aosp_15_r20/external/grpc-grpc/src/php/bin/run_tests.sh (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1*cc02d7e2SAndroid Build Coastguard Worker#!/bin/bash
2*cc02d7e2SAndroid Build Coastguard Worker# Copyright 2015 gRPC authors.
3*cc02d7e2SAndroid Build Coastguard Worker#
4*cc02d7e2SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
5*cc02d7e2SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
6*cc02d7e2SAndroid Build Coastguard Worker# You may obtain a copy of the License at
7*cc02d7e2SAndroid Build Coastguard Worker#
8*cc02d7e2SAndroid Build Coastguard Worker#     http://www.apache.org/licenses/LICENSE-2.0
9*cc02d7e2SAndroid Build Coastguard Worker#
10*cc02d7e2SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
11*cc02d7e2SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
12*cc02d7e2SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*cc02d7e2SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
14*cc02d7e2SAndroid Build Coastguard Worker# limitations under the License.
15*cc02d7e2SAndroid Build Coastguard Worker
16*cc02d7e2SAndroid Build Coastguard Worker# Loads the local shared library, and runs all of the test cases in tests/
17*cc02d7e2SAndroid Build Coastguard Worker# against it
18*cc02d7e2SAndroid Build Coastguard Workerset -ex
19*cc02d7e2SAndroid Build Coastguard Workercd $(dirname $0)/../../..
20*cc02d7e2SAndroid Build Coastguard Workerroot=$(pwd)
21*cc02d7e2SAndroid Build Coastguard Workercd src/php/bin
22*cc02d7e2SAndroid Build Coastguard Workersource ./determine_extension_dir.sh
23*cc02d7e2SAndroid Build Coastguard Worker# in some jenkins macos machine, somehow the PHP build script can't find libgrpc.dylib
24*cc02d7e2SAndroid Build Coastguard Workerexport DYLD_LIBRARY_PATH=$root/libs/$CONFIG
25*cc02d7e2SAndroid Build Coastguard Worker$(which php) $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
26*cc02d7e2SAndroid Build Coastguard Worker  --exclude-group persistent_list_bound_tests ../tests/unit_tests
27*cc02d7e2SAndroid Build Coastguard Worker
28*cc02d7e2SAndroid Build Coastguard Workerfor arg in "$@"
29*cc02d7e2SAndroid Build Coastguard Workerdo
30*cc02d7e2SAndroid Build Coastguard Worker  if [[ "$arg" == "--skip-persistent-channel-tests" ]]; then
31*cc02d7e2SAndroid Build Coastguard Worker    SKIP_PERSISTENT_CHANNEL_TESTS=true
32*cc02d7e2SAndroid Build Coastguard Worker  elif [[ "$arg" == "--ignore-valgrind-undef-errors" ]]; then
33*cc02d7e2SAndroid Build Coastguard Worker    VALGRIND_UNDEF_VALUE_ERRORS="--undef-value-errors=no"
34*cc02d7e2SAndroid Build Coastguard Worker  fi
35*cc02d7e2SAndroid Build Coastguard Workerdone
36*cc02d7e2SAndroid Build Coastguard Worker
37*cc02d7e2SAndroid Build Coastguard Workerif [[ "$SKIP_PERSISTENT_CHANNEL_TESTS" != "true" ]]; then
38*cc02d7e2SAndroid Build Coastguard Worker   $(which php) $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
39*cc02d7e2SAndroid Build Coastguard Worker     ../tests/unit_tests/PersistentChannelTests
40*cc02d7e2SAndroid Build Coastguard Workerfi
41