esp-idf/tools/test_idf_size/test_idf_size.py
Frantisek Hrbata 9df59a2193 ci: add simple test for idf_size.py python compatibility
This adds a simple test that tries to run idf_size.py help and check
if the process does not exit with error. This is just to make sure
that idf_size.py can be used with minimum required python version.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-08 13:38:19 +02:00

18 lines
631 B
Python

#!/usr/bin/env python
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import sys
from pathlib import Path
from subprocess import DEVNULL
from subprocess import run
def test_idf_size() -> None:
# Simple test to make sure that the idf_size.py wrapper is compatible
# with idf.py minimum required python version.
logging.info('idf_size.py python compatibility check')
idf_size_path = Path(os.environ['IDF_PATH']) / 'tools' / 'idf_size.py'
run([sys.executable, idf_size_path, '--help'], stdout=DEVNULL, stderr=DEVNULL, check=True)