Files
OpenCellular/util/presubmit_check.sh
Vic (Chun-Ju) Yang 798df2a6d0 Add presubmit check for unit test
This enforces that "make buildall" runs at least once after the last
file change.

TEST=Try to upload without running "make buildall"
TEST=Change a file without re-running "make buildall", and try to
upload.
BUG=None
BRANCH=None

Change-Id: Ia4abb3c0e17cf4d559975574f398d74c7986c89f
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185116
Reviewed-by: Dave Parker <dparker@chromium.org>
2014-02-06 19:27:18 +00:00

18 lines
539 B
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if [[ ! -e .tests-passed ]]; then
echo 'Unit tests have not passed. Please run "make buildall -j".'
exit 1
fi
changed=$(find ${PRESUBMIT_FILES} -newer .tests-passed)
if [[ -n "${changed}" ]]; then
echo "Files have changed since last time unit tests passed:"
echo "${changed}" | sed -e 's/^/ /'
echo 'Please run "make buildall -j".'
exit 1
fi