xref: /aosp_15_r20/external/cronet/build/private_code_test/BUILD.gn (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2023 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/python.gni")
6import("//build_overrides/build.gni")
7import("private_code_test.gni")
8
9action("private_paths") {
10  script = "list_gclient_deps.py"
11  outputs = [ "$target_gen_dir/private_paths.txt" ]
12  args = [
13    "--source-filter",
14    "chrome-internal",
15    "--output",
16    rebase_path(outputs[0], root_build_dir),
17  ]
18  inputs = [ "//../.gclient_entries" ]
19}
20
21# --collect-inputs-only requires a source_set dep or !is_component_build.
22if (!is_component_build) {
23  action("private_code_test_gclient_deps") {
24    script = "list_gclient_deps.py"
25    outputs = [ "$target_gen_dir/test_private_paths.txt" ]
26    args = [
27      "--source-filter",
28      "v8.git",
29      "--output",
30      rebase_path(outputs[0], root_build_dir),
31    ]
32    inputs = [ "//../.gclient_entries" ]
33  }
34
35  shared_library("private_code_test_inputs") {
36    deps = [ "//v8" ]
37    ldflags = [ "--collect-inputs-only" ]
38  }
39
40  # Test that ensures the checker fails when it is supposed to.
41  private_code_test("private_code_failure_test") {
42    linker_inputs_dep = ":private_code_test_inputs"
43    private_paths_dep = ":private_code_test_gclient_deps"
44    private_paths_file = "$target_gen_dir/test_private_paths.txt"
45    expect_failure = true
46  }
47}
48