comparison third_party/emsdk/test/test.sh @ 179:8d17f6e6e290

[ThirdParty] Added emsdk bazel rules that can be supported by bazel 9.0.0
author MrJuneJune <me@mrjunejune.com>
date Thu, 22 Jan 2026 21:23:17 -0800
parents
children
comparison
equal deleted inserted replaced
178:94705b5986b3 179:8d17f6e6e290
1 #!/usr/bin/env bash
2
3 echo "test the standard workflow (as close as possible to how a user would do it, in the shell)"
4 echo "machine: $(uname -m)"
5 echo "kernel: $(uname -s)"
6
7 set -x
8 set -e
9
10 # Test that arbitrary (non-released) versions can be installed and
11 # activated.
12 # This test cannot run on linux-arm64 because only certain binaries
13 # get uploaded for this architecture.
14 if [[ !($(uname -s) == "Linux" && $(uname -m) == "aarch64") ]]; then
15 ./emsdk install sdk-upstream-1b7f7bc6002a3ca73647f41fc10e1fac7f06f804
16 ./emsdk activate sdk-upstream-1b7f7bc6002a3ca73647f41fc10e1fac7f06f804
17 source ./emsdk_env.sh
18 which emcc
19 emcc -v
20 fi
21
22 # Install an older version of the SDK that requires EM_CACHE to be
23 # set in the environment, so that we can test it is later removed
24 # This test only runs on x64 because we didn't build arm binaries
25 # when this older version of the SDK was built.
26 if [[ $(uname -m) == "x86_64" ]]; then
27 ./emsdk install sdk-1.39.15
28 ./emsdk activate sdk-1.39.15
29 source ./emsdk_env.sh
30 which emcc
31 emcc -v
32 test -n "$EM_CACHE"
33 fi
34
35 # Install the latest version of the SDK which is the expected precondition
36 # of test.py.
37 ./emsdk install latest
38 ./emsdk activate latest
39 source ./emsdk_env.sh --build=Release
40 # Test that EM_CACHE was unset
41 test -z "$EM_CACHE"
42
43 # On mac and windows python3 should be in the path and point to the
44 # bundled version.
45 which python3
46 which emcc
47 emcc -v