Skip to content

Commit d98fd60

Browse files
clean up unit tests inclusion
1 parent 052aa8d commit d98fd60

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

examples/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (chip_build_tests) {
2424

2525
chip_test_group("example_tests") {
2626
deps = []
27-
tests = [ "${chip_root}/examples/platform/silabs/tests" ]
27+
tests = []
2828

2929
if (chip_device_platform == "linux" && current_os == "linux") {
3030
tests += [ "${chip_root}/examples/energy-management-app/energy-management-common/tests" ]

examples/platform/silabs/test-event-trigger/SilabsTestEventTriggerDelegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
#pragma once
2020

21-
#include <ProvisionStorage.h>
2221
#include <app/TestEventTriggerDelegate.h>
2322
#include <lib/core/CHIPError.h>
2423
#include <lib/support/CodeUtils.h>
2524
#include <lib/support/Span.h>
25+
#include <platform/silabs/provision/ProvisionedDataProvider.h>
2626
#include <stdint.h>
2727

2828
namespace chip {

examples/platform/silabs/tests/BUILD.gn

+25-14
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,36 @@
1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717
import("//build_overrides/pigweed.gni")
18+
import("${chip_root}/build/chip/chip_test_group.gni")
1819
import("${chip_root}/build/chip/chip_test_suite.gni")
19-
config("unit-test-config") {
20-
defines = [ "OTA_ENCRYPTION_ENABLE=1" ]
20+
21+
declare_args() {
22+
# Build argument to enable Silabs specific unit tests
23+
sl_build_unit_tests = true
2124
}
2225

23-
chip_test_suite("tests") {
24-
output_name = "libSilabsExamplesPlatformTests"
26+
chip_test_group("silabs_example_platform_tests") {
27+
tests = []
28+
29+
if (sl_build_unit_tests) {
30+
tests += [ "${chip_root}/examples/platform/silabs/tests" ]
31+
}
32+
}
2533

26-
test_sources = [ "TestSilabsTestEventTrigger.cpp" ]
34+
if (sl_build_unit_tests) {
35+
chip_test_suite("silabs_example_tests") {
36+
output_name = "libSilabsExamplesPlatformTests"
2737

28-
public_configs = [ ":unit-test-config" ]
38+
test_sources = [ "TestSilabsTestEventTrigger.cpp" ]
2939

30-
public_deps = [
31-
"${chip_root}/examples/platform/silabs/test-event-trigger:sources",
32-
"${chip_root}/src/lib/core",
33-
"${chip_root}/src/lib/core:string-builder-adapters",
34-
"${chip_root}/src/lib/support",
35-
"${chip_root}/src/lib/support:testing",
36-
]
40+
public_deps = [
41+
"${chip_root}/examples/platform/silabs/test-event-trigger:sources",
42+
"${chip_root}/src/lib/core",
43+
"${chip_root}/src/lib/core:string-builder-adapters",
44+
"${chip_root}/src/lib/support",
45+
"${chip_root}/src/lib/support:testing",
46+
]
3747

38-
cflags = [ "-Wconversion" ]
48+
cflags = [ "-Wconversion" ]
49+
}
3950
}

0 commit comments

Comments
 (0)