builder_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2020 The Android Open Source Project
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package rust
  15. import "testing"
  16. func TestSourceProviderCollision(t *testing.T) {
  17. testRustError(t, "multiple source providers generate the same filename output: bindings.rs", `
  18. rust_binary {
  19. name: "source_collider",
  20. srcs: [
  21. "foo.rs",
  22. ":libbindings1",
  23. ":libbindings2",
  24. ],
  25. }
  26. rust_bindgen {
  27. name: "libbindings1",
  28. source_stem: "bindings",
  29. crate_name: "bindings1",
  30. wrapper_src: "src/any.h",
  31. }
  32. rust_bindgen {
  33. name: "libbindings2",
  34. source_stem: "bindings",
  35. crate_name: "bindings2",
  36. wrapper_src: "src/any.h",
  37. }
  38. `)
  39. }