mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-13 13:50:21 +00:00
CI: Move all UT in driver to test_app
This commit is contained in:
42
components/driver/test_apps/i2c/main/test_app_main.c
Normal file
42
components/driver/test_apps/i2c/main/test_app_main.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "unity.h"
|
||||
#include "unity_test_runner.h"
|
||||
#include "unity_test_utils_memory.h"
|
||||
#include "esp_heap_caps.h"
|
||||
|
||||
// Some resources are lazy allocated in I2C driver, so we reserved this threshold when checking memory leak
|
||||
// A better way to check a potential memory leak is running a same case by twice, for the second time, the memory usage delta should be zero
|
||||
#define LEAKS (400)
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
unity_utils_record_free_mem();
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
unity_utils_evaluate_leaks_direct(LEAKS);
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
|
||||
// ___ ____ ____ _____ _
|
||||
// |_ _|___ \ / ___| |_ _|__ ___| |_
|
||||
// | | __) | | | |/ _ \/ __| __|
|
||||
// | | / __/| |___ | | __/\__ \ |_
|
||||
// |___|_____|\____| |_|\___||___/\__|
|
||||
|
||||
printf(" ___ ____ ____ _____ _ \n");
|
||||
printf("|_ _|___ \\ / ___| |_ _|__ ___| |_ \n");
|
||||
printf(" | | __) | | | |/ _ \\/ __| __|\n");
|
||||
printf(" | | / __/| |___ | | __/\\__ \\ |_ \n");
|
||||
printf("|___|_____|\\____| |_|\\___||___/\\__|\n");
|
||||
|
||||
unity_run_menu();
|
||||
}
|
Reference in New Issue
Block a user