diff options
author | 2020-08-06 21:33:49 +0000 | |
---|---|---|
committer | 2020-08-06 21:33:49 +0000 | |
commit | 217a1e406ea3b7e1cbf228d7d4d8a4f555ba482d (patch) | |
tree | 1604d4a973b4771e8dbfed44b99ca41abb9f763c /rust/bindgen_test.go | |
parent | 8dc2af873b1fab56179310374ff9a6c7e39246e3 (diff) | |
parent | 12e2cb71c7192edd43c0d283384d119900844cd3 (diff) |
Merge "[rust] Escape flags for bindgen"
Diffstat (limited to 'rust/bindgen_test.go')
-rw-r--r-- | rust/bindgen_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rust/bindgen_test.go b/rust/bindgen_test.go index 0b529ca5a..191da9b11 100644 --- a/rust/bindgen_test.go +++ b/rust/bindgen_test.go @@ -27,8 +27,8 @@ func TestRustBindgen(t *testing.T) { crate_name: "bindgen", stem: "libbindgen", source_stem: "bindings", - bindgen_flags: ["--bindgen-flag"], - cflags: ["--clang-flag"], + bindgen_flags: ["--bindgen-flag.*"], + cflags: ["--clang-flag()"], shared_libs: ["libfoo_shared"], static_libs: ["libfoo_static"], } @@ -42,10 +42,11 @@ func TestRustBindgen(t *testing.T) { } `) libbindgen := ctx.ModuleForTests("libbindgen", "android_arm64_armv8-a").Output("bindings.rs") - if !strings.Contains(libbindgen.Args["flags"], "--bindgen-flag") { + // Ensure that the flags are present and escaped + if !strings.Contains(libbindgen.Args["flags"], "'--bindgen-flag.*'") { t.Errorf("missing bindgen flags in rust_bindgen rule: flags %#v", libbindgen.Args["flags"]) } - if !strings.Contains(libbindgen.Args["cflags"], "--clang-flag") { + if !strings.Contains(libbindgen.Args["cflags"], "'--clang-flag()'") { t.Errorf("missing clang cflags in rust_bindgen rule: cflags %#v", libbindgen.Args["cflags"]) } if !strings.Contains(libbindgen.Args["cflags"], "-Ishared_include") { |