Merge branch 'feature/unit_test_example' into 'master'

Move Unity into components, add unit test example

See merge request idf/esp-idf!3562
This commit is contained in:
Ivan Grokhotkov
2018-11-19 18:35:54 +08:00
93 changed files with 1212 additions and 2936 deletions

View File

@@ -13,6 +13,7 @@
// limitations under the License.
#pragma once
#include <stdint.h>
/**
* @file esp_clk.h

View File

@@ -36,7 +36,7 @@ extern "C" {
#define RX_BUFF_SIZE 0x100
#define TX_BUFF_SIZE 100
//uart int enalbe register ctrl bits
//uart int enable register ctrl bits
#define UART_RCV_INTEN BIT0
#define UART_TRX_INTEN BIT1
#define UART_LINE_STATUS_INTEN BIT2
@@ -301,14 +301,14 @@ char uart_rx_one_char_block(void);
*
* @param uint8_t *pString : the pointer to store the string.
*
* @param uint8_t MaxStrlen : the max string length, incude '\0'.
* @param uint8_t MaxStrlen : the max string length, include '\0'.
*
* @return OK.
*/
STATUS UartRxString(uint8_t *pString, uint8_t MaxStrlen);
/**
* @brief Process uart recevied information in the interrupt handler.
* @brief Process uart received information in the interrupt handler.
* Please do not call this function in SDK.
*
* @param void *para : the message receive buffer.

View File

@@ -1,7 +1,7 @@
set(COMPONENT_SRCDIRS ".")
set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
set(COMPONENT_REQUIRES unity nvs_flash ulp)
set(COMPONENT_REQUIRES unity test_utils nvs_flash ulp)
register_component()

View File

@@ -10,6 +10,7 @@
#include "freertos/xtensa_timer.h"
#include "soc/cpu.h"
#include "unity.h"
#include "test_utils.h"
#include "rom/uart.h"
#include "rom/sha.h"
#include "soc/uart_reg.h"

View File

@@ -9,10 +9,12 @@
#include "freertos/xtensa_timer.h"
#include "soc/cpu.h"
#include "unity.h"
#include "test_utils.h"
#include "rom/uart.h"
#include "soc/uart_reg.h"
#include "soc/dport_reg.h"
#include "soc/rtc.h"
#define MHZ (1000000)
static volatile bool exit_flag;
static bool dport_test_result;

View File

@@ -16,6 +16,7 @@
#include "soc/soc.h" // for direct register read macros
#include "rom/rtc.h"
#include "esp_newlib.h"
#include "test_utils.h"
#define ESP_EXT0_WAKEUP_LEVEL_LOW 0
#define ESP_EXT0_WAKEUP_LEVEL_HIGH 1