• 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  testonly = true
18  deps = [ "//third_party/musl:libctest" ]
19  if (is_standard_system) {
20    deps += [ ":tar_dllib" ]
21  }
22}
23
24action("tar_testcases") {
25  testonly = true
26  deps = [
27    "libc-test:ActsToolChainTest",
28    "//third_party/musl:libctest",
29  ]
30  project_dir = rebase_path(".")
31  print("project_dir-58:", project_dir)
32  project_dird = rebase_path("tar_files.py", ".", root_out_dir)
33  print("project_dird-60:", project_dird)
34
35  project_dirf = project_dir + "/" + project_dird
36  print("project_dirf-64:", project_dirf)
37
38  test_path = string_replace(project_dirf, "/tar_files.py", "")
39  script = rebase_path(
40          "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py")
41
42  _outputs = [ "$target_out_dir/libc-test.tar" ]
43  outputs = _outputs
44
45  input_path = rebase_path("$test_path/musl/libc-test")
46  output_path =
47      rebase_path("$test_path/suites/acts/acts/testcases/libc-test.tar")
48
49  print("root_build_dir-49", root_build_dir)
50  args = [
51    "--input_path",
52    input_path,
53    "--output_path",
54    output_path,
55    "--temp_path",
56    "./libc-test",
57  ]
58}
59
60action("tar_dllib") {
61  testonly = true
62  deps = [ ":tar_testcases" ]
63  project_dir = rebase_path(".")
64  print("project_dir-58:", project_dir)
65  project_dird = rebase_path("tar_files.py", ".", root_out_dir)
66  print("project_dird-60:", project_dird)
67
68  project_dirf = project_dir + "/" + project_dird
69  print("project_dirf-64:", project_dirf)
70
71  dllib_path = string_replace(project_dirf, "/tar_files.py", "")
72  script = rebase_path(
73          "//test/xts/acts/commonlibrary/toolchain/libc-test/tar_files.py")
74
75  if (target_cpu == "arm") {
76    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
77    outputs = _outputs
78
79    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
80    output_path =
81        rebase_path("$dllib_path/suites/acts/acts/testcases/libc-test-lib.tar")
82
83    print("root_build_dir-49", root_build_dir)
84    args = [
85      "--input_path",
86      input_path,
87      "--output_path",
88      output_path,
89      "--temp_path",
90      "./libc-test-lib",
91    ]
92  } else if (target_cpu == "arm64") {
93    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
94    outputs = _outputs
95
96    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
97    output_path =
98        rebase_path("$dllib_path/suites/acts/acts/testcases/libc-test-lib.tar")
99    print("root_build_dir-49", root_build_dir)
100    args = [
101      "--input_path",
102      input_path,
103      "--output_path",
104      output_path,
105      "--temp_path",
106      "./libc-test-lib",
107    ]
108  } else if (target_cpu == "x86_64") {
109    _outputs = [ "$target_out_dir/libc-test-lib.tar" ]
110    outputs = _outputs
111
112    input_path = rebase_path("$dllib_path/musl/libc-test-lib")
113    output_path =
114        rebase_path("$dllib_path/suites/acts/acts/testcases/libc-test-lib.tar")
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  } else {
125    _outputs = [ "" ]
126    outputs = _outputs
127
128    input_path = rebase_path("")
129    output_path = rebase_path("")
130    print("root_build_dir-49", root_build_dir)
131    args = [
132      "--input_path",
133      input_path,
134      "--output_path",
135      output_path,
136      "--temp_path",
137      "./libc-test-lib",
138    ]
139  }
140}
141