2019-10-23 15:40:21 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2019 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://llvm.org/LICENSE.txt
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
set -eu
|
|
|
|
|
2019-12-09 12:09:53 +01:00
|
|
|
# Runs ninja
|
|
|
|
# Inputs: TARGET_DIR, WORKSPACE.
|
|
|
|
# Outputs: $TARGET_DIR/test_results.xml
|
|
|
|
|
2019-10-23 15:40:21 +02:00
|
|
|
CMD=$1
|
2019-12-09 12:09:53 +01:00
|
|
|
echo "Running ninja ${CMD}... ====================================="
|
2019-10-23 15:40:21 +02:00
|
|
|
|
|
|
|
ulimit -n 8192
|
2019-12-09 12:09:53 +01:00
|
|
|
cd "${WORKSPACE}/build"
|
2019-10-23 15:40:21 +02:00
|
|
|
|
|
|
|
set +e
|
2019-11-18 17:30:11 +01:00
|
|
|
ninja ${CMD}
|
|
|
|
RETURN_CODE="$?"
|
2019-10-23 15:40:21 +02:00
|
|
|
set -e
|
|
|
|
|
2019-12-09 12:09:53 +01:00
|
|
|
echo "ninja ${CMD} completed ======================================"
|
2019-10-23 15:40:21 +02:00
|
|
|
if test -f "test-results.xml" ; then
|
|
|
|
cp test-results.xml ${TARGET_DIR}
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit ${RETURN_CODE}
|