Loading PREUPLOAD.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,5 @@ checkcolor_hook = ${REPO_ROOT}/prebuilts/checkcolor/checkcolor.py -p . strings_lint_hook = ${REPO_ROOT}/frameworks/base/tools/stringslint/stringslint_sha.sh ${PREUPLOAD_COMMIT} checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT} robolectric_hook = ${REPO_ROOT}/packages/apps/Settings/tests/robotests/new_tests_hook.sh ${REPO_PROJECT} tests/robotests/new_tests_hook.sh 0 → 100755 +16 −0 Original line number Diff line number Diff line #!/bin/bash # This script detects the presence of new robolectric java tests within # commits to be uploaded. If a new file is detected the script will print an # error message and return an error code. Intended to be used as a repo hook. new_robolectric_tests=$( git diff --name-status $REPO_LREV | grep "^A.*tests/robotests.*\.java") if [ $new_robolectric_tests != "" ] then echo "New Robolectric unit tests detected. Please submit junit tests" \ "instead, in the tests/junit directory." \ "See go/android-platform-robolectric-cleanup." echo $new_robolectric_tests exit 1 fi Loading
PREUPLOAD.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,5 @@ checkcolor_hook = ${REPO_ROOT}/prebuilts/checkcolor/checkcolor.py -p . strings_lint_hook = ${REPO_ROOT}/frameworks/base/tools/stringslint/stringslint_sha.sh ${PREUPLOAD_COMMIT} checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT} robolectric_hook = ${REPO_ROOT}/packages/apps/Settings/tests/robotests/new_tests_hook.sh ${REPO_PROJECT}
tests/robotests/new_tests_hook.sh 0 → 100755 +16 −0 Original line number Diff line number Diff line #!/bin/bash # This script detects the presence of new robolectric java tests within # commits to be uploaded. If a new file is detected the script will print an # error message and return an error code. Intended to be used as a repo hook. new_robolectric_tests=$( git diff --name-status $REPO_LREV | grep "^A.*tests/robotests.*\.java") if [ $new_robolectric_tests != "" ] then echo "New Robolectric unit tests detected. Please submit junit tests" \ "instead, in the tests/junit directory." \ "See go/android-platform-robolectric-cleanup." echo $new_robolectric_tests exit 1 fi