diff --git a/tests/unit/test_address_sanitizer.cpp b/tests/unit/test_address_sanitizer.cpp index 4e520dcbd..fd3985dc0 100644 --- a/tests/unit/test_address_sanitizer.cpp +++ b/tests/unit/test_address_sanitizer.cpp @@ -30,7 +30,6 @@ #include "test_util.h" -#ifdef ENABLE_TEST_MAIN int main(int argc, char *argv[]) { (void)argv; @@ -46,4 +45,3 @@ int main(int argc, char *argv[]) return 0; } -#endif diff --git a/tests/unit/test_aes.cpp b/tests/unit/test_aes.cpp index c42bc9dbc..61e856de5 100644 --- a/tests/unit/test_aes.cpp +++ b/tests/unit/test_aes.cpp @@ -134,7 +134,6 @@ void TestMacCommandFrame() VerifyOrQuit(memcmp(test, decrypted, sizeof(decrypted)) == 0, "TestMacCommandFrame decrypt failed\n"); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestMacBeaconFrame(); @@ -142,4 +141,3 @@ int main(void) printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_child.cpp b/tests/unit/test_child.cpp index f1dbdb154..06ac80194 100644 --- a/tests/unit/test_child.cpp +++ b/tests/unit/test_child.cpp @@ -258,11 +258,9 @@ void TestChildIp6Address(void) } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::TestChildIp6Address(); printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_child_table.cpp b/tests/unit/test_child_table.cpp index f33589eb2..7b670d72b 100644 --- a/tests/unit/test_child_table.cpp +++ b/tests/unit/test_child_table.cpp @@ -402,11 +402,9 @@ void TestChildTable(void) } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::TestChildTable(); printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_hdlc.cpp b/tests/unit/test_hdlc.cpp index c90a32648..a4785316d 100644 --- a/tests/unit/test_hdlc.cpp +++ b/tests/unit/test_hdlc.cpp @@ -571,7 +571,6 @@ void TestFuzzEncoderDecoder(void) } // namespace Ncp } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::Ncp::TestHdlcFrameBuffer(); @@ -581,4 +580,3 @@ int main(void) printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_heap.cpp b/tests/unit/test_heap.cpp index d329e6b22..ccb9cd1e9 100644 --- a/tests/unit/test_heap.cpp +++ b/tests/unit/test_heap.cpp @@ -172,11 +172,9 @@ void RunTimerTests(void) TestAllocateMultiple(); } -#ifdef ENABLE_TEST_MAIN int main(void) { RunTimerTests(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_hmac_sha256.cpp b/tests/unit/test_hmac_sha256.cpp index 65c02f4c9..fde654c41 100644 --- a/tests/unit/test_hmac_sha256.cpp +++ b/tests/unit/test_hmac_sha256.cpp @@ -80,11 +80,9 @@ void TestHmacSha256(void) testFreeInstance(instance); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestHmacSha256(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_ip6_address.cpp b/tests/unit/test_ip6_address.cpp index fa1d002a8..81340e827 100644 --- a/tests/unit/test_ip6_address.cpp +++ b/tests/unit/test_ip6_address.cpp @@ -204,11 +204,9 @@ void TestIp6AddressFromString(void) } } -#ifdef ENABLE_TEST_MAIN int main(void) { TestIp6AddressFromString(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_link_quality.cpp b/tests/unit/test_link_quality.cpp index 39d30cb31..d86a0fd0a 100644 --- a/tests/unit/test_link_quality.cpp +++ b/tests/unit/test_link_quality.cpp @@ -486,7 +486,6 @@ void TestSuccessRateTracker(void) } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::TestRssAveraging(); @@ -495,4 +494,3 @@ int main(void) printf("\nAll tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_linked_list.cpp b/tests/unit/test_linked_list.cpp index 5b915735d..3e9cb6458 100644 --- a/tests/unit/test_linked_list.cpp +++ b/tests/unit/test_linked_list.cpp @@ -142,11 +142,9 @@ void TestLinkedList(void) VerifyLinkedListContent(list, NULL); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestLinkedList(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_lowpan.cpp b/tests/unit/test_lowpan.cpp index 278405835..bab602d20 100644 --- a/tests/unit/test_lowpan.cpp +++ b/tests/unit/test_lowpan.cpp @@ -1841,7 +1841,6 @@ void TestLowpanIphc(void) } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { TestLowpanIphc(); @@ -1849,4 +1848,3 @@ int main(void) printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_mac_frame.cpp b/tests/unit/test_mac_frame.cpp index 5a91d62c5..d55fcd148 100644 --- a/tests/unit/test_mac_frame.cpp +++ b/tests/unit/test_mac_frame.cpp @@ -408,7 +408,6 @@ void TestMacChannelMask(void) } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::TestMacAddress(); @@ -418,4 +417,3 @@ int main(void) printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_message.cpp b/tests/unit/test_message.cpp index 8b40b8b65..f078eaaec 100644 --- a/tests/unit/test_message.cpp +++ b/tests/unit/test_message.cpp @@ -63,11 +63,9 @@ void TestMessage(void) testFreeInstance(instance); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestMessage(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_message_queue.cpp b/tests/unit/test_message_queue.cpp index b5c319190..0f4dece11 100644 --- a/tests/unit/test_message_queue.cpp +++ b/tests/unit/test_message_queue.cpp @@ -294,7 +294,6 @@ void TestMessageQueueOtApis(void) testFreeInstance(sInstance); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestMessageQueue(); @@ -302,4 +301,3 @@ int main(void) printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_ncp_buffer.cpp b/tests/unit/test_ncp_buffer.cpp index ea25309fc..97368a800 100644 --- a/tests/unit/test_ncp_buffer.cpp +++ b/tests/unit/test_ncp_buffer.cpp @@ -1098,7 +1098,6 @@ void TestFuzzNcpFrameBuffer(void) } // namespace Ncp } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::Ncp::TestNcpFrameBuffer(); @@ -1106,4 +1105,3 @@ int main(void) printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_network_data.cpp b/tests/unit/test_network_data.cpp index c58e6b240..cddb34479 100644 --- a/tests/unit/test_network_data.cpp +++ b/tests/unit/test_network_data.cpp @@ -175,7 +175,6 @@ void TestNetworkDataIterator(void) } // namespace NetworkData } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::NetworkData::TestNetworkDataIterator(); @@ -183,4 +182,3 @@ int main(void) printf("\nAll tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_priority_queue.cpp b/tests/unit/test_priority_queue.cpp index 0d868cf04..1568df37c 100644 --- a/tests/unit/test_priority_queue.cpp +++ b/tests/unit/test_priority_queue.cpp @@ -323,11 +323,9 @@ void TestPriorityQueue(void) testFreeInstance(instance); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestPriorityQueue(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_pskc.cpp b/tests/unit/test_pskc.cpp index 3f58e6da4..bc0d3cb43 100644 --- a/tests/unit/test_pskc.cpp +++ b/tests/unit/test_pskc.cpp @@ -82,7 +82,6 @@ void TestMaximumPassphrase(void) testFreeInstance(instance); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestMinimumPassphrase(); @@ -90,16 +89,13 @@ int main(void) printf("All tests passed\n"); return 0; } -#endif #else // #if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE -#ifdef ENABLE_TEST_MAIN int main(void) { printf("Commissioenr role disabled\n"); return 0; } -#endif #endif // #if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE diff --git a/tests/unit/test_spinel_decoder.cpp b/tests/unit/test_spinel_decoder.cpp index 4af4f9fe5..8be50de61 100644 --- a/tests/unit/test_spinel_decoder.cpp +++ b/tests/unit/test_spinel_decoder.cpp @@ -684,11 +684,9 @@ void TestSpinelDecoder(void) } // namespace Ncp } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::Ncp::TestSpinelDecoder(); printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_spinel_encoder.cpp b/tests/unit/test_spinel_encoder.cpp index b19a825d6..cedb598c7 100644 --- a/tests/unit/test_spinel_encoder.cpp +++ b/tests/unit/test_spinel_encoder.cpp @@ -403,11 +403,9 @@ void TestSpinelEncoder(void) } // namespace Ncp } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::Ncp::TestSpinelEncoder(); printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_string.cpp b/tests/unit/test_string.cpp index 1967aaacc..b7847887d 100644 --- a/tests/unit/test_string.cpp +++ b/tests/unit/test_string.cpp @@ -119,11 +119,9 @@ void TestString(void) } // namespace ot -#ifdef ENABLE_TEST_MAIN int main(void) { ot::TestString(); printf("\nAll tests passed.\n"); return 0; } -#endif diff --git a/tests/unit/test_timer.cpp b/tests/unit/test_timer.cpp index 0c53b3f87..9b868710a 100644 --- a/tests/unit/test_timer.cpp +++ b/tests/unit/test_timer.cpp @@ -657,7 +657,6 @@ void RunTimerTests(void) TestTenTimers(); } -#ifdef ENABLE_TEST_MAIN int main(void) { RunTimerTests(); @@ -665,4 +664,3 @@ int main(void) printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_toolchain.cpp b/tests/unit/test_toolchain.cpp index 48f503bc3..07878817e 100644 --- a/tests/unit/test_toolchain.cpp +++ b/tests/unit/test_toolchain.cpp @@ -124,11 +124,9 @@ void TestToolchain(void) test_addr_bitfield(); } -#ifdef ENABLE_TEST_MAIN int main(void) { TestToolchain(); printf("All tests passed\n"); return 0; } -#endif diff --git a/tests/unit/test_util.h b/tests/unit/test_util.h index 112641959..44d52627b 100644 --- a/tests/unit/test_util.h +++ b/tests/unit/test_util.h @@ -36,9 +36,6 @@ extern "C" { #endif -// Enable main functions -#define ENABLE_TEST_MAIN - /** * This macro verifies a given error status to be successful (compared against value zero (0)), otherwise, it emits a * given error messages and exits the program.