Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: PRESUBMIT.py

Issue 11092002: Add PRESUBMIT script to V8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/tools/android-ll-prof.sh b/PRESUBMIT.py
old mode 100755
new mode 100644
similarity index 52%
copy from tools/android-ll-prof.sh
copy to PRESUBMIT.py
index 436f262bb3682d5b6a6c408f02159ab5da205eca..0077be941a00f77d92f1571c12c899e441d3e22b
--- a/tools/android-ll-prof.sh
+++ b/PRESUBMIT.py
@@ -1,4 +1,3 @@
-#!/bin/bash
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -26,44 +25,47 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Runs d8 with the given arguments on the device under 'perf' and
-# processes the profiler trace and v8 logs using ll_prof.py.
-#
-# Usage:
-# > ./tools/android-ll-prof.sh (debug|release) "args to d8" "args to ll_prof.py"
-#
-# The script creates deploy directory deploy/data/local/tmp/v8, copies there
-# the d8 binary either from out/android_arm.release or out/android_arm.debug,
-# and then sync the deploy directory with /data/local/tmp/v8 on the device.
-# You can put JS files in the deploy directory before running the script.
-# Note: $ANDROID_NDK_ROOT must be set.
+"""Top-level presubmit script for V8.
-MODE=$1
-RUN_ARGS=$2
-LL_PROF_ARGS=$3
+See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
+for more details about the presubmit API built into gcl.
+"""
-BASE=`cd $(dirname "$0")/..; pwd`
-DEPLOY="$BASE/deploy"
+def _V8PresubmitChecks(input_api, output_api):
+ """Runs the V8 presubmit checks."""
+ import sys
+ sys.path.append(input_api.os_path.join(
+ input_api.PresubmitLocalPath(), 'tools'))
+ from presubmit import CppLintProcessor
+ from presubmit import SourceProcessor
-set +e
-mkdir -p "$DEPLOY/data/local/tmp/v8"
+ results = []
+ if not CppLintProcessor().Run(input_api.PresubmitLocalPath()):
+ results.append(output_api.PresubmitError("C++ lint check failed"))
+ if not SourceProcessor().Run(input_api.PresubmitLocalPath()):
+ results.append(output_api.PresubmitError(
+ "Copyright header and trailing whitespaces check failed"))
+ return results
-cp "$BASE/out/android_arm.$MODE/d8" "$DEPLOY/data/local/tmp/v8/d8"
-adb -p "$DEPLOY" sync data
+def _CommonChecks(input_api, output_api):
+ """Checks common to both upload and commit."""
+ results = []
+ results.extend(input_api.canned_checks.CheckOwners(
+ input_api, output_api, source_file_filter=None))
+ return results
-adb shell "cd /data/local/tmp/v8;\
- perf record -R -e cycles -c 10000 -f -i \
- ./d8 --ll_prof --gc-fake-mmap=/data/local/tmp/__v8_gc__ $RUN_ARGS"
-adb pull /data/local/tmp/v8/v8.log .
-adb pull /data/local/tmp/v8/v8.log.ll .
-adb pull /data/perf.data .
+def CheckChangeOnUpload(input_api, output_api):
+ results = []
+ results.extend(_CommonChecks(input_api, output_api))
+ return results
-ARCH=arm-linux-androideabi-4.6
-TOOLCHAIN="${ANDROID_NDK_ROOT}/toolchains/$ARCH/prebuilt/linux-x86/bin"
-$BASE/tools/ll_prof.py --host-root="$BASE/deploy" \
- --gc-fake-mmap=/data/local/tmp/__v8_gc__ \
- --objdump="$TOOLCHAIN/arm-linux-androideabi-objdump" \
- $LL_PROF_ARGS
+def CheckChangeOnCommit(input_api, output_api):
+ results = []
+ results.extend(_CommonChecks(input_api, output_api))
+ results.extend(input_api.canned_checks.CheckChangeHasDescription(
+ input_api, output_api))
+ results.extend(_V8PresubmitChecks(input_api, output_api))
+ return results
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698