update-wasm-fuzzers.sh 857 Bytes
Newer Older
1 2 3 4 5
#!/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.

6
set -ex
7

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

11 12
BUILD_DIR=out/mk_wasm_fuzzer_corpus
CORPUS_DIR=test/fuzzer/wasm_corpus
13

14 15
rm -rf $BUILD_DIR $CORPUS_DIR
mkdir -p $CORPUS_DIR
16

17 18 19
# 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
20

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

24
rm -rf $BUILD_DIR
25 26

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

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