Skip to content

Commit

Permalink
allowing chip_with_nlfaultinjection for chip_build_tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Jun 19, 2024
1 parent d8cd5dc commit c0d6d03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 3 additions & 2 deletions build/chip/tests.gni
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

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

declare_args() {
Expand All @@ -40,6 +41,6 @@ declare_args() {
}

declare_args() {
# Enable use of nlfaultinjection.
chip_with_nlfaultinjection = chip_build_tests
# Enable use of nlfaultinjection when building tests or when building tools.
chip_with_nlfaultinjection = chip_build_tests || chip_build_tools
}
1 change: 0 additions & 1 deletion src/inet/tests/BUILD.gn
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static_library("helpers") {
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
"${chip_root}/src/platform",
"${nlfaultinjection_root}:nlfaultinjection",
]

if (chip_with_nlfaultinjection) {
Expand Down
6 changes: 0 additions & 6 deletions src/inet/tests/TestInetCommonOptions.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,18 @@ bool NetworkOptions::HandleOption(const char * progName, OptionSet * optSet, int
FaultInjectionOptions::FaultInjectionOptions()
{
static OptionDef optionDefs[] = {
#if CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
{ "faults", kArgumentRequired, kToolCommonOpt_FaultInjection },
{ "iterations", kArgumentRequired, kToolCommonOpt_FaultTestIterations },
{ "debug-resource-usage", kNoArgument, kToolCommonOpt_DebugResourceUsage },
{ "print-fault-counters", kNoArgument, kToolCommonOpt_PrintFaultCounters },
{ "extra-cleanup-time", kArgumentRequired, kToolCommonOpt_ExtraCleanupTime },
#endif
{}
};
OptionDefs = optionDefs;

HelpGroupName = "FAULT INJECTION OPTIONS";

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

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

switch (id)
{
#if CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
case kToolCommonOpt_FaultInjection: {
chip::Platform::ScopedMemoryString mutableArg(arg, strlen(arg));
assert(mutableArg);
Expand Down Expand Up @@ -285,7 +280,6 @@ bool FaultInjectionOptions::HandleOption(const char * progName, OptionSet * optS
return false;
}
break;
#endif // CHIP_CONFIG_TEST || CHIP_SYSTEM_CONFIG_TEST || INET_CONFIG_TEST
default:
PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", progName, name);
return false;
Expand Down

0 comments on commit c0d6d03

Please sign in to comment.