check_added_ut.sh 1.6 KB
Newer Older
C
chalsliu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash

# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# 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.

17 18
set +e
set -x
C
chalsliu 已提交
19 20 21 22
if [ -z ${BRANCH} ]; then
    BRANCH="develop"
fi

23
export CI_SKIP_CPP_TEST=OFF
C
chalsliu 已提交
24 25 26 27 28
PADDLE_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}")/../" && pwd )"
CURDIR=`pwd`
cd $PADDLE_ROOT
cp $PADDLE_ROOT/paddle/scripts/paddle_build.sh $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh
CURBRANCH=`git rev-parse --abbrev-ref HEAD`
29
echo $CURBRANCH
C
chalsliu 已提交
30 31 32 33 34 35 36
git checkout -b prec_added_ut upstream/${BRANCH}
mkdir prec_build
cd prec_build
bash $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh cmake_gen_in_current_dir >prebuild.log 2>&1
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' > /$PADDLE_ROOT/br-ut
cd $PADDLE_ROOT/build
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' > /$PADDLE_ROOT/pr-ut
37 38
cd $PADDLE_ROOT
grep -F -x -v -f br-ut pr-ut > $PADDLE_ROOT/added_ut
C
chalsliu 已提交
39
echo "New-UT:"
40
cat $PADDLE_ROOT/added_ut
C
chalsliu 已提交
41
rm -rf prec_build
42
rm $PADDLE_ROOT/br-ut $PADDLE_ROOT/pr-ut $PADDLE_ROOT/paddle/scripts/paddle_build_pre.sh
C
chalsliu 已提交
43
git checkout $CURBRANCH
44
echo $CURBRANCH
C
chalsliu 已提交
45 46
git branch -D prec_added_ut
cd $CURDIR
47
export CI_SKIP_CPP_TEST=