• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13import("//build/ohos_var.gni")
14import("//test/xts/tools/build/suite.gni")
15
16group("toolchain") {
17  if (is_opensource == true) {
18    testonly = true
19    deps = [ "//third_party/musl:libctest" ]
20    if (is_standard_system) {
21      deps += [ ":tar_dllib" ]
22    }
23  }
24}
25
26action("tar_testcases") {
27  testonly = true
28  deps = [
29    "libc-test:ActsToolChainTest",
30    "//third_party/musl:libctest",
31  ]
32  project_dir = rebase_path(".")
33  print("project_dir-58:", project_dir)
34  project_dird = rebase_path("tar_files.py", ".", root_out_dir)
35  print("project_dird-60:", project_dird)
36
37  project_dirf = project_dir + "/" + project_dird
38  print("project_dirf-64:", project_dirf)
39
40  test_path = string_replace(project_dirf, "/tar_files.py", "")
41  script = rebase_path(
42          "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py")
43
44  _outputs = [ "$target_out_dir/libc-test.tar" ]
45  outputs = _outputs
46
47  input_path = rebase_path("$test_path/musl/libc-test")
48  output_path = rebase_path("$test_path/suites/acts/testcases/libc-test.tar")
49
50  print("root_build_dir-49", root_build_dir)
51  args = [
52    "--input_path",
53    input_path,
54    "--output_path",
55    output_path,
56    "--temp_path",
57    "./libc-test",
58  ]
59}
60
61action("tar_dllib") {
62  testonly = true
63  deps = [ ":tar_testcases" ]
64  project_dir = rebase_path(".")
65  print("project_dir-58:", project_dir)
66  project_dird = rebase_path("tar_files.py", ".", root_out_dir)
67  print("project_dird-60:", project_dird)
68
69  project_dirf = project_dir + "/" + project_dird
70  print("project_dirf-64:", project_dirf)
71
72  dllib_path = string_replace(project_dirf, "/tar_files.py", "")
73  script = rebase_path(
74          "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py")
75
76  if (target_cpu == "arm") {
77    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
78    outputs = _outputs
79
80    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
81    output_path =
82        rebase_path("$dllib_path/suites/acts/testcases/libc-test-lib.tar")
83
84    print("root_build_dir-49", root_build_dir)
85    args = [
86      "--input_path",
87      input_path,
88      "--output_path",
89      output_path,
90      "--temp_path",
91      "./libc-test-lib",
92    ]
93  } else if (target_cpu == "arm64") {
94    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
95    outputs = _outputs
96
97    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
98    output_path =
99        rebase_path("$dllib_path/suites/acts/testcases/libc-test-lib.tar")
100    print("root_build_dir-49", root_build_dir)
101    args = [
102      "--input_path",
103      input_path,
104      "--output_path",
105      output_path,
106      "--temp_path",
107      "./libc-test-lib",
108    ]
109  } else {
110    _outputs = [ "" ]
111    outputs = _outputs
112
113    input_path = rebase_path("")
114    output_path = rebase_path("")
115    print("root_build_dir-49", root_build_dir)
116    args = [
117      "--input_path",
118      input_path,
119      "--output_path",
120      output_path,
121      "--temp_path",
122      "./libc-test-lib",
123    ]
124  }
125}
126