mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
[MQTT] - Adds esp-timer as dependency and change version.
- Current time is now from esp_timer.
This commit is contained in:
parent
87c987920a
commit
33fccf6405
@ -3,7 +3,9 @@ idf_component_register(SRCS "esp-mqtt/mqtt_client.c"
|
|||||||
"esp-mqtt/lib/mqtt_outbox.c"
|
"esp-mqtt/lib/mqtt_outbox.c"
|
||||||
"esp-mqtt/lib/platform_esp32_idf.c"
|
"esp-mqtt/lib/platform_esp32_idf.c"
|
||||||
INCLUDE_DIRS esp-mqtt/include
|
INCLUDE_DIRS esp-mqtt/include
|
||||||
PRIV_INCLUDE_DIRS "esp-mqtt/lib/include")
|
PRIV_INCLUDE_DIRS "esp-mqtt/lib/include"
|
||||||
|
PRIV_REQUIRES esp_timer
|
||||||
|
)
|
||||||
|
|
||||||
if(TEST_BUILD)
|
if(TEST_BUILD)
|
||||||
message(STATUS "building MOCKS")
|
message(STATUS "building MOCKS")
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit a21c387d6280260894981c22494017c893d505b9
|
Subproject commit 89e5c6014f8dbcfcd98af35fb507ca7b96ac8aee
|
@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(COMPONENTS main)
|
set(COMPONENTS main)
|
||||||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/")
|
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/"
|
||||||
|
"$ENV{IDF_PATH}/tools/mocks/esp_timer/"
|
||||||
|
)
|
||||||
|
|
||||||
option(TEST_BUILD "" ON)
|
option(TEST_BUILD "" ON)
|
||||||
project(host_mqtt_client_test)
|
project(host_mqtt_client_test)
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
idf_component_register(SRCS "test_mqtt_client.cpp"
|
idf_component_register(SRCS "test_mqtt_client.cpp"
|
||||||
INCLUDE_DIRS "$ENV{IDF_PATH}/tools/catch"
|
INCLUDE_DIRS "$ENV{IDF_PATH}/tools/catch"
|
||||||
REQUIRES cmock mqtt)
|
REQUIRES cmock mqtt esp_timer)
|
||||||
|
@ -13,6 +13,7 @@ extern "C" {
|
|||||||
#include "Mockhttp_parser.h"
|
#include "Mockhttp_parser.h"
|
||||||
#include "Mockqueue.h"
|
#include "Mockqueue.h"
|
||||||
#include "Mocktask.h"
|
#include "Mocktask.h"
|
||||||
|
#include "Mockesp_timer.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following functions are not directly called but the generation of them
|
* The following functions are not directly called but the generation of them
|
||||||
@ -30,15 +31,16 @@ struct ClientInitializedFixture {
|
|||||||
esp_mqtt_client_handle_t client;
|
esp_mqtt_client_handle_t client;
|
||||||
ClientInitializedFixture()
|
ClientInitializedFixture()
|
||||||
{
|
{
|
||||||
TEST_PROTECT();
|
[[maybe_unused]] auto protect = TEST_PROTECT();
|
||||||
int mtx;
|
int mtx;
|
||||||
int transport_list;
|
int transport_list;
|
||||||
int transport;
|
int transport;
|
||||||
int event_group;
|
int event_group;
|
||||||
uint8_t mac[] = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55};
|
uint8_t mac[] = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55};
|
||||||
esp_log_write_Ignore();
|
esp_log_write_Ignore();
|
||||||
xQueueTakeMutexRecursive_CMockIgnoreAndReturn(0, true);
|
esp_timer_get_time_IgnoreAndReturn(0);
|
||||||
xQueueGiveMutexRecursive_CMockIgnoreAndReturn(0, true);
|
xQueueTakeMutexRecursive_IgnoreAndReturn(true);
|
||||||
|
xQueueGiveMutexRecursive_IgnoreAndReturn(true);
|
||||||
xQueueCreateMutex_ExpectAnyArgsAndReturn(
|
xQueueCreateMutex_ExpectAnyArgsAndReturn(
|
||||||
reinterpret_cast<QueueHandle_t>(&mtx));
|
reinterpret_cast<QueueHandle_t>(&mtx));
|
||||||
xEventGroupCreate_IgnoreAndReturn(reinterpret_cast<EventGroupHandle_t>(&event_group));
|
xEventGroupCreate_IgnoreAndReturn(reinterpret_cast<EventGroupHandle_t>(&event_group));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user