OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright 2012 the V8 project authors. All rights reserved. | 2 # Copyright 2012 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 fi | 45 fi |
46 | 46 |
47 if [ ! -f "$d8" ]; then | 47 if [ ! -f "$d8" ]; then |
48 echo "Failed to find d8 binary: $d8" | 48 echo "Failed to find d8 binary: $d8" |
49 exit 1 | 49 exit 1 |
50 fi | 50 fi |
51 | 51 |
52 # Deprecated download method. A prepatched archive is downloaded as a hook | 52 # Deprecated download method. A prepatched archive is downloaded as a hook |
53 # if jsfunfuzz=1 is specified as a gyp flag. Requires google.com authentication | 53 # if jsfunfuzz=1 is specified as a gyp flag. Requires google.com authentication |
54 # for google storage. | 54 # for google storage. |
55 if [ "$2" == "--download" ]; then | 55 if [ "$3" == "--download" ]; then |
56 | 56 |
57 jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip" | 57 jsfunfuzz_file="$v8_root/tools/jsfunfuzz.zip" |
58 if [ ! -f "$jsfunfuzz_file" ]; then | 58 if [ ! -f "$jsfunfuzz_file" ]; then |
59 echo "Downloading $jsfunfuzz_file ..." | 59 echo "Downloading $jsfunfuzz_file ..." |
60 wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1 | 60 wget -q -O "$jsfunfuzz_file" $JSFUNFUZZ_URL || exit 1 |
61 fi | 61 fi |
62 | 62 |
63 jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }') | 63 jsfunfuzz_sum=$(md5sum "$jsfunfuzz_file" | awk '{ print $1 }') |
64 if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then | 64 if [ $jsfunfuzz_sum != $JSFUNFUZZ_MD5 ]; then |
65 echo "Failed to verify checksum!" | 65 echo "Failed to verify checksum!" |
(...skipping 19 matching lines...) Expand all Loading... |
85 EOF | 85 EOF |
86 fi | 86 fi |
87 | 87 |
88 fi | 88 fi |
89 | 89 |
90 flags='--debug-code --expose-gc --verify-gc' | 90 flags='--debug-code --expose-gc --verify-gc' |
91 python -u "$jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py" 300 \ | 91 python -u "$jsfunfuzz_dir/jsfunfuzz/multi_timed_run.py" 300 \ |
92 "$d8" $flags "$jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js" | 92 "$d8" $flags "$jsfunfuzz_dir/jsfunfuzz/jsfunfuzz.js" |
93 exit_code=$(cat w* | grep " looking good" -c) | 93 exit_code=$(cat w* | grep " looking good" -c) |
94 exit_code=$((100-exit_code)) | 94 exit_code=$((100-exit_code)) |
95 archive=fuzz-results-$(date +%Y%m%d%H%M%S).tar.bz2 | 95 |
| 96 if [ -n "$2" ]; then |
| 97 archive="$2" |
| 98 else |
| 99 archive=fuzz-results-$(date +%Y%m%d%H%M%S).tar.bz2 |
| 100 fi |
96 echo "Creating archive $archive" | 101 echo "Creating archive $archive" |
97 tar -cjf $archive err-* w* | 102 tar -cjf $archive err-* w* |
98 rm -f err-* w* | 103 rm -f err-* w* |
99 | 104 |
100 echo "Total failures: $exit_code" | 105 echo "Total failures: $exit_code" |
101 exit $exit_code | 106 exit $exit_code |
OLD | NEW |