11cb0ef41Sopenharmony_ci#!/bin/bash
21cb0ef41Sopenharmony_ci# Copyright 2016 the V8 project authors. All rights reserved.
31cb0ef41Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
41cb0ef41Sopenharmony_ci# found in the LICENSE file.
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciset -ex
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_cicd "$( dirname "${BASH_SOURCE[0]}" )"
91cb0ef41Sopenharmony_cicd ../..
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ciBUILD_DIR=out/mk_wasm_fuzzer_corpus
121cb0ef41Sopenharmony_ciCORPUS_DIR=test/fuzzer/wasm_corpus
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_cirm -rf $BUILD_DIR $CORPUS_DIR
151cb0ef41Sopenharmony_cimkdir -p $CORPUS_DIR
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ci# Build optdebug such that the --dump-wasm-module flag is available.
181cb0ef41Sopenharmony_cign gen $BUILD_DIR --args='is_debug=true v8_optimized_debug=true target_cpu="x64" use_goma=true'
191cb0ef41Sopenharmony_ciautoninja -C $BUILD_DIR
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci./tools/run-tests.py --outdir=$BUILD_DIR --extra-flags="--dump-wasm-module \
221cb0ef41Sopenharmony_ci  --dump-wasm-module-path=./$CORPUS_DIR/"
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_cirm -rf $BUILD_DIR
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_ci# Delete items over 20k.
271cb0ef41Sopenharmony_cifind $CORPUS_DIR -type f -size +20k | xargs rm
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci# Upload changes.
301cb0ef41Sopenharmony_cicd $CORPUS_DIR/..
311cb0ef41Sopenharmony_ciupload_to_google_storage.py -a -b v8-wasm-fuzzer wasm_corpus
32