1#!/bin/bash
2# Copyright 2017 the V8 project authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Exit immediately if a command exits with a non-zero status.
7set -e
8
9# Treat unset variables as an error when substituting.
10set -u
11
12# return value of a pipeline is the status of the last command to exit with a
13# non-zero status, or zero if no command exited with a non-zero status
14set -o pipefail
15
16TOOLS_WASM_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
17V8_DIR="${TOOLS_WASM_DIR}/../.."
18SPEC_TEST_DIR=${V8_DIR}/test/wasm-spec-tests
19
20cd ${V8_DIR}
21
22rm -rf ${SPEC_TEST_DIR}/tests
23mkdir ${SPEC_TEST_DIR}/tests
24
25rm -rf ${SPEC_TEST_DIR}/tmp
26mkdir ${SPEC_TEST_DIR}/tmp
27
28./tools/dev/gm.py x64.release d8
29
30cd ${V8_DIR}/test/wasm-js/interpreter
31
32# The next step requires that ocaml is installed. See the README.md in
33# ${V8_DIR}/test/wasm-js/interpreter/.
34make clean all
35
36cd ${V8_DIR}/test/wasm-js/test/core
37
38
39./run.py --wasm ${V8_DIR}/test/wasm-js/interpreter/wasm --js ${V8_DIR}/out/x64.release/d8 --out ${SPEC_TEST_DIR}/tmp
40cp ${SPEC_TEST_DIR}/tmp/*.js ${SPEC_TEST_DIR}/tests/
41rm -rf ${SPEC_TEST_DIR}/tmp
42
43cd ${SPEC_TEST_DIR}
44echo
45echo "The following files will get uploaded:"
46ls tests
47echo
48
49# For the following command you first have to authenticate with google cloud
50# storage. For that you have to execute
51#
52# > gsutil.py config
53#
54# When the script asks you for your project-id, use 0.
55upload_to_google_storage.py -a -b v8-wasm-spec-tests tests
56