From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 2 Jul 2018 09:38:53 +0000 (+0900) Subject: Run unittest per PR (#435) X-Git-Tag: nncc_backup~2536 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9399b71f0e75edb43a3a835cc9850ea1b1b86366;p=platform%2Fcore%2Fml%2Fnnfw.git Run unittest per PR (#435) This commit revises 'docker-build' script to run test after build. Signed-off-by: Jonghyun Park --- diff --git a/scripts/command/docker-build b/scripts/command/docker-build index 7e772e7..ea6ef68 100644 --- a/scripts/command/docker-build +++ b/scripts/command/docker-build @@ -24,19 +24,32 @@ DOCKER_ENV_VARS+=" -e FLATBUFFERS_URL" DOCKER_RUN_OPTS="--rm" DOCKER_RUN_OPTS+=" -w $DOCKER_PATH" +BUILD_RESULT=0 + if [ "$DOCKER_INTERACTIVE" ]; then DOCKER_RUN_OPTS+=" -it" CMD="/bin/bash" docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD + BUILD_RESULT=$? else - CMD="./nncc configure" - docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD + if [[ ${BUILD_RESULT} -eq 0 ]]; then + CMD="./nncc configure" + docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD + BUILD_RESULT=$? + fi - CMD="./nncc build -j$(nproc)" - docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD -fi + if [[ ${BUILD_RESULT} -eq 0 ]]; then + CMD="./nncc build -j$(nproc)" + docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD + BUILD_RESULT=$? + fi -BUILD_RESULT=$? + if [[ ${BUILD_RESULT} -eq 0 ]]; then + CMD="./nncc test" + docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD + BUILD_RESULT=$? + fi +fi # Newly created files during above docker run can have different ownership. # This may cause some problems, for example, some jenkins slaves or developers