Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Add PRESUBMIT script to V8 (issue 11092002)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
joc...@chromium.org  
View profile  
 More options Oct 8 2012, 9:25 am
From: joc...@chromium.org
Date: Mon, 08 Oct 2012 13:25:50 +0000
Local: Mon, Oct 8 2012 9:25 am
Subject: Add PRESUBMIT script to V8 (issue 11092002)
Reviewers: danno,

Message:
plz review

Description:
Add PRESUBMIT script to V8

Currently, it executes the OWNERS check and tools/presubmit.py, as well as a
check for a non-empty commit message

BUG=none
TEST=run git cl presubmit

Please review this at https://codereview.chromium.org/11092002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
   A + PRESUBMIT.py

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..0077be941a00f77d92f1571c12c899e44 1d3e22b
--- 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
da...@chromium.org  
View profile  
 More options Oct 8 2012, 9:49 am
From: da...@chromium.org
Date: Mon, 08 Oct 2012 13:49:39 +0000
Local: Mon, Oct 8 2012 9:49 am
Subject: Re: Add PRESUBMIT script to V8 (issue 11092002)
lgtm, I'll land it for you

https://codereview.chromium.org/11092002/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »