| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/host.gni") |
| import("//tools/create/goldens/golden_test.gni") |
| |
| group("goldens") { |
| testonly = true |
| deps = [ |
| ":tests", |
| "my-component-v1-cpp", |
| "my-component-v1-rust", |
| "my-component-v2-cpp", |
| "my-component-v2-rust", |
| "my-driver-cpp", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":my-component-v1-cpp($host_toolchain)", |
| ":my-component-v1-rust($host_toolchain)", |
| ":my-component-v2-cpp($host_toolchain)", |
| ":my-component-v2-rust($host_toolchain)", |
| ":my-driver-cpp($host_toolchain)", |
| ] |
| if (is_fuchsia) { |
| deps += [ |
| "my-component-v1-cpp:tests", |
| "my-component-v1-rust:tests", |
| "my-component-v2-cpp:tests", |
| "my-component-v2-rust:tests", |
| "my-driver-cpp:tests", |
| ] |
| } |
| } |
| |
| # Create a Rust v1 component project named `my-component-v1-rust` and |
| # compare its file contents to the golden project of the same name. |
| golden_test("my-component-v1-rust") { |
| project_type = "component-v1" |
| language = "rust" |
| golden_files = [ |
| "my-component-v1-rust/BUILD.gn", |
| "my-component-v1-rust/meta/my-component-v1-rust.cmx", |
| "my-component-v1-rust/README.md", |
| "my-component-v1-rust/src/main.rs", |
| ] |
| } |
| |
| # Create a C++ v1 component project named `my-component-v1-cpp` and |
| # compare its file contents to the golden project of the same name. |
| golden_test("my-component-v1-cpp") { |
| project_type = "component-v1" |
| language = "cpp" |
| golden_files = [ |
| "my-component-v1-cpp/BUILD.gn", |
| "my-component-v1-cpp/main.cc", |
| "my-component-v1-cpp/meta/my-component-v1-cpp.cmx", |
| "my-component-v1-cpp/my_component_v1_cpp_unittest.cc", |
| "my-component-v1-cpp/my_component_v1_cpp.cc", |
| "my-component-v1-cpp/my_component_v1_cpp.h", |
| "my-component-v1-cpp/README.md", |
| ] |
| } |
| |
| # Create a C++ v2 component project named `my-component-v2-cpp` and |
| # compare its file contents to the golden project of the same name. |
| golden_test("my-component-v2-cpp") { |
| project_type = "component-v2" |
| language = "cpp" |
| golden_files = [ |
| "my-component-v2-cpp/BUILD.gn", |
| "my-component-v2-cpp/main.cc", |
| "my-component-v2-cpp/meta/my-component-v2-cpp.cml", |
| "my-component-v2-cpp/meta/my-component-v2-cpp-unittests.cml", |
| "my-component-v2-cpp/my_component_v2_cpp.cc", |
| "my-component-v2-cpp/my_component_v2_cpp.h", |
| "my-component-v2-cpp/my_component_v2_cpp_unittest.cc", |
| "my-component-v2-cpp/README.md", |
| ] |
| } |
| |
| # Create a Rust v2 component project named `my-component-v2-rust` and |
| # compare its file contents to the golden project of the same name. |
| golden_test("my-component-v2-rust") { |
| project_type = "component-v2" |
| language = "rust" |
| golden_files = [ |
| "my-component-v2-rust/BUILD.gn", |
| "my-component-v2-rust/meta/my-component-v2-rust.cml", |
| "my-component-v2-rust/meta/my-component-v2-rust-unittests.cml", |
| "my-component-v2-rust/README.md", |
| "my-component-v2-rust/src/main.rs", |
| ] |
| } |
| |
| # Create a C++ driver project named `my-driver-cpp` and |
| # compare its file contents to the golden project of the same name. |
| golden_test("my-driver-cpp") { |
| project_type = "driver" |
| language = "cpp" |
| golden_files = [ |
| "my-driver-cpp/BUILD.gn", |
| "my-driver-cpp/README.md", |
| "my-driver-cpp/my_driver_cpp.h", |
| "my-driver-cpp/my_driver_cpp.bind", |
| "my-driver-cpp/my_driver_cpp.cc", |
| "my-driver-cpp/unit-tests.cc", |
| ] |
| } |