1 #!/bin/bash 2 # Copyright (C) 2018 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 set -eux 17 18 SCRIPT_DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" 19 ROOT_DIR="$(realpath ${SCRIPT_DIR}/../..)" 20 21 cd ${ROOT_DIR} 22 23 # Check that the expected environment variables are present (due to set -u). 24 echo PERFETTO_TEST_GN_ARGS: ${PERFETTO_TEST_GN_ARGS} 25 26 OUT_PATH="out/dist" 27 28 tools/install-build-deps --no-android 29 30 pip install --quiet --user protobuf 31 32 if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then 33 export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer" 34 export MSAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer" 35 fi 36 37 tools/gn gen ${OUT_PATH} --args="${PERFETTO_TEST_GN_ARGS}" --check 38 tools/ninja -C ${OUT_PATH} 39 40 # Run the tests 41 ${OUT_PATH}/perfetto_unittests 42 ${OUT_PATH}/perfetto_integrationtests 43 44 BENCHMARK_FUNCTIONAL_TEST_ONLY=true ${OUT_PATH}/perfetto_benchmarks 45 tools/diff_test_trace_processor.py ${OUT_PATH}/trace_processor_shell 46