File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,5 @@ checkcolor_hook = ${REPO_ROOT}/prebuilts/checkcolor/checkcolor.py -p .
4
4
strings_lint_hook = ${REPO_ROOT}/frameworks/base/tools/stringslint/stringslint_sha.sh ${PREUPLOAD_COMMIT}
5
5
6
6
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPLOAD_COMMIT}
7
+
8
+ robolectric_hook = ${REPO_ROOT}/packages/apps/Settings/tests/robotests/new_tests_hook.sh ${REPO_PROJECT}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This script detects the presence of new robolectric java tests within
4
+ # commits to be uploaded. If a new file is detected the script will print an
5
+ # error message and return an error code. Intended to be used as a repo hook.
6
+
7
+ new_robolectric_tests=$(
8
+ git diff --name-status $REPO_LREV | grep " ^A.*tests/robotests.*\.java" )
9
+ if [ $new_robolectric_tests != " " ]
10
+ then
11
+ echo " New Robolectric unit tests detected. Please submit junit tests" \
12
+ " instead, in the tests/junit directory." \
13
+ " See go/android-platform-robolectric-cleanup."
14
+ echo $new_robolectric_tests
15
+ exit 1
16
+ fi
You can’t perform that action at this time.
0 commit comments