summaryrefslogtreecommitdiff
path: root/util/presubmit_check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/presubmit_check.sh')
-rwxr-xr-xutil/presubmit_check.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/util/presubmit_check.sh b/util/presubmit_check.sh
new file mode 100755
index 0000000000..220522083e
--- /dev/null
+++ b/util/presubmit_check.sh
@@ -0,0 +1,17 @@
+#!/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