mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fba96d58c2
build: - upgrade idf-build-apps to 2.x - unify get_pytest_apps and get_cmake_apps to get_all_apps - returns (test_apps, non_test_apps) tuple - add tests for the new get_all_apps assign: - generate build report - generate target test pipeline based on the build report target test: - download artifacts from minio server - users can use `pytest --pipeline-id xxxxx` to download and flash the binaries from the artifacts .post: - generate target test reports
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
tools_ci_dir = os.path.join(os.path.dirname(__file__), '..', '..')
|
|
if tools_ci_dir not in sys.path:
|
|
sys.path.append(tools_ci_dir)
|
|
|
|
tools_dir = os.path.join(os.path.dirname(__file__), '..', '..', '..')
|
|
if tools_dir not in sys.path:
|
|
sys.path.append(tools_dir)
|
|
|
|
|
|
def create_project(name: str, folder: Path) -> Path:
|
|
p = folder / name
|
|
p.mkdir(parents=True, exist_ok=True)
|
|
(p / 'main').mkdir(parents=True, exist_ok=True)
|
|
|
|
with open(p / 'CMakeLists.txt', 'w') as fw:
|
|
fw.write(
|
|
"""cmake_minimum_required(VERSION 3.16)
|
|
include($ENV{{IDF_PATH}}/tools/cmake/project.cmake)
|
|
project({})
|
|
""".format(
|
|
name
|
|
)
|
|
)
|
|
|
|
with open(p / 'main' / 'CMakeLists.txt', 'w') as fw:
|
|
fw.write(
|
|
"""idf_component_register(SRCS "{}.c"
|
|
INCLUDE_DIRS ".")
|
|
""".format(
|
|
name
|
|
)
|
|
)
|
|
|
|
with open(p / 'main' / f'{name}.c', 'w') as fw:
|
|
fw.write(
|
|
"""#include <stdio.h>
|
|
void app_main(void) {}
|
|
"""
|
|
)
|
|
|
|
return p
|