diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index eec26ca68b530e3f557d072884a4503709633a23..ac4d360876242636ffe3e4e7ac4c33a4acdb2f83 100644 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -3124,20 +3124,20 @@ function build_document_preview() { # origin name: example function exec_samplecode_test() { if [ -d "${PADDLE_ROOT}/build/pr_whl" ];then - pip install ${PADDLE_ROOT}/build/pr_whl/*.whl --force-reinstall + pip install ${PADDLE_ROOT}/build/pr_whl/*.whl else echo "WARNING: PR wheel is not found. Use develop wheel !!!" - pip install ${PADDLE_ROOT}/build/python/dist/*.whl --force-reinstall + pip install ${PADDLE_ROOT}/build/python/dist/*.whl fi python -c "import paddle;print(paddle.__version__);paddle.version.show()" cd ${PADDLE_ROOT}/tools if [ "$1" = "cpu" ] ; then - python sampcd_processor.py cpu; example_error=$? + python sampcd_processor.py --debug cpu; example_error=$? elif [ "$1" = "gpu" ] ; then SAMPLE_CODE_EXEC_THREADS=${SAMPLE_CODE_EXEC_THREADS:-2} - python sampcd_processor.py --threads=${SAMPLE_CODE_EXEC_THREADS} gpu; example_error=$? + python sampcd_processor.py --threads=${SAMPLE_CODE_EXEC_THREADS} --debug gpu; example_error=$? fi if [ "$example_error" != "0" ];then echo "Code instance execution failed" >&2 diff --git a/tools/check_api_approvals.sh b/tools/check_api_approvals.sh index 36449fd1444a59b94d83996633896138a6d4a9a7..55c348365e107a3f6c6baac827cb946c855c3816 100644 --- a/tools/check_api_approvals.sh +++ b/tools/check_api_approvals.sh @@ -116,6 +116,28 @@ if [ "${ADDED_OP_USE_DEFAULT_GRAD_MAKER}" != "" ]; then check_approval 1 6888866 7913861 fi +OUTPUT_LOG=`git diff -U0 upstream/$BRANCH | grep "^+" | grep -Ew "print|printf|fprintf|std::cout" || true` +if [ "$OUTPUT_LOG" != "" ];then + git diff -U0 upstream/$BRANCH |grep "^+" | grep -Ew "print|printf|fprintf|std::cout"|sed 's#[ ][ ]##g'|sed 's#+##g' >/tmp/print.txt + samplecode=`find tools/samplecode_temp -type f || true` + sample_status=0 + if [ "$samplecode" != "" ];then + cat `find tools/samplecode_temp -type f` >/tmp/samplecode.txt + sed -i s#\"#\'#g /tmp/samplecode.txt + while read line + do + code_in=`grep "$line" /tmp/samplecode.txt || true` + if [ "$code_in" == "" ];then + sample_status=1 + fi + done