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
7new_robolectric_tests=$(
8    git diff --name-status $REPO_LREV | grep "^A.*tests/robotests.*\.java")
9if [ $new_robolectric_tests != "" ]
10then
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
16fi
17