BUILD.gn 3.5 KB
Newer Older
F
FondMemoryVVV 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos_var.gni")
import("//test/xts/tools/build/suite.gni")

group("toolchain") {
17 18 19
  if (!(product_name == "m40")) {
    testonly = true
    deps = [ "//third_party/musl:libctest" ]
F
FondMemoryVVV 已提交
20 21 22
    if (is_standard_system) {
      deps += [ ":tar_dllib" ]
    }
F
FondMemoryVVV 已提交
23 24 25 26 27 28
  }
}

action("tar_testcases") {
  testonly = true
  deps = [
29
    "libc-test:ActsToolChainTest",
F
FondMemoryVVV 已提交
30 31 32 33 34 35 36 37 38 39 40
    "//third_party/musl:libctest",
  ]
  project_dir = rebase_path(".")
  print("project_dir-58:", project_dir)
  project_dird = rebase_path("tar_files.py", ".", root_out_dir)
  print("project_dird-60:", project_dird)

  project_dirf = project_dir + "/" + project_dird
  print("project_dirf-64:", project_dirf)

  test_path = string_replace(project_dirf, "/tar_files.py", "")
F
FondMemoryVVV 已提交
41 42
  script = rebase_path(
          "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py")
F
FondMemoryVVV 已提交
43 44 45 46

  _outputs = [ "$target_out_dir/libc-test.tar" ]
  outputs = _outputs

47
  input_path = rebase_path("$test_path/musl/libc-test")
F
FondMemoryVVV 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  output_path = rebase_path("$test_path/suites/acts/testcases/libc-test.tar")

  print("root_build_dir-49", root_build_dir)
  args = [
    "--input_path",
    input_path,
    "--output_path",
    output_path,
    "--temp_path",
    "./libc-test",
  ]
}

action("tar_dllib") {
  testonly = true
  deps = [ ":tar_testcases" ]
  project_dir = rebase_path(".")
  print("project_dir-58:", project_dir)
  project_dird = rebase_path("tar_files.py", ".", root_out_dir)
  print("project_dird-60:", project_dird)

  project_dirf = project_dir + "/" + project_dird
  print("project_dirf-64:", project_dirf)

  dllib_path = string_replace(project_dirf, "/tar_files.py", "")
F
FondMemoryVVV 已提交
73 74
  script = rebase_path(
          "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py")
F
FondMemoryVVV 已提交
75

F
FondMemoryVVV 已提交
76 77 78
  if (target_cpu == "arm") {
    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
    outputs = _outputs
F
FondMemoryVVV 已提交
79

F
FondMemoryVVV 已提交
80 81 82
    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
    output_path =
        rebase_path("$dllib_path/suites/acts/testcases/libc-test-lib.tar")
F
FondMemoryVVV 已提交
83

F
FondMemoryVVV 已提交
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
    print("root_build_dir-49", root_build_dir)
    args = [
      "--input_path",
      input_path,
      "--output_path",
      output_path,
      "--temp_path",
      "./libc-test-lib",
    ]
  } else if (target_cpu == "arm64") {
    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
    outputs = _outputs

    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
    output_path =
        rebase_path("$dllib_path/suites/acts/testcases/libc-test-lib.tar")
    print("root_build_dir-49", root_build_dir)
    args = [
      "--input_path",
      input_path,
      "--output_path",
      output_path,
      "--temp_path",
      "./libc-test-lib",
    ]
  } else {
    _outputs = [ "" ]
    outputs = _outputs

    input_path = rebase_path("")
    output_path = rebase_path("")
    print("root_build_dir-49", root_build_dir)
    args = [
      "--input_path",
      input_path,
      "--output_path",
      output_path,
      "--temp_path",
      "./libc-test-lib",
    ]
  }
F
FondMemoryVVV 已提交
125
}