update-wasm-spec-tests.sh 1.51 KB
Newer Older
1 2 3 4 5
#!/bin/bash
# Copyright 2017 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
# Exit immediately if a command exits with a non-zero status.
7 8
set -e

9 10 11 12 13 14 15
# Treat unset variables as an error when substituting.
set -u

# return value of a pipeline is the status of the last command to exit with a
# non-zero status, or zero if no command exited with a non-zero status
set -o pipefail

16 17
TOOLS_WASM_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
V8_DIR="${TOOLS_WASM_DIR}/../.."
18
SPEC_TEST_DIR=${V8_DIR}/test/wasm-spec-tests
19 20 21

cd ${V8_DIR}

22 23 24 25 26
rm -rf ${SPEC_TEST_DIR}/tests
mkdir ${SPEC_TEST_DIR}/tests

rm -rf ${SPEC_TEST_DIR}/tmp
mkdir ${SPEC_TEST_DIR}/tmp
27

28
./tools/dev/gm.py x64.release d8
29

30
cd ${V8_DIR}/test/wasm-js/data/interpreter
31 32

# The next step requires that ocaml is installed. See the README.md in
33
# ${V8_DIR}/test/wasm-js/data/interpreter/.
34
make clean all
35

36
cd ${V8_DIR}/test/wasm-js/data/test/core
37 38


39
./run.py --wasm ${V8_DIR}/test/wasm-js/data/interpreter/wasm --js ${V8_DIR}/out/x64.release/d8 --out ${SPEC_TEST_DIR}/tmp
40 41
cp ${SPEC_TEST_DIR}/tmp/*.js ${SPEC_TEST_DIR}/tests/
rm -rf ${SPEC_TEST_DIR}/tmp
42

43 44 45 46 47
cd ${SPEC_TEST_DIR}
echo
echo "The following files will get uploaded:"
ls tests
echo
48 49 50 51 52 53 54

# For the following command you first have to authenticate with google cloud
# storage. For that you have to execute
#
# > gsutil.py config
#
# When the script asks you for your project-id, use 0.
55
upload_to_google_storage.py -a -b v8-wasm-spec-tests tests