summaryrefslogtreecommitdiff
path: root/libnativebridge/tests/preupload_check_test_tag.sh
blob: 1c8cd4b62cf05d7443c7e24e53f0f1a5784d2902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# A simple preupload check that the runtests.sh script has been run for the
# libnativebridge tests if that library has been changed.
# TODO(b/189484095): Port these tests to atest and enable in presubmit so we
# don't need the custom script to run them.

commit_message="$1"
shift

nativebridge_change=false
for file; do
  [[ $file = libnativebridge/* ]] && nativebridge_change=true
done

if $nativebridge_change; then
  if grep '^Test: art/libnativebridge/tests/runtests.sh' <<< $commit_message ; then :; else
    echo "Please run art/libnativebridge/tests/runtests.sh and add the tag:" 1>&2
    echo "Test: art/libnativebridge/tests/runtests.sh [--skip-host|--skip-target]" 1>&2
    exit 1
  fi
fi