2016-08-29 19:01:09 +00:00
|
|
|
#!/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.
|
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
set -ex
|
2016-08-29 19:01:09 +00:00
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
|
|
|
cd ../..
|
2016-08-29 19:01:09 +00:00
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
BUILD_DIR=out/mk_wasm_fuzzer_corpus
|
|
|
|
CORPUS_DIR=test/fuzzer/wasm_corpus
|
2016-08-29 19:01:09 +00:00
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
rm -rf $BUILD_DIR $CORPUS_DIR
|
|
|
|
mkdir -p $CORPUS_DIR
|
2016-08-29 19:01:09 +00:00
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
# 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
|
2016-08-29 19:01:09 +00:00
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
./tools/run-tests.py --outdir=$BUILD_DIR --extra-flags="--dump-wasm-module \
|
|
|
|
--dump-wasm-module-path=./$CORPUS_DIR/"
|
2016-08-29 19:01:09 +00:00
|
|
|
|
2020-11-30 16:54:36 +00:00
|
|
|
rm -rf $BUILD_DIR
|
2016-08-29 19:01:09 +00:00
|
|
|
|
|
|
|
# Delete items over 20k.
|
2020-11-30 16:54:36 +00:00
|
|
|
find $CORPUS_DIR -type f -size +20k | xargs rm
|
2016-08-29 19:01:09 +00:00
|
|
|
|
|
|
|
# Upload changes.
|
2020-11-30 16:54:36 +00:00
|
|
|
cd $CORPUS_DIR/..
|
2017-04-28 17:22:29 +00:00
|
|
|
upload_to_google_storage.py -a -b v8-wasm-fuzzer wasm_corpus
|