repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
esp-idf | esp-idf-master/tools/ldgen/ldgen.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import argparse
import errno
import json
import os
import subprocess
import sys
import tempfile
from io import StringIO
from ldgen.entity import EntityDB
from ldgen.fragments import ... | 5,554 | 30.5625 | 108 | py |
esp-idf | esp-idf-master/tools/ldgen/test/test_output_commands.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import os
import sys
import unittest
try:
from ldgen.entity import Entity
from ldgen.output_commands import AlignAtAddress, InputSectionDesc, SymbolAtAddress
except ImportErr... | 11,224 | 46.970085 | 142 | py |
esp-idf | esp-idf-master/tools/ldgen/test/test_generation.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import collections
import fnmatch
import os
import sys
import tempfile
import unittest
from io import StringIO
try:
from ldgen.entity import Entity, EntityDB
from ldgen.fragm... | 70,582 | 40.543849 | 142 | py |
esp-idf | esp-idf-master/tools/ldgen/test/test_fragments.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import os
import sys
import tempfile
import unittest
from io import StringIO
try:
from ldgen.fragments import Align, Flag, Keep, Sort, Surround, parse_fragment_file
from ldge... | 25,688 | 29.876202 | 106 | py |
esp-idf | esp-idf-master/tools/ldgen/test/test_entity.py | #!/usr/bin/env python
# coding=utf-8
#
# SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import os
import sys
import unittest
try:
from ldgen.entity import Entity, EntityDB
except ImportError:
sys.path.append(os.path.dirname(os.path.dirname(__file_... | 9,263 | 37.280992 | 110 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/output_commands.py | #
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
from .entity import Entity
# Contains classes for output section commands referred to in
# https://www.acrc.bris.ac.uk/acrc/RedHat/rhel-ld-en-4/sections.html#OUTPUT-SECTION-DESCRIPTION.
class AlignAtAdd... | 5,152 | 32.245161 | 96 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/sdkconfig.py | #
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import kconfiglib
class SDKConfig:
"""
Evaluates conditional expressions based on the build's sdkconfig and Kconfig files.
"""
def __init__(self, kconfig_file, sdkconfig_file):
se... | 790 | 28.296296 | 87 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/fragments.py | #
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
from typing import Any, Dict, List, Optional, Set, Tuple, Union
from pyparsing import (Combine, Forward, Group, IndentedBlock, Keyword, LineEnd, Literal, OneOrMore, Opt,
ParseFatalE... | 14,993 | 30.368201 | 117 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/generation.py | #
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import collections
import fnmatch
import itertools
from collections import namedtuple
from .entity import Entity
from .fragments import Keep, Scheme, Sections, Sort, Surround
from .ldgen_common import LdG... | 22,960 | 40.001786 | 116 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/__init__.py | 0 | 0 | 0 | py | |
esp-idf | esp-idf-master/tools/ldgen/ldgen/ldgen_common.py | #
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
class LdGenFailure(RuntimeError):
"""
Parent class for any ldgen runtime failure which is due to input data
"""
| 239 | 23 | 73 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/linker_script.py | #
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import collections
import os
from pyparsing import ParseException, Suppress, White
from .fragments import Fragment
from .generation import GenerationException
class LinkerScript:
"""
Process a ... | 2,776 | 32.059524 | 100 | py |
esp-idf | esp-idf-master/tools/ldgen/ldgen/entity.py | #
# SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import collections
import fnmatch
import os
from enum import Enum
from functools import total_ordering
from pyparsing import (Group, Literal, OneOrMore, ParseException, Regex, SkipTo, Suppress, White, Wor... | 7,674 | 33.728507 | 118 | py |
esp-idf | esp-idf-master/tools/test_mkuf2/test_mkuf2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import unicode_literals
import filecmp
import hashlib
import os
import random
import struct
import sys
import tempfile
import time
import unitte... | 7,695 | 35.822967 | 109 | py |
esp-idf | esp-idf-master/tools/ci/generate_rules.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import inspect
import os
import sys
from collections import defaultdict
from itertools import product
import yaml
from check_rules_yml import get_needed_rules
from idf_... | 11,019 | 34.779221 | 118 | py |
esp-idf | esp-idf-master/tools/ci/ci_fetch_submodule.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# internal use only for CI
# download archive of one commit instead of cloning entire submodule repo
import argparse
import os
import re
import shutil
import subprocess
import time
from typin... | 4,578 | 39.166667 | 113 | py |
esp-idf | esp-idf-master/tools/ci/check_type_comments.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import subprocess
from sys import exit
try:
from typing import List
except ImportError:
# Only used for type annotations
pass
IGNORE_LIST_MYPY = 'tools/ci/... | 2,995 | 31.215054 | 114 | py |
esp-idf | esp-idf-master/tools/ci/check_public_headers.py | #!/usr/bin/env python
#
# Checks all public headers in IDF in the ci
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import print_function, unicode_literals
import argparse
import fnmatch
import json
import os
import queue
import re
imp... | 20,013 | 50.056122 | 145 | py |
esp-idf | esp-idf-master/tools/ci/test_autocomplete.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import unittest
import pexpect
class Test(unittest.TestCase):
def test_fish(self):
os.environ['TERM'] = 'vt100'
child = pexpect.spawn('fish -i')
... | 2,691 | 43.866667 | 114 | py |
esp-idf | esp-idf-master/tools/ci/idf_unity_tester.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import time
from multiprocessing import Manager, Process, Semaphore
from multiprocessing.managers import SyncManager
from typing import List, Union
from pexpect.exceptions import TIMEO... | 15,244 | 37.30402 | 137 | py |
esp-idf | esp-idf-master/tools/ci/check_executables.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import sys
from typing import Iterable, List
try:
from idf_ci_utils import is_executable
except ImportError:
sys.path.append(os.path.join(os.path.dirn... | 2,207 | 28.44 | 109 | py |
esp-idf | esp-idf-master/tools/ci/check_callgraph.py | #!/usr/bin/env python
#
# Based on cally.py (https://github.com/chaudron/cally/), Copyright 2018, Eelco Chaudron
# SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import re
from functools import partial
from typing import BinaryIO, C... | 16,426 | 37.113689 | 151 | py |
esp-idf | esp-idf-master/tools/ci/check_kconfigs.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function, unicode_literals
import argparse
import os
import re
import sys
from io import open
from idf_ci_utils import IDF_PATH, get_submodule_dirs
# reg... | 20,304 | 42.386752 | 120 | py |
esp-idf | esp-idf-master/tools/ci/checkout_project_ref.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# internal use only
# called by CI jobs when it uses a project related to IDF
import argparse
import json
import os
import re
import subprocess
from typing import List, Tuple
IDF_GIT_DESCRIB... | 4,346 | 35.225 | 139 | py |
esp-idf | esp-idf-master/tools/ci/deploy_docs.py | #!/usr/bin/env python3
#
# CI script to deploy docs to a webserver. Not useful outside of CI environment
#
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import glob
import os
import os.path
import re
import stat
import subprocess
import sys
import tarf... | 8,786 | 39.307339 | 114 | py |
esp-idf | esp-idf-master/tools/ci/check_soc_headers_leak.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# This check script is used to ensure the public APIs won't expose the unstable soc files like register files
# public API header files are those taken by doxygen and have full documented docs
import fnmatch
... | 3,837 | 32.666667 | 119 | py |
esp-idf | esp-idf-master/tools/ci/test_check_kconfigs.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import unittest
from check_kconfigs import CONFIG_NAME_MAX_LENGTH, IndentAndNameChecker, InputError, LineRuleChecker, SourceChecker
class ApplyLine(object):
def apply_line(self, ... | 9,485 | 38.198347 | 115 | py |
esp-idf | esp-idf-master/tools/ci/test_build_system_spaces.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import os
import shutil
import subprocess
import sys
import typing
import unittest
try:
IDF_PATH = os.environ['IDF_PATH'] # type: str
except KeyError:
print('IDF_PATH must be set... | 9,690 | 42.850679 | 121 | py |
esp-idf | esp-idf-master/tools/ci/envsubst.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
# A script similar to GNU envsubst, but filters out
# some CI related variables.
import os
import sys
def main() -> None:
# Sanitize environment variables
vars_to_remove = []
f... | 687 | 21.933333 | 66 | py |
esp-idf | esp-idf-master/tools/ci/check_build_test_rules.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import inspect
import os
import re
import sys
from io import StringIO
from pathlib import Path
from typing import Dict, List, Optional, Tuple
import yaml
from idf_ci_uti... | 17,488 | 33.563241 | 153 | py |
esp-idf | esp-idf-master/tools/ci/idf_ci_utils.py | # internal use only for CI
# some CI related util functions
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import contextlib
import io
import logging
import os
import subprocess
import sys
from contextlib import redirect_stdout
from dataclasses import d... | 11,249 | 31.608696 | 113 | py |
esp-idf | esp-idf-master/tools/ci/check_artifacts_expire_time.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# internal use only
# check if expire time is set for all artifacts
import os
import yaml
IDF_PATH = os.getenv('IDF_PATH')
if not IDF_PATH:
print('Please set IDF_PATH before running thi... | 1,538 | 26.981818 | 92 | py |
esp-idf | esp-idf-master/tools/ci/check_requirement_files.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import json
import os
import re
from typing import Any
import jsonschema
IDF_PATH = os.environ['IDF_PATH']
JSON_PATH = os.path.join(IDF_PATH, 'tools', 'requirements.json')
SCHEMA_PATH =... | 1,873 | 30.762712 | 102 | py |
esp-idf | esp-idf-master/tools/ci/ci_get_mr_info.py | #!/usr/bin/env python
#
# internal use only for CI
# get latest MR information by source branch
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import argparse
import os
import subprocess
import typing as t
from pathlib import Path
from gitlab_api impo... | 3,054 | 28.375 | 97 | py |
esp-idf | esp-idf-master/tools/ci/check_soc_struct_headers.py | #!/usr/bin/env python
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# A check script that just works at the time of writing...
#
# also builds a structure tree for further reference
#
# Input file format must be similiar to those headers generated by regtool, ... | 20,284 | 46.955083 | 159 | py |
esp-idf | esp-idf-master/tools/ci/get_all_test_results.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
'''
Download artifacts from all test jobs
CI_PROJECT_DIR
└── TEST_RESULTS
├── <job_id>
│ └── XUNIT_RESULT.xml
├── <job_id>
│ └── XUNIT_RESULT.xml
├── <job_id>
... | 2,708 | 30.870588 | 100 | py |
esp-idf | esp-idf-master/tools/ci/check_rules_yml.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Check if all rules in rules.yml used or not in CI yaml files.
"""
import argparse
import os
import re
import sys
from copy import deepcopy
from typing import Any, Dict, List, Optio... | 4,344 | 26.5 | 86 | py |
esp-idf | esp-idf-master/tools/ci/check_deprecated_kconfigs.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function, unicode_literals
import argparse
import os
import sys
from io import open
from typing import Set, Tuple
from check_kconfigs import valid_directo... | 3,832 | 33.223214 | 115 | py |
esp-idf | esp-idf-master/tools/ci/check_tools_files_patterns.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import sys
from pathlib import Path
from typing import Set, Tuple
import yaml
from idf_ci_utils import IDF_PATH, get_git_files
def check(pattern_yml: str, e... | 3,079 | 37.024691 | 117 | py |
esp-idf | esp-idf-master/tools/ci/check_readme_links.py | #!/usr/bin/env python
#
# Checks that all links in the readme markdown files are valid
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import argparse
import concurrent.futures
import os
import os.path
import re
import sys
import urllib.error
import url... | 4,571 | 29.48 | 156 | py |
esp-idf | esp-idf-master/tools/ci/ci_build_apps.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
This file is used in CI generate binary files for different kinds of apps
"""
import argparse
import os
import sys
import typing as t
import unittest
from collections import defaultdict
from pathlib impor... | 14,760 | 35.810474 | 120 | py |
esp-idf | esp-idf-master/tools/ci/check_codeowners.py | #!/usr/bin/env python
#
# Utility script for ESP-IDF developers to work with the CODEOWNERS file.
#
# SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import re
import subprocess
import sys
from typing import List, Optional
from idf_... | 8,126 | 33.582979 | 135 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/wifi_tools.py | # SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import time
import dbus
import dbus.mainloop.glib
import netifaces
def get_wiface_name():
for iface in netifaces.interfaces():
if iface.startswith('w'):
return iface
return Non... | 4,242 | 34.066116 | 126 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/common_test_methods.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import socket
from typing import Any, List
import netifaces
import yaml
ENV_CONFIG_FILE_SEARCH = [
os.path.join(os.environ['IDF_PATH'], 'EnvConfig.yml'),
os.path.join(os.environ['... | 3,917 | 30.853659 | 129 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/gitlab_api.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import logging
import os
import re
import tarfile
import tempfile
import time
import zipfile
from functools import wraps
from typing import Any, Callable, Dict, List, Optional
import gitlab
TR... | 11,203 | 38.590106 | 121 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/ttfw_idf/IDFDUT.py | # SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
""" DUT for IDF applications """
import collections
import functools
import io
import os
import os.path
import re
import subprocess
import sys
import tempfile
import time
import pexpect
import serial
# pytho... | 32,117 | 33.986928 | 133 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/ttfw_idf/IDFAssignTest.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Command line tool to assign tests to CI test jobs.
"""
import argparse
import json
import os
import re
import sys
from copy import deepcopy
import yaml
try:
from yaml import CLoader as Loader
except I... | 13,901 | 38.160563 | 119 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/ttfw_idf/unity_test_parser.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Modification version of https://github.com/ETCLabs/unity-test-parser/blob/develop/unity_test_parser.py
since only python 3.6 or higher version have ``enum.auto()``
unity_test_parser.py
Parse the output of the ... | 13,343 | 34.301587 | 148 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/ttfw_idf/IDFApp.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
""" IDF Test Applications """
import hashlib
import json
import os
import re
import subprocess
import sys
from abc import abstractmethod
from tiny_test_fw import App
from .IDFAssignTest import ComponentUTGro... | 22,987 | 41.491682 | 144 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/ttfw_idf/__init__.py | # SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import functools
import json
import logging
import os
import re
from collections import defaultdict
from copy import deepcopy
import junit_xml
from tiny_test_fw import TinyFW, Utility
from .IDFApp import UT,... | 12,460 | 38.811502 | 119 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_iperf_test_util/TestReport.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
this module generates markdown format test report for throughput test.
The test report contains 2 parts:
1. throughput with different configs
2. throughput with RSSI
"""
import os
class ThroughputForConfigsR... | 9,274 | 36.399194 | 104 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_iperf_test_util/IperfUtility.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import re
import subprocess
import time
import pexpect
from idf_iperf_test_util import LineChart
from pytest_embedded import Dut
try:
from typing import Any, Tuple
except ImportEr... | 20,244 | 42.258547 | 129 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_iperf_test_util/PowerControl.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Internal use only.
This file implements controlling APC PDU via telnet.
"""
import telnetlib
class Control(object):
""" control APC via telnet """
@classmethod
def apc_telnet_make_choice(... | 2,813 | 32.105882 | 103 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_iperf_test_util/__init__.py | 0 | 0 | 0 | py | |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_iperf_test_util/Attenuator.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Internal use only.
This file provide method to control programmable attenuator.
"""
import codecs
import time
import serial
def set_att(port, att, att_fix=False):
"""
set attenuation value on ... | 1,482 | 22.919355 | 79 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_iperf_test_util/LineChart.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
import pyecharts.options as opts
from pyecharts.charts import Line
def draw_line_chart(file_name, title, x_label, y_label, data_series, range_list):
"""
draw line... | 1,979 | 40.25 | 114 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/DUT.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
DUT provides 3 major groups of features:
* DUT port feature, provide basic open/close/read/write features
* DUT tools, provide extra methods to control the device, like download and start app
* DUT expect... | 27,539 | 33.816688 | 120 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Env.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
""" Test Env, manages DUT, App and EnvConfig, interface for test cases to access these components """
import functools
import os
import threading
import traceback
import netifaces
from . import EnvConfig
d... | 6,912 | 34.634021 | 113 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/EnvConfig.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
The test env could change when we running test from different computers.
Test env config provide ``get_variable`` method to allow user get test environment related variables.
It will first try to get varia... | 2,108 | 31.953125 | 116 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/__init__.py | 0 | 0 | 0 | py | |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/TinyFW.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
""" Interface for test cases. """
import functools
import os
import socket
import time
from datetime import datetime
import junit_xml
from . import DUT, App, Env, Utility
from .Utility import format_case_id
... | 9,297 | 39.077586 | 132 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/App.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
class for handling Test Apps. Currently it provides the following features:
1. get SDK path
2. get SDK tools
3. parse application info from its path. for example:
* provide download info
* provide... | 2,445 | 26.795455 | 111 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/bin/example.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 1,637 | 36.227273 | 104 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/bin/Runner.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 4,496 | 34.976 | 106 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/docs/conf.py | # -*- coding: utf-8 -*-
#
# TinyTestFW documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 21 20:19:12 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | 4,844 | 29.471698 | 79 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Utility/SearchCases.py | # SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
""" search test cases from a given file or path """
import copy
import fnmatch
import os
import types
from typing import List
from . import load_source
class Search:
"""
This class is used as a clas... | 5,759 | 38.724138 | 116 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Utility/TestCase.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 2,102 | 34.644068 | 106 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Utility/CaseConfig.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 9,041 | 35.607287 | 109 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Utility/CIAssignTest.py | # SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
"""
Common logic to assign test cases to CI jobs.
Some background knowledge about Gitlab CI and use flow in esp-idf:
* Gitlab CI jobs are static in ``.gitlab-ci.yml``. We can't dynamically create test jobs
*... | 12,211 | 35.672673 | 118 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Utility/__init__.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function
import logging
import os.path
import sys
import time
import traceback
from unittest.mock import MagicMock
from .. import Env
_COLOR_CODES = {
'white': u'\033[0m',
'r... | 4,335 | 31.118519 | 106 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/tiny_test_fw/Utility/GitlabCIJob.py | # Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 2,017 | 29.575758 | 106 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_http_server_test/test.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# Utility for testing the web server. Test cases:
# Assume the device supports 'n' simultaneous open sockets
#
# HTTP Server Tests
#
# 0. Firmware Settings:
# - Create a dormant thread ... | 34,412 | 33.106046 | 148 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_http_server_test/client.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import errno
import http.client
import logging
def verbose_print(verbosity, *args):
if (verbosity):
logging.info(''.join(str(elems) for elems in args))
d... | 9,715 | 36.513514 | 97 | py |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_http_server_test/__init__.py | 0 | 0 | 0 | py | |
esp-idf | esp-idf-master/tools/ci/python_packages/idf_http_server_test/adder.py | #!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import argparse
import http.client
import logging
def start_session(ip, port):
return http.client.HTTPConnection(ip, int(port), timeout=15)
def end_session(conn):
conn.close... | 2,811 | 29.901099 | 88 | py |
esp-idf | esp-idf-master/examples/security/nvs_encryption_hmac/pytest_nvs_encr_hmac.py | # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import logging
import os
import pytest
from pytest_embedded_idf.dut import IdfDut
STR_KEY_VAL = ['Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'Fusce quis risus justo.',
... | 1,803 | 38.217391 | 80 | py |
esp-idf | esp-idf-master/examples/security/flash_encryption/pytest_flash_encryption.py | # SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function
import binascii
from collections import namedtuple
from io import BytesIO
import espsecure
import pytest
from pytest_embedded import Dut
# To prepare a test runner for... | 2,688 | 37.971014 | 144 | py |
esp-idf | esp-idf-master/examples/peripherals/i2c/i2c_tools/pytest_examples_i2c_tools.py | # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded_idf import IdfDut
EXPECT_TIMEOUT = 20
@pytest.mark.esp32
@pytest.mark.ccs811
def test_i2ctools_example(dut: IdfDut) -> None:
dut.expect_exact('i2c-tools>', timeout... | 1,137 | 33.484848 | 66 | py |
esp-idf | esp-idf-master/examples/peripherals/rmt/led_strip/pytest_led_strip.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def test_led_strip_... | 573 | 27.7 | 71 | py |
esp-idf | esp-idf-master/examples/peripherals/rmt/stepper_motor/pytest_stepper_motor.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def test_stepper_motor_example(dut: Dut) -> None:
dut.expect_exact('example:... | 710 | 34.55 | 96 | py |
esp-idf | esp-idf-master/examples/peripherals/rmt/musical_buzzer/pytest_musical_buzzer.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def test_musical_buzzer_example(dut: D... | 570 | 29.052632 | 71 | py |
esp-idf | esp-idf-master/examples/peripherals/rmt/ir_nec_transceiver/pytest_ir_nec.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.ir_transceiver
def test_ir_nec_example(dut: Dut) -> None:
dut.expect_exact('example: create RMT RX channel')
dut.expect_exac... | 779 | 38 | 71 | py |
esp-idf | esp-idf-master/examples/peripherals/rmt/dshot_esc/pytest_dshot_esc.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def test_dshot_esc_... | 664 | 30.666667 | 82 | py |
esp-idf | esp-idf-master/examples/peripherals/rmt/onewire/pytest_onewire.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def tes... | 541 | 29.111111 | 73 | py |
esp-idf | esp-idf-master/examples/peripherals/timer_group/gptimer/pytest_gptimer_example.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.supported_targets
@pytest.mark.generic
def test_gptimer_example(dut: Dut) -> None:
dut.expect_exact('Create timer handle', timeout=5)
dut.expec... | 1,395 | 36.72973 | 74 | py |
esp-idf | esp-idf-master/examples/peripherals/timer_group/gptimer_capture_hc_sr04/pytest_gptimer_capture_example.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def test_gptimer_capture(dut: Dut) -> None:
dut.expect_exact('Configure trig gpio')
dut.expec... | 750 | 34.761905 | 83 | py |
esp-idf | esp-idf-master/examples/peripherals/timer_group/legacy_driver/pytest_timer_group.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.supported_targets
@pytest.mark.generic
def test_timer_group_example(dut: Dut) -> None:
dut.expect(r'Init timer with auto-reload', timeout=5)
re... | 808 | 35.772727 | 97 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/host/uvc/player.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import socket
import cv2
import numpy as np
frame_count = 0
stream = bytearray()
print('Connecting to server...')
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.connect(('esp-... | 986 | 24.973684 | 66 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_midi/pytest_usb_device_midi.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_device_midi_example(dut: Dut) -> None:
dut.expect_exact('USB initialization DONE')
dut.expect_exact('MID... | 429 | 29.714286 | 66 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_ncm/pytest_usb_device_ncm.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import subprocess
import time
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_device_ncm_example(dut: Dut) -> None:
netif_mac = dut.expect(r'Network i... | 1,114 | 41.884615 | 152 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_serial_device/pytest_usb_device_serial.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
from time import sleep
import pytest
from pytest_embedded import Dut
from serial import Serial
from serial.tools.list_ports import comports
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_device_serial_exa... | 991 | 32.066667 | 76 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_msc/pytest_usb_device_msc.py | # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_device_msc_example(dut: Dut) -> None:
dut.expect('Mount storage')
dut.expect('TinyUSB Driver instal... | 583 | 26.809524 | 71 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_console/pytest_usb_device_console.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
from time import sleep
import pytest
from pytest_embedded import Dut
from serial import Serial
from serial.tools.list_ports import comports
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_device_console_ex... | 1,373 | 37.166667 | 87 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_hid/pytest_usb_device_hid.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_device_hid_example(dut: Dut) -> None:
dut.expect_exact('USB initialization DONE')
dut.expect_exact('Send... | 387 | 28.846154 | 66 | py |
esp-idf | esp-idf-master/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/pytest_usb_device_composite.py | # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
from time import sleep
import pytest
from pytest_embedded import Dut
from serial import Serial
from serial.tools.list_ports import comports
@pytest.mark.esp32s2
@pytest.mark.usb_device
def test_usb_composite_device_... | 1,050 | 34.033333 | 76 | py |
esp-idf | esp-idf-master/examples/peripherals/pcnt/rotary_encoder/pytest_rotary_encoder.py | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded.dut import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.generic
def test_rotary_encoder(dut: Dut) ->... | 799 | 31 | 71 | py |
esp-idf | esp-idf-master/examples/peripherals/touch_sensor/touch_element/touch_element_waterproof/pytest_touch_element_waterproof.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.generic
def test_touch_element_waterproof(dut: Dut) -> None:
dut.expect_exact('Touch Element Water... | 616 | 40.133333 | 90 | py |
esp-idf | esp-idf-master/examples/peripherals/touch_sensor/touch_element/touch_matrix/pytest_touch_matrix.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.generic
def test_touch_matrix(dut: Dut) -> None:
dut.expect_exact('Touch Matrix Example: Touch ele... | 555 | 36.066667 | 77 | py |
esp-idf | esp-idf-master/examples/peripherals/touch_sensor/touch_element/touch_button/pytest_touch_button.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.generic
def test_touch_button(dut: Dut) -> None:
dut.expect_exact('Touch Button Example: Touch ele... | 556 | 36.133333 | 77 | py |
esp-idf | esp-idf-master/examples/peripherals/touch_sensor/touch_element/touch_elements_combination/pytest_touch_elements_combination.py | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.generic
def test_touch_elements_combination(dut: Dut) -> None:
dut.expect_exact('Touch Elements Co... | 790 | 45.529412 | 91 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.