johnme

Real world impact bash driver

Dec 19th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.97 KB | None | 0 0
  1. force-enable-autosizing() {
  2.     if grep -xq '#if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP' Source/core/page/Settings.cpp; then
  3.         sed -i 's/#if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP/#if 1\/\/HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP/' Source/core/page/Settings.cpp
  4.     fi
  5. }
  6. real-world-impact() {
  7.     # Set these variables
  8.     local CHROMIUM_ROOT=/usr/local/google/home/$USER/chromium/src
  9.     local NUM_SITES=100
  10.  
  11.     local from=master
  12.     if [[ -n $2 ]]; then
  13.         from="$1"
  14.         shift
  15.     fi
  16.     local to="$1"
  17.    
  18.     cd $CHROMIUM_ROOT/third_party/WebKit &&
  19.     if git show-ref --verify --quiet refs/heads/impact-before; then
  20.         git checkout master
  21.         git branch -D impact-before
  22.     fi &&
  23.     if git show-ref --verify --quiet "refs/heads/$from"; then
  24.         gch -t -b impact-before "$from"
  25.     else
  26.         echo "Error: branch '$from' no found"
  27.         return 1
  28.     fi &&
  29.     force-enable-autosizing &&
  30.     git commit -a -m 'patch + hack' # no &&, as returns 1 if nothing to commit
  31.     cd $CHROMIUM_ROOT &&
  32.     cr build blink_tests &&
  33.     cd $CHROMIUM_ROOT/third_party/WebKit &&
  34.     # Run twice to reduce timing issues from it not being cached in RAM.
  35.     $CHROMIUM_ROOT/tools/real_world_impact/real_world_impact.py before $NUM_SITES &&
  36.     $CHROMIUM_ROOT/tools/real_world_impact/real_world_impact.py before $NUM_SITES &&
  37.     if git show-ref --verify --quiet refs/heads/impact-after; then
  38.         git branch -D impact-after
  39.     fi &&
  40.     if git show-ref --verify --quiet "refs/heads/$to"; then
  41.         gch -t -b impact-after "$to"
  42.     else
  43.         echo "Error: branch '$to' no found"
  44.         return 1
  45.     fi &&
  46.     force-enable-autosizing &&
  47.     git commit -a -m 'patch + hack' &&
  48.     cd $CHROMIUM_ROOT &&
  49.     cr build blink_tests &&
  50.     cd $CHROMIUM_ROOT/third_party/WebKit &&
  51.     $CHROMIUM_ROOT/tools/real_world_impact/real_world_impact.py after $NUM_SITES &&
  52.     $CHROMIUM_ROOT/tools/real_world_impact/real_world_impact.py compare $NUM_SITES
  53. }
Advertisement
Add Comment
Please, Sign In to add comment