1 Star 0 Fork 0

胡松涛 / ml-agents

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
run-tests-editmode-osx-editor.sh 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
set -eo pipefail
if [[ -z "${UNITY_VERSION}" ]]; then
echo "Environment Variable UNITY_VERSION was not set"
exit 1
else
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
else
UNITY=${HUB_UNITY}
fi
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
echo "Cleaning previous results"
if [[ -e ${BASETPATH}/results.xml ]]
then
rm ${BASETPATH}/results.xml
fi
echo "Starting tests via $UNITY"
CMD_LINE="$UNITY -batchmode -runTests -logfile - -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
echo "$CMD_LINE ..."
$CMD_LINE
RES=$?
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
echo "Test run SUCCEEDED!"
else
echo "Test run FAILED!"
fi
rm "${BASETPATH}/results.xml"
exit ${RES}
fi
1
https://gitee.com/hu_song_tao/ml-agents.git
git@gitee.com:hu_song_tao/ml-agents.git
hu_song_tao
ml-agents
ml-agents
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891