From eea78f615c1319a7d0373792a962b2b49fe2a6d5 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 30 Nov 2020 19:48:44 -0500 Subject: [PATCH] Move src/inet/tests to auto-test-driver generation (#3997) --- src/inet/tests/BUILD.gn | 23 +++++---------- src/inet/tests/TestInetAddress.cpp | 2 -- src/inet/tests/TestInetAddressDriver.cpp | 36 ----------------------- src/inet/tests/TestInetEndPoint.cpp | 2 -- src/inet/tests/TestInetEndPointDriver.cpp | 36 ----------------------- src/inet/tests/TestInetErrorStr.cpp | 2 -- src/inet/tests/TestInetErrorStrDriver.cpp | 36 ----------------------- src/inet/tests/TestInetLayerDNS.cpp | 2 -- src/inet/tests/TestInetLayerDNSDriver.cpp | 36 ----------------------- 9 files changed, 8 insertions(+), 167 deletions(-) delete mode 100644 src/inet/tests/TestInetAddressDriver.cpp delete mode 100644 src/inet/tests/TestInetEndPointDriver.cpp delete mode 100644 src/inet/tests/TestInetErrorStrDriver.cpp delete mode 100644 src/inet/tests/TestInetLayerDNSDriver.cpp diff --git a/src/inet/tests/BUILD.gn b/src/inet/tests/BUILD.gn index 50715814435dd8..bd03d13936fd83 100644 --- a/src/inet/tests/BUILD.gn +++ b/src/inet/tests/BUILD.gn @@ -27,16 +27,18 @@ config("tests_config") { chip_test_suite("tests") { output_name = "libInetLayerTests" - sources = [ + test_sources = [ "TestInetAddress.cpp", + "TestInetEndPoint.cpp", + "TestInetErrorStr.cpp", + ] + + sources = [ "TestInetCommon.cpp", "TestInetCommon.h", "TestInetCommonOptions.cpp", "TestInetCommonOptions.h", - "TestInetEndPoint.cpp", - "TestInetErrorStr.cpp", "TestInetLayer.cpp", - "TestInetLayer.h", "TestInetLayerCommon.cpp", ] @@ -55,21 +57,12 @@ chip_test_suite("tests") { "${nlunit_test_root}:nlunit-test", ] - tests = [ - "TestInetAddress", - "TestInetErrorStr", - "TestInetEndPoint", - ] - # This fails on Raspberry Pi (Linux arm64), so only enable on Linux # x64. if (current_os != "mac" && chip_device_platform != "esp32" && current_cpu == "x64") { - sources += [ - "TestInetLayerDNS.cpp", - "TestLwIPDNS.cpp", - ] - tests += [ "TestInetLayerDNS" ] + test_sources += [ "TestInetLayerDNS.cpp" ] + sources += [ "TestLwIPDNS.cpp" ] } } diff --git a/src/inet/tests/TestInetAddress.cpp b/src/inet/tests/TestInetAddress.cpp index 5147c09886073a..5e82290cbcc53e 100644 --- a/src/inet/tests/TestInetAddress.cpp +++ b/src/inet/tests/TestInetAddress.cpp @@ -24,8 +24,6 @@ * */ -#include "TestInetLayer.h" - #include #include diff --git a/src/inet/tests/TestInetAddressDriver.cpp b/src/inet/tests/TestInetAddressDriver.cpp deleted file mode 100644 index 5ad4ebbf9db80c..00000000000000 --- a/src/inet/tests/TestInetAddressDriver.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This file implements a standalone/native program executable - * test driver for the CHIP Internet (inet) library address unit - * tests. - * - */ - -#include "TestInetLayer.h" - -#include - -int main() -{ - // Generate machine-readable, comma-separated value (CSV) output. - nlTestSetOutputStyle(OUTPUT_CSV); - - return (TestInetAddress()); -} diff --git a/src/inet/tests/TestInetEndPoint.cpp b/src/inet/tests/TestInetEndPoint.cpp index 0ed4b2a2ecc705..d184c13c738966 100644 --- a/src/inet/tests/TestInetEndPoint.cpp +++ b/src/inet/tests/TestInetEndPoint.cpp @@ -28,8 +28,6 @@ #define __STDC_LIMIT_MACROS #endif -#include "TestInetLayer.h" - #include #include #include diff --git a/src/inet/tests/TestInetEndPointDriver.cpp b/src/inet/tests/TestInetEndPointDriver.cpp deleted file mode 100644 index 8df6c13be8bd63..00000000000000 --- a/src/inet/tests/TestInetEndPointDriver.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This file implements a standalone/native program executable - * test driver for the CHIP Internet (inet) library address unit - * tests. - * - */ - -#include "TestInetLayer.h" - -#include - -int main() -{ - // Generate machine-readable, comma-separated value (CSV) output. - nlTestSetOutputStyle(OUTPUT_CSV); - - return (TestInetEndPoint()); -} diff --git a/src/inet/tests/TestInetErrorStr.cpp b/src/inet/tests/TestInetErrorStr.cpp index 43c4959a3a57a5..528cecd5dd37a0 100644 --- a/src/inet/tests/TestInetErrorStr.cpp +++ b/src/inet/tests/TestInetErrorStr.cpp @@ -32,8 +32,6 @@ #define __STDC_LIMIT_MACROS #endif -#include "TestInetLayer.h" - #include #include #include diff --git a/src/inet/tests/TestInetErrorStrDriver.cpp b/src/inet/tests/TestInetErrorStrDriver.cpp deleted file mode 100644 index 479e07863182b1..00000000000000 --- a/src/inet/tests/TestInetErrorStrDriver.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This file implements a standalone/native program executable - * test driver for the CHIP Internet (inet) library error string - * library unit tests. - * - */ - -#include "TestInetLayer.h" - -#include - -int main() -{ - // Generate machine-readable, comma-separated value (CSV) output. - nlTestSetOutputStyle(OUTPUT_CSV); - - return (TestInetErrorStr()); -} diff --git a/src/inet/tests/TestInetLayerDNS.cpp b/src/inet/tests/TestInetLayerDNS.cpp index 75bce03baab560..5df0e464fe05c8 100644 --- a/src/inet/tests/TestInetLayerDNS.cpp +++ b/src/inet/tests/TestInetLayerDNS.cpp @@ -27,8 +27,6 @@ #define __STDC_LIMIT_MACROS #endif -#include "TestInetLayer.h" - #include #include #include diff --git a/src/inet/tests/TestInetLayerDNSDriver.cpp b/src/inet/tests/TestInetLayerDNSDriver.cpp deleted file mode 100644 index 94a4e50a28c1ca..00000000000000 --- a/src/inet/tests/TestInetLayerDNSDriver.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This file implements a standalone/native program executable - * test driver for the CHIP Internet (inet) library address unit - * tests. - * - */ - -#include "TestInetLayer.h" - -#include - -int main() -{ - // Generate machine-readable, comma-separated value (CSV) output. - nlTestSetOutputStyle(OUTPUT_CSV); - - return (TestInetLayerDNS()); -}