Skip to content

Commit c348076

Browse files
committed
fix(modem): Remove catch dependency
1 parent 1b6a3b3 commit c348076

File tree

2 files changed

+15
-30
lines changed

2 files changed

+15
-30
lines changed

components/esp_modem/test/target/main/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
idf_component_register(SRCS "pppd_test.cpp"
22
"NetworkDCE.cpp"
3-
INCLUDE_DIRS "$ENV{IDF_PATH}/tools/catch"
43
REQUIRES esp_modem)
54

65
set_target_properties(${COMPONENT_LIB} PROPERTIES

components/esp_modem/test/target/main/pppd_test.cpp

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Unlicense OR CC0-1.0
55
*/
@@ -17,9 +17,6 @@
1717
#include "freertos/FreeRTOS.h"
1818
#include "freertos/event_groups.h"
1919

20-
#define CATCH_CONFIG_MAIN
21-
#include "catch.hpp"
22-
2320
static const char *TAG = "pppd_test";
2421
static EventGroupHandle_t event_group = NULL;
2522

@@ -76,6 +73,9 @@ esp_err_t modem_init_network(esp_netif_t *netif);
7673
void modem_start_network();
7774
void modem_stop_network();
7875

76+
bool test_connect();
77+
bool test_disconnect();
78+
7979
extern "C" void app_main(void)
8080
{
8181

@@ -99,41 +99,27 @@ extern "C" void app_main(void)
9999
#endif
100100

101101
modem_start_network();
102-
Catch::Session session;
103-
int numFailed = session.run();
104-
if (numFailed > 0) {
105-
ESP_LOGE(TAG, "Test FAILED!");
102+
103+
bool t1 = test_connect();
104+
bool t2 = test_disconnect();
105+
106+
if (t1 && t2) {
107+
ESP_LOGI(TAG, "All tests passed");
106108
} else {
107-
ESP_LOGI(TAG, "Test passed!");
109+
ESP_LOGE(TAG, "Test FAILED!");
108110
}
109111

110112
}
111113

112-
TEST_CASE("Connect test", "[esp_modem]")
114+
bool test_connect() //("Connect test", "[esp_modem]")
113115
{
114116
EventBits_t b = xEventGroupWaitBits(event_group, 1, pdTRUE, pdFALSE, pdMS_TO_TICKS(15000));
115-
CHECK(b == 1);
117+
return b == 1;
116118
}
117119

118-
TEST_CASE("Disconnection test", "[esp_modem]")
120+
bool test_disconnect() //("Disconnection test", "[esp_modem]")
119121
{
120122
modem_stop_network();
121123
EventBits_t b = xEventGroupWaitBits(event_group, 2, pdTRUE, pdFALSE, pdMS_TO_TICKS(15000));
122-
CHECK(b == 2);
123-
}
124-
125-
126-
extern "C" {
127-
128-
static void handle(int nr)
129-
{
130-
ESP_LOGE(TAG, "Signal handler %d", nr);
131-
}
132-
133-
_sig_func_ptr signal (int nr, _sig_func_ptr)
134-
{
135-
return handle;
136-
}
137-
138-
124+
return b == 2;
139125
}

0 commit comments

Comments
 (0)