Skip to content

Commit c0d6d03

Browse files
committed
allowing chip_with_nlfaultinjection for chip_build_tools
1 parent d8cd5dc commit c0d6d03

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

build/chip/tests.gni

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717

18+
import("${chip_root}/build/chip/tools.gni")
1819
import("${chip_root}/src/platform/device.gni")
1920

2021
declare_args() {
@@ -40,6 +41,6 @@ declare_args() {
4041
}
4142

4243
declare_args() {
43-
# Enable use of nlfaultinjection.
44-
chip_with_nlfaultinjection = chip_build_tests
44+
# Enable use of nlfaultinjection when building tests or when building tools.
45+
chip_with_nlfaultinjection = chip_build_tests || chip_build_tools
4546
}

src/inet/tests/BUILD.gn

100644100755
-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static_library("helpers") {
5151
"${chip_root}/src/inet",
5252
"${chip_root}/src/lib/core",
5353
"${chip_root}/src/platform",
54-
"${nlfaultinjection_root}:nlfaultinjection",
5554
]
5655

5756
if (chip_with_nlfaultinjection) {

src/inet/tests/TestInetCommonOptions.cpp

100644100755
-6
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,18 @@ bool NetworkOptions::HandleOption(const char * progName, OptionSet * optSet, int
199199
FaultInjectionOptions::FaultInjectionOptions()
200200
{
201201
static OptionDef optionDefs[] = {
202-
#if CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
203202
{ "faults", kArgumentRequired, kToolCommonOpt_FaultInjection },
204203
{ "iterations", kArgumentRequired, kToolCommonOpt_FaultTestIterations },
205204
{ "debug-resource-usage", kNoArgument, kToolCommonOpt_DebugResourceUsage },
206205
{ "print-fault-counters", kNoArgument, kToolCommonOpt_PrintFaultCounters },
207206
{ "extra-cleanup-time", kArgumentRequired, kToolCommonOpt_ExtraCleanupTime },
208-
#endif
209207
{}
210208
};
211209
OptionDefs = optionDefs;
212210

213211
HelpGroupName = "FAULT INJECTION OPTIONS";
214212

215213
OptionHelp =
216-
#if CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
217214
" --faults <fault-string>\n"
218215
" Inject specified fault(s) into the operation of the tool at runtime.\n"
219216
"\n"
@@ -233,7 +230,6 @@ FaultInjectionOptions::FaultInjectionOptions()
233230
" should fail a normal happy-sequence test, but not necessarily a fault-injection test.\n"
234231
" The value is in milliseconds; a common value is 10000.\n"
235232
"\n"
236-
#endif
237233
"";
238234

239235
// Defaults
@@ -253,7 +249,6 @@ bool FaultInjectionOptions::HandleOption(const char * progName, OptionSet * optS
253249

254250
switch (id)
255251
{
256-
#if CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
257252
case kToolCommonOpt_FaultInjection: {
258253
chip::Platform::ScopedMemoryString mutableArg(arg, strlen(arg));
259254
assert(mutableArg);
@@ -285,7 +280,6 @@ bool FaultInjectionOptions::HandleOption(const char * progName, OptionSet * optS
285280
return false;
286281
}
287282
break;
288-
#endif // CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
289283
default:
290284
PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", progName, name);
291285
return false;

0 commit comments

Comments
 (0)