File: update-wasm-fuzzers.sh

package info (click to toggle)
nodejs 22.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 246,928 kB
  • sloc: cpp: 1,582,349; javascript: 582,017; ansic: 82,400; python: 60,561; sh: 4,009; makefile: 2,263; asm: 1,732; pascal: 1,565; perl: 248; lisp: 222; xml: 42
file content (31 lines) | stat: -rwxr-xr-x 857 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -ex

cd "$( dirname "${BASH_SOURCE[0]}" )"
cd ../..

BUILD_DIR=out/mk_wasm_fuzzer_corpus
CORPUS_DIR=test/fuzzer/wasm_corpus

rm -rf $BUILD_DIR $CORPUS_DIR
mkdir -p $CORPUS_DIR

# Build optdebug such that the --dump-wasm-module flag is available.
gn gen $BUILD_DIR --args='is_debug=true v8_optimized_debug=true target_cpu="x64" use_goma=true'
autoninja -C $BUILD_DIR

./tools/run-tests.py --outdir=$BUILD_DIR --extra-flags="--dump-wasm-module \
  --dump-wasm-module-path=./$CORPUS_DIR/"

rm -rf $BUILD_DIR

# Delete items over 20k.
find $CORPUS_DIR -type f -size +20k | xargs rm

# Upload changes.
cd $CORPUS_DIR/..
upload_to_google_storage.py -a -b v8-wasm-fuzzer wasm_corpus