Remove dependency between chip-tool and the nlunit-test (#31234)
* Remove dependency between chip-tool and tests
* Remove static lib complete
* Replace source_set to static_library
diff --git a/examples/placeholder/linux/BUILD.gn b/examples/placeholder/linux/BUILD.gn
index a983cdc..0752f7e 100644
--- a/examples/placeholder/linux/BUILD.gn
+++ b/examples/placeholder/linux/BUILD.gn
@@ -44,8 +44,7 @@
"${chip_root}/src/app/tests/suites/credentials:dac_provider",
"${chip_root}/src/app/tests/suites/pics",
"${chip_root}/src/lib",
- "${chip_root}/src/lib/support:testing", # For sleepMillis. TODO: this is
- # odd and should be fixed
+ "${chip_root}/src/lib/support:test_utils",
"${chip_root}/src/platform/logging:headers",
"${chip_root}/third_party/jsoncpp",
]
diff --git a/src/access/tests/BUILD.gn b/src/access/tests/BUILD.gn
index 371b754..4619488 100644
--- a/src/access/tests/BUILD.gn
+++ b/src/access/tests/BUILD.gn
@@ -27,7 +27,8 @@
public_deps = [
"${chip_root}/src/access",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn
index 8bfb3fb..1c48851 100644
--- a/src/app/tests/BUILD.gn
+++ b/src/app/tests/BUILD.gn
@@ -206,7 +206,8 @@
"${chip_root}/src/app/tests:helpers",
"${chip_root}/src/app/util/mock:mock_ember",
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/app/tests/suites/commands/interaction_model/BUILD.gn b/src/app/tests/suites/commands/interaction_model/BUILD.gn
index ecefa4a..5f8512d 100644
--- a/src/app/tests/suites/commands/interaction_model/BUILD.gn
+++ b/src/app/tests/suites/commands/interaction_model/BUILD.gn
@@ -28,6 +28,6 @@
public_deps = [
"${chip_root}/src/app",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
]
}
diff --git a/src/app/util/mock/BUILD.gn b/src/app/util/mock/BUILD.gn
index 94e1a30..5918318 100644
--- a/src/app/util/mock/BUILD.gn
+++ b/src/app/util/mock/BUILD.gn
@@ -28,7 +28,7 @@
"${chip_root}/src/app",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
]
public_configs = [ ":mock_include" ]
diff --git a/src/ble/tests/BUILD.gn b/src/ble/tests/BUILD.gn
index f8230f3..a0af13b 100644
--- a/src/ble/tests/BUILD.gn
+++ b/src/ble/tests/BUILD.gn
@@ -30,7 +30,7 @@
public_deps = [
"${chip_root}/src/ble",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/controller/tests/BUILD.gn b/src/controller/tests/BUILD.gn
index d7b212d..1d93c12 100644
--- a/src/controller/tests/BUILD.gn
+++ b/src/controller/tests/BUILD.gn
@@ -39,7 +39,8 @@
"${chip_root}/src/app/common:cluster-objects",
"${chip_root}/src/app/tests:helpers",
"${chip_root}/src/controller",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/messaging/tests:helpers",
"${chip_root}/src/transport/raw/tests:helpers",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/controller/tests/data_model/BUILD.gn b/src/controller/tests/data_model/BUILD.gn
index 9692bd7..3c04f00 100644
--- a/src/controller/tests/data_model/BUILD.gn
+++ b/src/controller/tests/data_model/BUILD.gn
@@ -34,7 +34,7 @@
"${chip_root}/src/app/common:cluster-objects",
"${chip_root}/src/app/tests:helpers",
"${chip_root}/src/app/util/mock:mock_ember",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/messaging/tests:helpers",
"${chip_root}/src/transport/raw/tests:helpers",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/credentials/tests/BUILD.gn b/src/credentials/tests/BUILD.gn
index 81a8760..101abc3 100644
--- a/src/credentials/tests/BUILD.gn
+++ b/src/credentials/tests/BUILD.gn
@@ -70,7 +70,7 @@
"${chip_root}/src/credentials",
"${chip_root}/src/credentials:default_attestation_verifier",
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/crypto/tests/BUILD.gn b/src/crypto/tests/BUILD.gn
index 45024d8..e8ce422 100644
--- a/src/crypto/tests/BUILD.gn
+++ b/src/crypto/tests/BUILD.gn
@@ -69,7 +69,7 @@
"${chip_root}/src/credentials/tests:cert_test_vectors",
"${chip_root}/src/crypto",
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/inet/tests/BUILD.gn b/src/inet/tests/BUILD.gn
index 1a167d7..b5e916a 100644
--- a/src/inet/tests/BUILD.gn
+++ b/src/inet/tests/BUILD.gn
@@ -68,7 +68,7 @@
":helpers",
"${chip_root}/src/inet",
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/lib/address_resolve/tests/BUILD.gn b/src/lib/address_resolve/tests/BUILD.gn
index 5779e92..e82e6db 100644
--- a/src/lib/address_resolve/tests/BUILD.gn
+++ b/src/lib/address_resolve/tests/BUILD.gn
@@ -29,7 +29,7 @@
public_deps = [
"${chip_root}/src/lib/address_resolve",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/lib/asn1/tests/BUILD.gn b/src/lib/asn1/tests/BUILD.gn
index 1d05ecc..3439eed 100644
--- a/src/lib/asn1/tests/BUILD.gn
+++ b/src/lib/asn1/tests/BUILD.gn
@@ -26,7 +26,7 @@
public_deps = [
"${chip_root}/src/lib/asn1",
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/lib/core/tests/BUILD.gn b/src/lib/core/tests/BUILD.gn
index d7f81ea..e7fbba2 100644
--- a/src/lib/core/tests/BUILD.gn
+++ b/src/lib/core/tests/BUILD.gn
@@ -36,7 +36,8 @@
public_deps = [
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn b/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn
index d811a8f..ce985ff 100644
--- a/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn
+++ b/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn
@@ -43,7 +43,7 @@
":support",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/dnssd/minimal_mdns/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/lib/dnssd/minimal_mdns/records/tests/BUILD.gn b/src/lib/dnssd/minimal_mdns/records/tests/BUILD.gn
index 71cf0f0..0e1cfc1 100644
--- a/src/lib/dnssd/minimal_mdns/records/tests/BUILD.gn
+++ b/src/lib/dnssd/minimal_mdns/records/tests/BUILD.gn
@@ -34,7 +34,7 @@
public_deps = [
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/dnssd/minimal_mdns/records",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/lib/dnssd/minimal_mdns/responders/tests/BUILD.gn b/src/lib/dnssd/minimal_mdns/responders/tests/BUILD.gn
index f0205b1..c09fcbb 100644
--- a/src/lib/dnssd/minimal_mdns/responders/tests/BUILD.gn
+++ b/src/lib/dnssd/minimal_mdns/responders/tests/BUILD.gn
@@ -34,7 +34,7 @@
"${chip_root}/src/lib/dnssd/minimal_mdns",
"${chip_root}/src/lib/dnssd/minimal_mdns:default_policy",
"${chip_root}/src/lib/dnssd/minimal_mdns/responders",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/lib/dnssd/minimal_mdns/tests/BUILD.gn b/src/lib/dnssd/minimal_mdns/tests/BUILD.gn
index 0d625ea..bea28e8 100644
--- a/src/lib/dnssd/minimal_mdns/tests/BUILD.gn
+++ b/src/lib/dnssd/minimal_mdns/tests/BUILD.gn
@@ -38,7 +38,7 @@
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/dnssd",
"${chip_root}/src/lib/dnssd/minimal_mdns",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/transport/raw/tests:helpers",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/lib/dnssd/platform/tests/BUILD.gn b/src/lib/dnssd/platform/tests/BUILD.gn
index 6166a05..92b8319 100644
--- a/src/lib/dnssd/platform/tests/BUILD.gn
+++ b/src/lib/dnssd/platform/tests/BUILD.gn
@@ -25,7 +25,7 @@
public_deps = [
"${chip_root}/src/lib/dnssd",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/lib/dnssd/tests/BUILD.gn b/src/lib/dnssd/tests/BUILD.gn
index 9c7c071..e64d0c7 100644
--- a/src/lib/dnssd/tests/BUILD.gn
+++ b/src/lib/dnssd/tests/BUILD.gn
@@ -28,7 +28,7 @@
public_deps = [
"${chip_root}/src/lib/dnssd",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/lib/format/tests/BUILD.gn b/src/lib/format/tests/BUILD.gn
index 4fdf1d2..64be2e3 100644
--- a/src/lib/format/tests/BUILD.gn
+++ b/src/lib/format/tests/BUILD.gn
@@ -40,7 +40,7 @@
"${chip_root}/src/lib/format:flat-tree",
"${chip_root}/src/lib/format:protocol-decoder",
"${chip_root}/src/lib/format:protocol-tlv-metadata",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/lib/shell/tests/BUILD.gn b/src/lib/shell/tests/BUILD.gn
index 62e062b..12c15d8 100644
--- a/src/lib/shell/tests/BUILD.gn
+++ b/src/lib/shell/tests/BUILD.gn
@@ -31,7 +31,7 @@
public_deps = [
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/shell",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
]
}
diff --git a/src/lib/support/BUILD.gn b/src/lib/support/BUILD.gn
index fde92cc..861cd28 100644
--- a/src/lib/support/BUILD.gn
+++ b/src/lib/support/BUILD.gn
@@ -297,7 +297,18 @@
}
}
-static_library("testing") {
+static_library("test_utils") {
+ output_name = "libTestUtils"
+ output_dir = "${root_out_dir}/lib"
+ deps = [ "${chip_root}/src/platform" ]
+
+ sources = [
+ "UnitTestUtils.cpp",
+ "UnitTestUtils.h",
+ ]
+}
+
+static_library("testing_nlunit") {
output_name = "libSupportTesting"
output_dir = "${root_out_dir}/lib"
@@ -305,8 +316,6 @@
"UnitTestExtendedAssertions.h",
"UnitTestRegistration.cpp",
"UnitTestRegistration.h",
- "UnitTestUtils.cpp",
- "UnitTestUtils.h",
]
public_deps = [
diff --git a/src/lib/support/tests/BUILD.gn b/src/lib/support/tests/BUILD.gn
index 1fd19e8..ca647b3 100644
--- a/src/lib/support/tests/BUILD.gn
+++ b/src/lib/support/tests/BUILD.gn
@@ -78,7 +78,7 @@
public_deps = [
"${chip_root}/src/credentials",
"${chip_root}/src/lib/core",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/lib/support/jsontlv",
"${chip_root}/src/platform",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/messaging/tests/BUILD.gn b/src/messaging/tests/BUILD.gn
index 9b9e9f4..db09de5 100644
--- a/src/messaging/tests/BUILD.gn
+++ b/src/messaging/tests/BUILD.gn
@@ -72,7 +72,8 @@
"${chip_root}/src/inet/tests:helpers",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/messaging",
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
diff --git a/src/platform/tests/BUILD.gn b/src/platform/tests/BUILD.gn
index d5b4ebf..2a0d345 100644
--- a/src/platform/tests/BUILD.gn
+++ b/src/platform/tests/BUILD.gn
@@ -40,7 +40,8 @@
public_deps = [
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${chip_root}/src/system",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/protocols/bdx/tests/BUILD.gn b/src/protocols/bdx/tests/BUILD.gn
index 25ef3e1..7a518a3 100644
--- a/src/protocols/bdx/tests/BUILD.gn
+++ b/src/protocols/bdx/tests/BUILD.gn
@@ -31,7 +31,7 @@
public_deps = [
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols/bdx",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/protocols/interaction_model/tests/BUILD.gn b/src/protocols/interaction_model/tests/BUILD.gn
index 1679200..0abd3a7 100644
--- a/src/protocols/interaction_model/tests/BUILD.gn
+++ b/src/protocols/interaction_model/tests/BUILD.gn
@@ -26,7 +26,7 @@
public_deps = [
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols/interaction_model",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/protocols/secure_channel/tests/BUILD.gn b/src/protocols/secure_channel/tests/BUILD.gn
index 23ed6f9..de3984a 100644
--- a/src/protocols/secure_channel/tests/BUILD.gn
+++ b/src/protocols/secure_channel/tests/BUILD.gn
@@ -29,7 +29,8 @@
"${chip_root}/src/crypto/tests:tests.lib",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/messaging/tests:helpers",
"${chip_root}/src/protocols",
"${chip_root}/src/protocols/secure_channel",
diff --git a/src/protocols/user_directed_commissioning/tests/BUILD.gn b/src/protocols/user_directed_commissioning/tests/BUILD.gn
index 555398c..dc33a2c 100644
--- a/src/protocols/user_directed_commissioning/tests/BUILD.gn
+++ b/src/protocols/user_directed_commissioning/tests/BUILD.gn
@@ -25,7 +25,7 @@
public_deps = [
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/setup_payload/tests/BUILD.gn b/src/setup_payload/tests/BUILD.gn
index 3069685..4ed7033 100644
--- a/src/setup_payload/tests/BUILD.gn
+++ b/src/setup_payload/tests/BUILD.gn
@@ -33,7 +33,7 @@
cflags = [ "-Wconversion" ]
public_deps = [
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${chip_root}/src/setup_payload",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/system/tests/BUILD.gn b/src/system/tests/BUILD.gn
index dca5d09..4e5e129 100644
--- a/src/system/tests/BUILD.gn
+++ b/src/system/tests/BUILD.gn
@@ -47,7 +47,7 @@
public_deps = [
"${chip_root}/src/inet",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${chip_root}/src/system",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn
index 2e80753..a63ef49 100644
--- a/src/test_driver/efr32/BUILD.gn
+++ b/src/test_driver/efr32/BUILD.gn
@@ -84,7 +84,7 @@
"${chip_root}/examples/common/pigweed:system_rpc_server",
"${chip_root}/src:tests",
"${chip_root}/src/lib",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${examples_common_plat_dir}/pw_sys_io:pw_sys_io_silabs",
"${nlunit_test_root}:nlunit-test",
]
diff --git a/src/test_driver/esp32/cmake/esp32_unit_tests.cmake b/src/test_driver/esp32/cmake/esp32_unit_tests.cmake
index 411e4fa..023ee7a 100644
--- a/src/test_driver/esp32/cmake/esp32_unit_tests.cmake
+++ b/src/test_driver/esp32/cmake/esp32_unit_tests.cmake
@@ -37,6 +37,7 @@
-Wl,--whole-archive ${UNIT_TEST_LIBRARY} -Wl,--no-whole-archive
${UNIT_TEST_EXTRA_LIBRARIES}
-lSupportTesting
+ -lTestUtils
nlunit-test
nlfaultinjection
)
diff --git a/src/tracing/tests/BUILD.gn b/src/tracing/tests/BUILD.gn
index dc2d3df..6f3ef63 100644
--- a/src/tracing/tests/BUILD.gn
+++ b/src/tracing/tests/BUILD.gn
@@ -27,7 +27,7 @@
sources = []
public_deps = [
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/platform",
"${chip_root}/src/tracing",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/transport/raw/tests/BUILD.gn b/src/transport/raw/tests/BUILD.gn
index f6089a7..1767b11 100644
--- a/src/transport/raw/tests/BUILD.gn
+++ b/src/transport/raw/tests/BUILD.gn
@@ -50,7 +50,8 @@
"${chip_root}/src/inet/tests:helpers",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:test_utils",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/transport",
"${chip_root}/src/transport/raw",
"${nlio_root}:nlio",
diff --git a/src/transport/retransmit/tests/BUILD.gn b/src/transport/retransmit/tests/BUILD.gn
index f261024..0b75a5b 100644
--- a/src/transport/retransmit/tests/BUILD.gn
+++ b/src/transport/retransmit/tests/BUILD.gn
@@ -30,7 +30,7 @@
]
public_deps = [
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/transport/retransmit",
"${nlio_root}:nlio",
"${nlunit_test_root}:nlunit-test",
diff --git a/src/transport/tests/BUILD.gn b/src/transport/tests/BUILD.gn
index 620049f..f982134 100644
--- a/src/transport/tests/BUILD.gn
+++ b/src/transport/tests/BUILD.gn
@@ -55,7 +55,7 @@
"${chip_root}/src/inet/tests:helpers",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
- "${chip_root}/src/lib/support:testing",
+ "${chip_root}/src/lib/support:testing_nlunit",
"${chip_root}/src/protocols",
"${chip_root}/src/transport",
"${chip_root}/src/transport/tests:helpers",