Skip to content

Commit 69cceea

Browse files
committed
Added rust_wasm_bindgen_test rule
1 parent 151d0f7 commit 69cceea

35 files changed

+2167
-26
lines changed

.bazelci/presubmit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,8 @@ tasks:
10651065
platform: ubuntu2004
10661066
name: Extensions wasm-bindgen
10671067
working_directory: extensions/wasm_bindgen
1068+
shell_commands:
1069+
- "sudo apt -y update && sudo apt -y install libxcb1 libatk1.0-0 libatk-bridge2.0-0 libxcomposite1 libxdamage1"
10681070
build_flags: *aspects_flags
10691071
test_flags: *aspects_flags
10701072
build_targets:

extensions/wasm_bindgen/3rdparty/BUILD.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ crates_vendor(
3333
"wasm-bindgen": crate.spec(
3434
version = WASM_BINDGEN_VERSION,
3535
),
36+
"wasm-bindgen-test": crate.spec(
37+
version = "0.3.37",
38+
),
3639
},
3740
# Shorten the repository name to avoid MAX_PATH issues on Windows
3841
# `rules_rust_wasm_bindgen_deps` == `rrwbd`
@@ -47,12 +50,25 @@ alias(
4750
visibility = ["//visibility:public"],
4851
)
4952

53+
alias(
54+
name = "wasm_bindgen_test_runner",
55+
actual = "@rules_rust_wasm_bindgen_cli//:test_runner",
56+
tags = ["manual"],
57+
visibility = ["//visibility:public"],
58+
)
59+
5060
alias(
5161
name = "wasm_bindgen",
5262
actual = "//3rdparty/crates:wasm-bindgen",
5363
visibility = ["//visibility:public"],
5464
)
5565

66+
alias(
67+
name = "wasm_bindgen_test",
68+
actual = "//3rdparty/crates:wasm-bindgen-test",
69+
visibility = ["//visibility:public"],
70+
)
71+
5672
bzl_library(
5773
name = "bzl_lib",
5874
srcs = [

extensions/wasm_bindgen/3rdparty/BUILD.wasm-bindgen-cli.bazel

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ exports_files([
1212
# TODO: Comment on bootstrapping
1313
rust_binary(
1414
name = "wasm-bindgen-cli",
15-
srcs = glob(["**/*.rs"]),
15+
srcs = glob(
16+
include = ["**/*.rs"],
17+
exclude = ["src/bin/wasm-bindgen-test-runner/**"],
18+
),
1619
aliases = aliases(),
1720
crate_features = [
1821
],
@@ -33,3 +36,33 @@ alias(
3336
actual = ":wasm-bindgen-cli",
3437
tags = ["manual"],
3538
)
39+
40+
rust_binary(
41+
name = "wasm-bindgen-test-runner",
42+
srcs = glob(
43+
include = ["**/*.rs"],
44+
exclude = ["src/bin/wasm-bindgen.rs"],
45+
),
46+
aliases = aliases(),
47+
compile_data = glob([
48+
"**/*.html",
49+
]),
50+
crate_features = [
51+
],
52+
crate_root = "src/bin/wasm-bindgen-test-runner/main.rs",
53+
data = [],
54+
edition = "2018",
55+
proc_macro_deps = all_crate_deps(proc_macro = True),
56+
rustc_flags = [
57+
# Don't produce warnings for this crate
58+
"--cap-lints=allow",
59+
],
60+
version = WASM_BINDGEN_VERSION,
61+
deps = all_crate_deps(),
62+
)
63+
64+
alias(
65+
name = "test_runner",
66+
actual = ":wasm-bindgen-test-runner",
67+
tags = ["manual"],
68+
)

extensions/wasm_bindgen/3rdparty/Cargo.Bazel.lock

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/wasm_bindgen/3rdparty/crates/BUILD.bazel

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/wasm_bindgen/3rdparty/crates/BUILD.js-sys-0.3.77.bazel

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)