From 0bfe5e04c78ad24654439fc6b6e0f87d2f46fe1d Mon Sep 17 00:00:00 2001 From: Hays Chan <25737801+hayschan@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:58:50 +0800 Subject: [PATCH] Remove test_apps Currently this repo does not have test_apps --- test_apps/CMakeLists.txt | 13 -------- test_apps/diagram.json | 8 ----- test_apps/main/CMakeLists.txt | 4 --- test_apps/main/test_max6675.c | 61 ----------------------------------- test_apps/pytest_max6675.py | 20 ------------ test_apps/sdkconfig.defaults | 9 ------ test_apps/wokwi.toml | 4 --- 7 files changed, 119 deletions(-) delete mode 100644 test_apps/CMakeLists.txt delete mode 100644 test_apps/diagram.json delete mode 100644 test_apps/main/CMakeLists.txt delete mode 100644 test_apps/main/test_max6675.c delete mode 100644 test_apps/pytest_max6675.py delete mode 100644 test_apps/sdkconfig.defaults delete mode 100644 test_apps/wokwi.toml diff --git a/test_apps/CMakeLists.txt b/test_apps/CMakeLists.txt deleted file mode 100644 index 389e9c5..0000000 --- a/test_apps/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# For more information about build system see -# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html -# The following five lines of boilerplate have to be in your project's -# CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.5) - -set(EXTRA_COMPONENT_DIRS "PROJECT_SOURCE_DIR/../..") - -include($ENV{IDF_PATH}/tools/cmake/project.cmake) -add_compile_options("-Wno-format") -get_filename_component(ProjectId ${CMAKE_CURRENT_LIST_DIR} NAME) -string(REPLACE " " "_" ProjectId ${ProjectId}) -project(${ProjectId}) diff --git a/test_apps/diagram.json b/test_apps/diagram.json deleted file mode 100644 index 68ecee6..0000000 --- a/test_apps/diagram.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version": 1, - "author": "Hays Chan, aka Nozomi", - "editor": "wokwi", - "parts": [ { "type": "board-esp32-s3-devkitc-1", "id": "esp", "top": 0, "left": 0, "attrs": {} } ], - "connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ], - "dependencies": {} - } diff --git a/test_apps/main/CMakeLists.txt b/test_apps/main/CMakeLists.txt deleted file mode 100644 index 6f8cd65..0000000 --- a/test_apps/main/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -idf_component_register(SRCS "test_max6675.c" - INCLUDE_DIRS "." - PRIV_REQUIRES max6675 unity - ) diff --git a/test_apps/main/test_max6675.c b/test_apps/main/test_max6675.c deleted file mode 100644 index 041708b..0000000 --- a/test_apps/main/test_max6675.c +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include "unity.h" -#include "esp_log.h" -#include "max6675.h" - -static const char* TAG = "MAX6675_TEST"; - -static MAX6675_structure max6675_test_set = { -// 第二代炸炉电子板 12段炸炉 max6675 GPIO - .MAX6675_SCK = GPIO_NUM_36, - .MAX6675_CS = GPIO_NUM_35, - .MAX6675_MISO = GPIO_NUM_38, - .TEMPERATURE_CALIBRATION_COEFFICIENT = 0.25 -}; - -void max6675_test_init() -{ - // Initialize the MAX6675 sensor with test settings - MAX6675_init(max6675_test_set); - ESP_LOGI(TAG, "MAX6675 initialized"); -} - -void max6675_test_read_temperature() -{ - // Read temperature in Celsius and Fahrenheit - double temp_celsius = readCelsius(); - double temp_fahrenheit = readFahrenheit(); - - ESP_LOGI(TAG, "Temperature: %.2f °C, %.2f °F", temp_celsius, temp_fahrenheit); - - // Add checks to validate the temperature readings - TEST_ASSERT_NOT_EQUAL(-100, temp_celsius); // Assuming -100 is error value - // Further validation checks can be added based on known test conditions -} - -TEST_CASE("MAX6675 Sensor Test", "[max6675][iot][sensor]") -{ - max6675_test_init(); - max6675_test_read_temperature(); -} - -void app_main(void) -{ - // print max6675 Test banner to serial - /* - * __ ________ _____ _______ _ - * / / / /____ | ____| |__ __| | | - * _ __ ___ __ ___ __/ /_ / /_ / /| |__ | | ___ ___| |_ - * | '_ ` _ \ / _` \ \/ / '_ \| '_ \ / / |___ \ | |/ _ \/ __| __| - * | | | | | | (_| |> <| (_) | (_) / / ___) | | | __/\__ \ |_ - * |_| |_| |_|\__,_/_/\_\\___/ \___/_/ |____/ |_|\___||___/\__| - */ - printf(" __ ________ _____ _______ _ \n"); - printf(" / / / /____ | ____| |__ __| | | \n"); - printf(" _ __ ___ __ ___ __/ /_ / /_ / /| |__ | | ___ ___| |_ \n"); - printf(" | '_ ` _ \\ / _` \\ \\/ / '_ \\| '_ \\ / / |___ \\ | |/ _ \\/ __| __|\n"); - printf(" | | | | | | (_| |> <| (_) | (_) / / ___) | | | __/\\__ \\ |_ \n"); - printf(" |_| |_| |_|\\__,_/_/\\_\\\\___/ \\___/_/ |____/ |_|\\___||___/\\__|\n"); - - unity_run_menu(); -} \ No newline at end of file diff --git a/test_apps/pytest_max6675.py b/test_apps/pytest_max6675.py deleted file mode 100644 index 4f0e4a2..0000000 --- a/test_apps/pytest_max6675.py +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-FileCopyrightText: 2022-2024 Hays Chan -# SPDX-License-Identifier: MIT - -''' -Steps to run these cases: -- Build - - . ${IDF_PATH}/export.sh - - pip install idf_build_apps - - python tools/build_apps.py components/button/test_apps -t esp32s3 -- Test - - pip install -r tools/requirements/requirement.pytest.txt - - pytest components/button/test_apps --target esp32s3 -''' - -import pytest -from pytest_embedded import Dut - -@pytest.mark.supported_targets -def test_max6675(dut: Dut)-> None: - dut.run_all_single_board_cases() \ No newline at end of file diff --git a/test_apps/sdkconfig.defaults b/test_apps/sdkconfig.defaults deleted file mode 100644 index 26c3fab..0000000 --- a/test_apps/sdkconfig.defaults +++ /dev/null @@ -1,9 +0,0 @@ -# For IDF 5.0 -# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y -# CONFIG_FREERTOS_HZ=1000 -CONFIG_ESP_TASK_WDT_EN=n - -# For IDF4.4 -# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -# CONFIG_ESP_TASK_WDT=n \ No newline at end of file diff --git a/test_apps/wokwi.toml b/test_apps/wokwi.toml deleted file mode 100644 index 85e2619..0000000 --- a/test_apps/wokwi.toml +++ /dev/null @@ -1,4 +0,0 @@ -[wokwi] -version = 1 -firmware = 'build/flasher_args.json' -elf = 'build/test_apps.elf'