| # Copyright 2024 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/python/python_host_test.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_macro.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| # Generated by //build/rust/tests/create_rustdoc_tests.py |
| # Test explanation: checks that we can build a proc macro that use another crate, with a separate out dir |
| |
| group("proc_macro_use") { |
| testonly = true |
| deps = [ ":host-test($host_toolchain)" ] |
| } |
| |
| if (is_host) { |
| python_host_test("host-test") { |
| main_source = "test.py" |
| deps = [ ":host-test-data" ] |
| extra_args = |
| [ rebase_path("$target_gen_dir/november.doc.zip.copy", root_build_dir) ] |
| } |
| host_test_data("host-test-data") { |
| sources = [ "$target_gen_dir/november.doc.zip" ] |
| public_deps = [ |
| ":charlie.rustdoc", |
| ":march_proc_macro.rustdoc", |
| ":november.rustdoc", |
| ] |
| outputs = [ "$target_gen_dir/november.doc.zip.copy" ] |
| } |
| } |
| |
| rustc_library("charlie") { |
| edition = 2021 |
| define_rustdoc_test_override = true |
| name = "charlie" |
| deps = [] |
| public_deps = [] |
| testonly = true |
| source_root = "../src/charlie.rs" |
| sources = [ "../src/charlie.rs" ] |
| quiet_clippy = true |
| rustdoc_out_dir = "$target_gen_dir/charlie.doc" |
| rustdoc_args = [ "--enable-index-page" ] |
| zip_rustdoc_to = "$target_gen_dir/charlie.doc.zip" |
| } |
| rustc_macro("march") { |
| edition = 2021 |
| define_rustdoc_test_override = true |
| name = "march" |
| deps = [ ":charlie" ] |
| public_deps = [ ":charlie.rustdoc" ] |
| testonly = true |
| source_root = "../src/march.rs" |
| sources = [ "../src/march.rs" ] |
| quiet_clippy = true |
| rustdoc_out_dir = "$target_gen_dir/march.doc" |
| rustdoc_args = [ "--enable-index-page" ] |
| zip_rustdoc_to = "$target_gen_dir/march.doc.zip" |
| } |
| rustc_library("november") { |
| edition = 2021 |
| define_rustdoc_test_override = true |
| name = "november" |
| deps = [ ":march" ] |
| public_deps = [ ":march_proc_macro.rustdoc" ] |
| testonly = true |
| source_root = "../src/november.rs" |
| sources = [ "../src/november.rs" ] |
| quiet_clippy = true |
| rustdoc_out_dir = "$target_gen_dir/doc" |
| rustdoc_args = [ "--enable-index-page" ] |
| zip_rustdoc_to = "$target_gen_dir/november.doc.zip" |
| } |