14
14
15
15
import (" //build_overrides/build.gni" )
16
16
import (" //build_overrides/chip.gni" )
17
+ import (" //build_overrides/nlfaultinjection.gni" )
17
18
import (" //build_overrides/pigweed.gni" )
18
19
19
- import (" ${ chip_root } /build/chip/chip_test_suite.gni" )
20
20
import (" ${ chip_root } /build/chip/tests.gni" )
21
+ import (" ${ chip_root } /build/chip/tools.gni" )
21
22
import (" ${ chip_root } /src/platform/device.gni" )
22
23
import (" ${ chip_root } /src/system/system.gni" )
23
24
25
+ if (chip_build_tests ) {
26
+ import (" ${ chip_root } /build/chip/chip_test_suite.gni" )
27
+ }
28
+
24
29
config (" tests_config" ) {
25
30
include_dirs = [ " ." ]
26
31
}
@@ -40,55 +45,61 @@ static_library("helpers") {
40
45
" TestSetupSignallingPosix.cpp" ,
41
46
]
42
47
43
- if (current_os != " mbed" ) {
44
- sources += [ " TestInetLayer.cpp" ]
45
- }
48
+ cflags = [ " -Wconversion" ]
49
+
50
+ public_deps = [
51
+ " ${ chip_root } /src/inet" ,
52
+ " ${ chip_root } /src/lib/core" ,
53
+ " ${ chip_root } /src/platform" ,
54
+ " ${ nlfaultinjection_root } :nlfaultinjection" ,
55
+ ]
46
56
47
57
if (chip_with_nlfaultinjection ) {
48
58
sources += [
49
59
" TestSetupFaultInjection.h" ,
50
60
" TestSetupFaultInjectionPosix.cpp" ,
51
61
]
62
+ public_deps += [ " ${ nlfaultinjection_root } :nlfaultinjection" ]
52
63
}
64
+ }
53
65
54
- cflags = [ " -Wconversion" ]
66
+ if (chip_build_tests ) {
67
+ chip_test_suite (" tests" ) {
68
+ output_name = " libInetLayerTests"
55
69
56
- public_deps = [
57
- " ${ chip_root } /src/inet" ,
58
- " ${ chip_root } /src/lib/core" ,
59
- " ${ chip_root } /src/platform" ,
60
- ]
70
+ public_configs = [ " :tests_config" ]
71
+
72
+ public_deps = [
73
+ " :helpers" ,
74
+ " ${ chip_root } /src/inet" ,
75
+ " ${ chip_root } /src/lib/core" ,
76
+ ]
77
+ test_sources = [
78
+ " TestBasicPacketFilters.cpp" ,
79
+ " TestInetAddress.cpp" ,
80
+ " TestInetErrorStr.cpp" ,
81
+ ]
82
+ sources = []
83
+
84
+ if (chip_system_config_use_sockets && current_os != " zephyr" ) {
85
+ test_sources += [ " TestInetEndPoint.cpp" ]
86
+ }
87
+
88
+ cflags = [ " -Wconversion" ]
89
+ }
61
90
}
62
91
63
- chip_test_suite ( " tests " ) {
64
- output_name = " libInetLayerTests "
92
+ executable ( " inet-layer-test-tool " ) {
93
+ sources = [ " inet-layer-test-tool.cpp " ]
65
94
66
- public_configs = [ " :tests_config " ]
95
+ cflags = [ " -Wconversion " ]
67
96
68
97
public_deps = [
69
98
" :helpers" ,
70
99
" ${ chip_root } /src/inet" ,
71
100
" ${ chip_root } /src/lib/core" ,
101
+ " ${ chip_root } /src/platform" ,
72
102
]
73
- test_sources = [
74
- " TestBasicPacketFilters.cpp" ,
75
- " TestInetAddress.cpp" ,
76
- " TestInetErrorStr.cpp" ,
77
- ]
78
- sources = []
79
-
80
- if (chip_system_config_use_sockets && current_os != " zephyr" ) {
81
- test_sources += [ " TestInetEndPoint.cpp" ]
82
- }
83
103
84
- # This fails on Raspberry Pi (Linux arm64), so only enable on Linux
85
- # x64.
86
- if (current_os != " mac" && current_os != " zephyr" &&
87
- chip_device_platform != " esp32" && current_cpu == " x64" &&
88
- chip_device_platform != " ameba" ) {
89
- # TODO: This test does not seem executed
90
- sources += [ " TestLwIPDNS.cpp" ]
91
- }
92
-
93
- cflags = [ " -Wconversion" ]
104
+ output_dir = root_out_dir
94
105
}
0 commit comments