• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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.
13
14import("//build/test.gni")
15
16ohos_rust_unittest("rust_ylong_runtime_test_ut") {
17  module_out_path = "ylong_runtime/ylong_runtime"
18
19  rustflags = [
20    "--cfg=feature=\"fs\"",
21    "--cfg=feature=\"macros\"",
22    "--cfg=feature=\"net\"",
23    "--cfg=feature=\"sync\"",
24    "--cfg=feature=\"time\"",
25  ]
26
27  sources = [ "../ylong_runtime/src/lib.rs" ]
28  deps = [
29    "../ylong_io:ylong_io",
30    "../ylong_runtime_macros:ylong_runtime_macros(${host_toolchain})",
31    "../ylong_signal:ylong_signal",
32  ]
33
34  external_deps = [ "rust_libc:lib" ]
35}
36
37ohos_rust_systemtest("rust_ylong_runtime_test_sdv") {
38  module_out_path = "ylong_runtime/ylong_runtime"
39
40  rustflags = [
41    "--cfg=gn_test",
42    "--cfg=feature=\"fs\"",
43    "--cfg=feature=\"macros\"",
44    "--cfg=feature=\"net\"",
45    "--cfg=feature=\"sync\"",
46    "--cfg=feature=\"time\"",
47  ]
48
49  sources = [ "../ylong_runtime/tests/entry.rs" ]
50  deps = [ "../ylong_runtime:ylong_runtime" ]
51
52  external_deps = [ "rust_libc:lib" ]
53}
54
55ohos_rust_systemtest("rust_ylong_signal_test_sdv") {
56  module_out_path = "ylong_runtime/ylong_runtime"
57
58  rustflags = [ "--cfg=gn_test" ]
59
60  sources = [ "../ylong_signal/tests/entry.rs" ]
61  deps = [ "../ylong_signal:ylong_signal" ]
62
63  external_deps = [ "rust_libc:lib" ]
64}
65
66group("unittest") {
67  testonly = true
68  deps = []
69  if (!use_clang_coverage) {
70    deps += [ ":rust_ylong_runtime_test_ut" ]
71  }
72}
73
74group("sdvtest") {
75  testonly = true
76  deps = []
77  if (!use_clang_coverage) {
78    deps += [
79      ":rust_ylong_runtime_test_sdv",
80      ":rust_ylong_signal_test_sdv",
81    ]
82  }
83}
84