 Chromium Code Reviews
 Chromium Code Reviews Issue 10407094:
  Add harness script for JavaScript language fuzzer.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 10407094:
  Add harness script for JavaScript language fuzzer.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 # Copyright 2012 the V8 project authors. All rights reserved. | |
| 3 # Redistribution and use in source and binary forms, with or without | |
| 4 # modification, are permitted provided that the following conditions are | |
| 5 # met: | |
| 6 # | |
| 7 # * Redistributions of source code must retain the above copyright | |
| 8 # notice, this list of conditions and the following disclaimer. | |
| 9 # * Redistributions in binary form must reproduce the above | |
| 10 # copyright notice, this list of conditions and the following | |
| 11 # disclaimer in the documentation and/or other materials provided | |
| 12 # with the distribution. | |
| 13 # * Neither the name of Google Inc. nor the names of its | |
| 14 # contributors may be used to endorse or promote products derived | |
| 15 # from this software without specific prior written permission. | |
| 16 # | |
| 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 28 | |
| 29 # A simple harness that downloads and runs 'jsfunfuzz' against debug and | |
| 30 # release builds using d8. This takes a long time because it runs many | |
| 31 # iterations and is mainly intended for automated usage. The package | |
| 32 # containing 'jsfunfuzz' can be found as an attachment to this bug: | |
| 33 # https://bugzilla.mozilla.org/show_bug.cgi?id=jsfunfuzz | |
| 34 | |
| 35 JSFUNFUZZ_URL="https://bugzilla.mozilla.org/attachment.cgi?id=310631" | |
| 36 JSFUNFUZZ_MD5="d0e497201c5cd7bffbb1cdc1574f4e32" | |
| 37 | |
| 38 v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../) | |
| 39 | |
| 40 jsfunfuzz_file=$v8_root/tools/jsfunfuzz.zip | |
| 
Jakob Kummerow
2012/05/22 14:12:01
Please put quotes around any variables containing
 
Michael Starzinger
2012/05/22 15:04:33
Done.
 | |
| 41 if [ ! -f $jsfunfuzz_file ]; then | |
| 42 echo "Downloading $jsfunfuzz_file ..." | |
| 43 wget -q -O $jsfunfuzz_file $JSFUNFUZZ_URL || exit 1 | |
| 44 fi | |
| 45 | |
| 46 jsfunfuzz_sum=$(md5sum $jsfunfuzz_file | awk "{ print \$1 }") | |
| 
Jakob Kummerow
2012/05/22 14:12:01
nit: if you use single quotes, you don't need the
 
Michael Starzinger
2012/05/22 15:04:33
Done.
 | |
| 47 if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then | |
| 48 echo "Failed to verify checksum!" | |
| 49 exit 1 | |
| 50 fi | |
| 51 | |
| 52 jsfunfuzz_dir=$v8_root/tools/jsfunfuzz | |
| 53 if [ ! -d $jsfunfuzz_dir ]; then | |
| 54 echo "Unpacking into $jsfunfuzz_dir ..." | |
| 55 unzip $jsfunfuzz_file -d $jsfunfuzz_dir || exit 1 | |
| 56 fi | |
| 57 | |
| 58 flags_debug='--debug-code --expose-gc --verify-gc' | |
| 59 flags_release='' | |
| 60 | |
| 61 echo "-------------------- DEBUG" | |
| 62 python -u $jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py 300 \ | |
| 63 $v8_root/d8_g $flags_debug $jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js | |
| 
Jakob Kummerow
2012/05/22 14:12:01
You want this to work with the GYP build, don't yo
 
Michael Starzinger
2012/05/22 15:04:33
Done. As discussed offline, I switched the script
 | |
| 64 exit_debug=$(cat w* | grep " looking good" -c) | |
| 65 exit_debug=$((exit_debug-100)) | |
| 66 tar -cjf `date +%y%m%d`-debug.tar.bz2 err-* w* | |
| 
Jakob Kummerow
2012/05/22 14:12:01
Please use $(...) instead of `...`.
 
Michael Starzinger
2012/05/22 15:04:33
Done.
 | |
| 67 rm err-* w* | |
| 
Jakob Kummerow
2012/05/22 14:12:01
Might want to use "rm -f" to suppress errors and i
 
Michael Starzinger
2012/05/22 15:04:33
Done.
 | |
| 68 echo "Debug failures: $exit_debug" | |
| 69 | |
| 70 echo "-------------------- RELEASE" | |
| 71 python -u $jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py 300 \ | |
| 72 $v8_root/d8 $flags_release $jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js | |
| 
Jakob Kummerow
2012/05/22 14:12:01
Same request for dynamic/overridable path to d8 he
 
Michael Starzinger
2012/05/22 15:04:33
Done.
 | |
| 73 exit_release=$(cat w* | grep " looking good" -c) | |
| 74 exit_release=$((exit_release-100)) | |
| 75 tar -cjf `date +%y%m%d`-release.tar.bz2 err-* w* | |
| 76 rm err-* w* | |
| 77 echo "Release failures: $exit_debug" | |
| 
Jakob Kummerow
2012/05/22 14:12:01
surely you mean $exit_release.
 
Michael Starzinger
2012/05/22 15:04:33
Done.
 | |
| 78 | |
| 79 exit_total=$((exit_release*-1+exit_debug*-1)) | |
| 80 echo "Total failures: $exit_total" | |
| 81 exit $exit_total | |
| OLD | NEW |