2020-09-10 21:42:46 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
echo "test bazel"
|
|
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
set -e
|
|
|
|
|
|
2021-08-25 17:21:40 -07:00
|
|
|
# Get the latest version number from emscripten-releases-tag.json.
|
2024-06-20 16:16:05 -07:00
|
|
|
VER=$(scripts/get_release_info.py emscripten-releases-tags.json latest)
|
|
|
|
|
|
2020-09-11 20:15:19 -04:00
|
|
|
# Based on the latest version number, get the commit hash for that version.
|
2024-06-20 16:16:05 -07:00
|
|
|
HASH=$(scripts/get_release_info.py emscripten-releases-tags.json hash ${VER})
|
2021-01-29 18:25:41 -08:00
|
|
|
|
2023-08-24 10:10:29 -07:00
|
|
|
FAILMSG="!!! scripts/update_bazel_workspace.py needs to be run !!!"
|
2020-09-11 20:15:19 -04:00
|
|
|
|
|
|
|
|
# Ensure the WORKSPACE file is up to date with the latest version.
|
2021-03-25 00:50:44 +01:00
|
|
|
grep ${VER} bazel/revisions.bzl || (echo ${FAILMSG} && false)
|
|
|
|
|
grep ${HASH} bazel/revisions.bzl || (echo ${FAILMSG} && false)
|
2020-09-11 20:15:19 -04:00
|
|
|
|
2020-09-10 21:42:46 -04:00
|
|
|
cd bazel
|
|
|
|
|
bazel build //hello-world:hello-world-wasm
|
2021-02-08 15:34:32 -05:00
|
|
|
bazel build //hello-world:hello-world-wasm-simd
|
2021-03-25 00:50:44 +01:00
|
|
|
|
|
|
|
|
cd test_external
|
|
|
|
|
bazel build //:hello-world-wasm
|
2024-04-22 11:19:11 -07:00
|
|
|
bazel build //long_command_line:long_command_line_wasm
|
2021-10-19 17:44:48 -04:00
|
|
|
bazel build //:hello-embind-wasm --compilation_mode dbg # debug
|
2022-02-17 13:16:18 -05:00
|
|
|
|
2021-10-19 17:44:48 -04:00
|
|
|
# Test use of the closure compiler
|
|
|
|
|
bazel build //:hello-embind-wasm --compilation_mode opt # release
|
2022-02-17 13:16:18 -05:00
|
|
|
# This function should not be minified if the externs file is loaded correctly.
|
2024-04-22 11:19:11 -07:00
|
|
|
grep "customJSFunctionToTestClosure" bazel-bin/hello-embind-wasm/hello-embind.js
|