1#!/bin/bash
2# A simple preupload check that the runtests.sh script has been run for the
3# libnativebridge tests if that library has been changed.
4# TODO(b/189484095): Port these tests to atest and enable in presubmit so we
5# don't need the custom script to run them.
6
7commit_message="$1"
8shift
9
10nativebridge_change=false
11for file; do
12  [[ $file = libnativebridge/* ]] && nativebridge_change=true
13done
14
15if $nativebridge_change; then
16  if grep '^Test: art/libnativebridge/tests/runtests.sh' <<< $commit_message ; then :; else
17    echo "Please run art/libnativebridge/tests/runtests.sh and add the tag:" 1>&2
18    echo "Test: art/libnativebridge/tests/runtests.sh [--skip-host|--skip-target]" 1>&2
19    exit 1
20  fi
21fi
22