text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163
values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751
values | repo_full_name stringclasses 752
values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```python
#!/usr/bin/env python3
#
"""
Tests for jobserver.py classes' methods
"""
import functools
import mock
import os
import pytest
import sys
from contextlib import nullcontext
from errno import ENOENT
from selectors import EVENT_READ
# Job server only works on Linux for now.
pytestmark = pytest.mark.skipif(sys... | /content/code_sandbox/scripts/tests/twister/test_jobserver.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,148 |
```python
#!/usr/bin/env python3
#
"""
Tests for testinstance class
"""
import mmap
import mock
import os
import pytest
import sys
from contextlib import nullcontext
ZEPHYR_BASE = os.getenv('ZEPHYR_BASE')
sys.path.insert(0, os.path.join(ZEPHYR_BASE, 'scripts', 'pylib', 'twister'))
from twisterlib.statuses import Tw... | /content/code_sandbox/scripts/tests/twister/test_testsuite.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5,697 |
```python
#!/usr/bin/env python3
#
'''
This test file contains testsuites for testsuite.py module of twister
'''
import sys
import os
import mock
import pytest
from contextlib import nullcontext
ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
from twiste... | /content/code_sandbox/scripts/tests/twister/test_testplan.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15,144 |
```python
#!/usr/bin/env python3
#
"""
Tests for config_parser.py
"""
import os
import pytest
import mock
import scl
from twisterlib.config_parser import TwisterConfigParser, extract_fields_from_arg_list, ConfigurationError
from contextlib import nullcontext
def test_extract_single_field_from_string_argument():
... | /content/code_sandbox/scripts/tests/twister/test_config_parser.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,454 |
```yaml
testing:
ignore_tags:
- correct_schema_1
- correct_schema_2
``` | /content/code_sandbox/scripts/tests/twister/test_data/platform_correct_schema.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```yaml
test:
testing.incorrect_schema:
tag: demo incorrect_tag
platform_exclude: demo_board_1
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuite_incorrect_schema.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```yaml
test:
ignore_tags:
- incorrect_schema_1
- incorrect_schema_2
``` | /content/code_sandbox/scripts/tests/twister/test_data/platform_incorrect_schema.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```python
#!/usr/bin/env python3
#
"""
Tests for the error classes
"""
import os
import pytest
from pathlib import Path
from twisterlib.error import ConfigurationError
def test_configurationerror():
cfile = Path('some') / 'path'
message = 'dummy message'
expected_err = f'{os.path.join("some", "path")}: ... | /content/code_sandbox/scripts/tests/twister/test_errors.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 101 |
```yaml
tests:
testing.correct_schema:
tags: demo_correct correct_tags
platform_exclude: demo_board_1
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuite_correct_schema.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```yaml
- scenarios:
- test_a.check_1
platforms:
- demo_board_1
- demo_board_3
comment: "a1 on board_1 and board_3"
``` | /content/code_sandbox/scripts/tests/twister/test_data/quarantines/basic.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```yaml
- scenarios:
- test_(a|c).check_2
architectures:
- x86.*
comment: "a2 and c2 on x86"
- scenarios:
- test_d.*
comment: "all test_d"
``` | /content/code_sandbox/scripts/tests/twister/test_data/quarantines/with_regexp.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 53 |
```yaml
platforms:
override_default_platforms: false
increased_platform_scope: true
levels:
- name: smoke
description: >
A plan to be used verifying basic zephyr features on hardware.
adds:
- kernel.threads.*
- kernel.timer.behavior
- arch.interrupt
- boards.*
- name: accep... | /content/code_sandbox/scripts/tests/twister/test_data/test_config.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 103 |
```yaml
- platforms:
- demo_board_3
comment: "all on board_3"
``` | /content/code_sandbox/scripts/tests/twister/test_data/quarantines/platform.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```yaml
identifier: demo_board_1
name: DEMO_Board_1
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 256
flash: 1024
supported:
- supported_board_2
- supported_board_3
testing:
default: true
``` | /content/code_sandbox/scripts/tests/twister/test_data/boards/1_level/2_level/board_config_1.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 81 |
```yaml
# empty quarantine file
``` | /content/code_sandbox/scripts/tests/twister/test_data/quarantines/empty.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 6 |
```yaml
boards:
- name: demo_board_1
vendor: zephyr
socs:
- name: unit_testing
- name: demo_board_2
vendor: zephyr
socs:
- name: unit_testing
- name: demo_board_3
vendor: zephyr
socs:
- name: unit_testing
``` | /content/code_sandbox/scripts/tests/twister/test_data/boards/1_level/2_level/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 84 |
```yaml
identifier: demo_board_2
name: DEMO_Board_2
type: mcu
arch: x86
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 256
flash: 1024
supported:
- supported_board_1
- supported_board_3
``` | /content/code_sandbox/scripts/tests/twister/test_data/boards/1_level/2_level/board_config_2.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```yaml
identifier: demo_board_3
name: DEMO_Board_3
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 256
flash: 1024
supported:
- supported_board_1
- supported_board_2
testing:
default: true
``` | /content/code_sandbox/scripts/tests/twister/test_data/boards/1_level/2_level/board_config_3.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 81 |
```python
from twisterlib.mixins import DisablePyTestCollectionMixin
class TestClassToIgnore(DisablePyTestCollectionMixin):
def test_to_ignore(self):
assert False
``` | /content/code_sandbox/scripts/tests/twister/test_data/mixins/test_to_ignore.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 37 |
```c
/*
*
*/
ztest_test_suite(test_api,
ztest_1cpu_unit_test(test_a) /* comment! */,
/* comment */ztest_1cpu_unit_test(test_b),
ztest_1cpu_unit_test(test_c),
ztest_unit_test(test_unit_a), ztest_unit_test(test_unit_b),
ztest_1cpu_unit_test(
test_newline),
ztest_1cpu_unit_test(test_test_test_aa... | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_ztest.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 122 |
```yaml
tests:
test_e.check_1:
tags: test_e
build_only: true
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_e/test_data.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```c
/*
*
*/
ZTEST_SUITE(feature5, NULL, NULL, NULL, NULL, NULL);
ZTEST(feature5, test_1a);
ZTEST(feature5, test_1b);
ztest_run_registered_test_suites(feature4);
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_e/test_ztest_new_suite.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```c
/*
*
*/
/* I'm empty. */
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_e/test_ztest_no_suite.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```yaml
tests:
test_a.check_1:
tags: test_a
build_only: true
test_a.check_2:
extra_args: CONF_FILE="test.conf"
tags: test_a
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_a/test_data.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```yaml
tests:
test_c.check_1:
tags: test_c
test_c.check_2:
extra_args: CONF_FILE="test.conf"
tags: test_c
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_c/test_data.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 39 |
```c
/*
*
*/
static void test_1b(void)
{
ztest_test_skip();
}
void test_main(void)
{
#ifdef TEST_feature1
ztest_test_suite(feature1,
ztest_unit_test(1a), ztest_unit_test(test_1b),
ztest_unit_test(test_1c)
);
#endif
#ifdef TEST_feature2
ztest_test_suite(feature2,
ztest_unit_test(test_2a),
ztest_unit... | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_a/test_ztest_error.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 122 |
```c
/*
*
*/
ztest_test_suite(feature3,
ztest_unit_test(test_unit_1a),
#ifdef CONFIG_WHATEVER
ztest_unit_test(test_unit_1b),
#endif
ztest_unit_test(test_Unit_1c)
);
ztest_run_test_suite(feature3);
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_a/test_ztest_error_1.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```yaml
tests:
test_b.check_1:
min_ram: 32
tags: test_b
test_b.check_2:
min_ram: 32
extra_args: CONF_FILE="test.conf"
tags: test_b
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_b/test_data.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 53 |
```yaml
common:
extra_args: >
CONF_FILE=conf1;conf2 DTC_OVERLAY_FILE=overlay1;overlay2
OVERLAY_CONFIG=oc1.conf UNRELATED1=abc
extra_conf_files:
- "conf3"
- "conf4"
extra_overlay_confs:
- "oc2.conf"
extra_dtc_overlay_files:
- "overlay3"
- "overlay4"
tests:
test_config.main:
extr... | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_config/test_data.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 199 |
```yaml
tests:
test_d.check_1:
tags: test_d
build_only: true
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_d/test_data.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```yaml
name: dummy
boards:
demo_board_2:
append:
EXTRA_CONF_FILE: dummy.conf
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_d/snippets/dummy/snippet.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```unknown
CONFIG_BOOT_BANNER=n
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_d/snippets/dummy/dummy.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 7 |
```c
/*
*
*/
ztest_register_test_suite(feature4, NULL,
ztest_unit_test(test_unit_1a),
ztest_unit_test(test_unit_1b));
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/tests/test_d/test_ztest_error_register_test_suite.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```yaml
sample:
name: Sample Library
tests:
sample_test.app:
tags: sample_tag
harness: console
harness_config:
type: multi_line
regex:
- "Hello World!"
- "Sample says: Hello World!"
``` | /content/code_sandbox/scripts/tests/twister/test_data/testsuites/samples/test_app/test_sample_app.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```shell
#!/bin/sh
#
#
#
[ -f $1 ] && rm $1
[ -f $1_error.types ] && rm $1_error.types
[ -f $1_warning.types ] && rm $1_warning.types
dirs_to_check="arch drivers include kernel lib"
files=$(for d in ${dirs_to_check}; do find $d/ -type f -name '*.[ch]'; done)
for i in $files; do
${ZEPHYR_BASE}/scripts/checkpatch.pl ... | /content/code_sandbox/scripts/checkpatch/do_checkpatch.sh | shell | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 265 |
```unknown
#!/usr/bin/env bash
#
#
#
exe_name=$(basename $0)
# outputs the date and time in pre-set formats
# default format is: 20150114-181112
# usage: timestamp [-a] [-d] [-u] [-s] [-S]
# where: -a changes default to: 2015-01-14-18-11-56
# -d changes default to: 20150114
# -u changes default to: 201... | /content/code_sandbox/scripts/checkpatch/timestamp | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 468 |
```python
from __future__ import annotations
import pytest
import textwrap
from unittest import mock
from pathlib import Path
from twisterlib.harness import Pytest
from twisterlib.testsuite import TestSuite
from twisterlib.testinstance import TestInstance
from twisterlib.platform import Platform
@pytest.fixture
de... | /content/code_sandbox/scripts/tests/twister/pytest_integration/test_harness_pytest.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,178 |
```shell
#!/usr/bin/env bash
#
#
#
exe_name=$(basename $0)
# check the last n patches patches from the current branch for errors
# usage: maintainer-checkpatch.bash [(-n <num commits>) | (-c <commit>)] [-s]
# where: -n <num commits> selects the last n commits (default: 1)
# -c <commit> selects the "since" com... | /content/code_sandbox/scripts/checkpatch/maintainer-checkpatch.bash | shell | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 650 |
```unknown
_cpu_arch_t
k_mem_partition_attr_t
k_timepoint_t
mbedtls_pk_context
z_arch_esf_t
pinctrl_soc_pin_t
io_rw_32
\b[a-zA-Z_][a-zA-Z0-9_]*TypeDef
Pwm
FILE
``` | /content/code_sandbox/scripts/checkpatch/typedefsfile | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 60 |
```shell
#!/usr/bin/env bash
#
#
#
# crawls the source tree to find out the amount of checkpatch issues
# and optionally update scripts/known_checkpatch_issues
# usage: check_known_checkpatch_issues.sh [-u]
# where: -u updates the known_checkpatch_issues db and commits it
# -q is the quiet mode (don't display... | /content/code_sandbox/scripts/checkpatch/check_known_checkpatch_issues.sh | shell | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,057 |
```yaml
# This file contains information on what files are associated with which
# twister tag.
#
# File format
# ###########
#
# "tag" (the quotes are only needed for titles with special characters,
# like colons):
# files:
# List of paths and/or glob patterns giving the files in the tag,
# relati... | /content/code_sandbox/scripts/ci/tags.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 628 |
```python
#!/usr/bin/env python3
#
#
"""Check minimal libc error numbers against newlib.
This script loads the errno.h included in Zephyr's minimal libc and checks its
contents against the SDK's newlib errno.h. This is done to ensure that both C
libraries are aligned at all times.
"""
import os
from pathlib import ... | /content/code_sandbox/scripts/ci/errno.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 393 |
```python
#!/usr/bin/env python3
# This script upload test ci results to the zephyr ES instance for reporting and analysis.
# see path_to_url
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
import sys
import os
import json
import argparse
def gendata(f, index, run_date=None, run_id=N... | /content/code_sandbox/scripts/ci/upload_test_results_es.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 723 |
```python
#!/usr/bin/env python3
import os
import json
import argparse
from opensearchpy import OpenSearch
from opensearchpy.helpers import bulk
host = "dashboards.staging.zephyrproject.io"
port = 443
def main():
args = parse_args()
if args.user and args.password:
auth = (args.user, args.password)
... | /content/code_sandbox/scripts/ci/upload_test_results.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 357 |
```python
#!/usr/bin/env python3
"""
Syntax of file:
[
{
"version": "<commit>",
"date": "<date>",
"weekly: False,
},
]
"""
import json
import argparse
import urllib.request
import os
import tempfile
from git import Git
from datetime import datetime
VERSIONS... | /content/code_sandbox/scripts/ci/version_mgr.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 976 |
```python
#!/usr/bin/env python3
import argparse
import collections
from email.utils import parseaddr
import json
import logging
import os
from pathlib import Path
import re
import subprocess
import sys
import tempfile
import traceback
import shlex
import shutil
import textwrap
import unidiff
from yamllint import co... | /content/code_sandbox/scripts/ci/check_compliance.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15,803 |
```unknown
# pylint configuration for the PyLint check in check_compliance.py.
#
# To run pylint manually with this configuration from the Zephyr repo, do
#
# pylint3 --rcfile=ci-tools/scripts/pylintrc <Python file>
#
# This command will check all scripts:
#
# pylint3 --rcfile=ci-tools/scripts/pylintrc $(git l... | /content/code_sandbox/scripts/ci/pylintrc | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,578 |
```python
#!/usr/bin/env python3
import os
import sh
import argparse
import re
from unidiff import PatchSet
if "ZEPHYR_BASE" not in os.environ:
exit("$ZEPHYR_BASE environment variable undefined.")
RESERVED_NAMES_SCRIPT = "/scripts/coccinelle/reserved_names.cocci"
coccinelle_scripts = [RESERVED_NAMES_SCRIPT,
... | /content/code_sandbox/scripts/ci/guideline_check.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 874 |
```unknown
# Kconfig top-level ci for compliance testing Kconfig tree for boards / SoC v2 scheme.
#
#
mainmenu "Zephyr board / SoC v2 Configuration"
source "boards/Kconfig.v2"
source "soc/Kconfig.v2"
``` | /content/code_sandbox/scripts/ci/Kconfig.board.v2 | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 54 |
```python
#!/usr/bin/env python3
# Script that operates on a merged PR and sends data to elasticsearch for
# further insepctions using the PR dashboard at
# path_to_url
import sys
import os
from github import Github
import argparse
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from da... | /content/code_sandbox/scripts/ci/stats/merged_prs.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,499 |
```python
#!/usr/bin/env python3
# A script to generate twister options based on modified files.
import re, os
import argparse
import yaml
import fnmatch
import subprocess
import json
import logging
import sys
import glob
from pathlib import Path
from git import Repo
from west.manifest import Manifest
try:
from ... | /content/code_sandbox/scripts/ci/test_plan.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 4,323 |
```python
#!/usr/bin/env python3
'''
This script uses edtlib and the devicetree data in the build directory
to generate a CMake file which contains devicetree data.
That data can then be used in the rest of the build system.
The generated CMake file looks like this:
add_custom_target(devicetree_target)
set_tar... | /content/code_sandbox/scripts/dts/gen_dts_cmake.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,336 |
```python
#!/usr/bin/env python3
#
#
import argparse
import os
import sys
import re
import yaml
try:
# Use the C LibYAML parser if available, rather than the Python parser.
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader # type: ignore
sys.path.insert(0, os.... | /content/code_sandbox/scripts/dts/gen_driver_kconfig_dts.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 646 |
```python
import yaml
import ijson
import json
import re
import argparse
import xlsxwriter
class Json_report:
json_object = {
"components":[]
}
simulators = [
'unit_testing',
'native',
'qemu',
'mps2/an385'
]
report_json = {}
def __init__(self):
... | /content/code_sandbox/scripts/ci/coverage/coverage_analysis.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 4,537 |
```ini
[tox]
envlist=py3
[testenv]
deps =
setuptools-scm
pytest
types-PyYAML
mypy
setenv =
TOXTEMPDIR={envtmpdir}
commands =
python -m pytest {posargs:tests}
python -m mypy --config-file={toxinidir}/tox.ini --package=devicetree
[mypy]
mypy_path=src
ignore_missing_imports=True
``` | /content/code_sandbox/scripts/dts/python-devicetree/tox.ini | ini | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 100 |
```python
#
import setuptools
long_description = '''
Placeholder
===========
This is just a placeholder for moving Zephyr's devicetree libraries
to PyPI.
'''
version = '0.0.2'
setuptools.setup(
# TBD, just use these for now.
author='Zephyr Project',
author_email='devel@lists.zephyrproject.org',
na... | /content/code_sandbox/scripts/dts/python-devicetree/setup.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 238 |
```unknown
/*
*
*/
// Used by testedtlib.py
/dts-v1/;
/ {
//
// Interrupts
//
interrupt-parent-test {
controller {
compatible = "interrupt-three-cell";
#interrupt-cells = <3>;
interrupt-controller;
};
node {
interrupts = <1 2 3 4 5 6>;
interrupt-names = "foo", "bar";
interrupt-parent =... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,876 |
```python
#!/usr/bin/env python3
# This script uses edtlib to generate a header file from a devicetree
# (.dts) file. Information from binding files in YAML format is used
# as well.
#
# Bindings are files that describe devicetree nodes. Devicetree nodes are
# usually mapped to bindings via their 'compatible = "..."'... | /content/code_sandbox/scripts/dts/gen_defines.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10,785 |
```unknown
/*
*
*/
/*
* Used by test_edtlib.py. Dedicated file for testing having multiple binding
* directories.
*/
/dts-v1/;
/ {
in-dir-1 {
compatible = "in-dir-1";
};
in-dir-2 {
compatible = "in-dir-2";
};
};
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-multidir.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 69 |
```python
import contextlib
import os
import re
import tempfile
from copy import deepcopy
from typing import Optional
import pytest
from devicetree import dtlib
# Test suite for dtlib.py.
#
# Run it using pytest (path_to_url
#
# $ pytest tests/test_dtlib.py
#
# Extra options you can pass to pytest for debugging:
... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test_dtlib.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16,109 |
```yaml
description: Device.wrong_phandle_array_name test
compatible: "wrong_phandle_array_name"
properties:
wrong-phandle-array-name:
type: phandle-array
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-wrong-bindings/wrong-phandle-array-name.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 38 |
```yaml
description: Device.wrong_specifier_space_type test
compatible: "wrong_specifier_space_type"
properties:
wrong-type-for-specifier-space:
type: phandle
specifier-space: foobar
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-wrong-bindings/wrong-specifier-space-type.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```yaml
description: An empty property-allowlist is valid.
compatible: empty-allowlist
include:
- name: include.yaml
property-allowlist: []
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/empty-allowlist.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```yaml
description: An empty property-blocklist is valid.
compatible: empty-blocklist
include:
- name: include.yaml
property-blocklist: []
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/empty-blocklist.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
description: |
Top-level binding file for testing included property spec paths.
base.yaml: specifies properties "x" and "y"
modified.yaml: includes base.yaml, modifies property "x"
top.yaml (this file): includes modified.yaml, specifies property "p"
From the top-level binding, we expect:
- "x" wa... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/top.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 125 |
```python
import contextlib
from copy import deepcopy
import io
from logging import WARNING
import os
from pathlib import Path
import pytest
from devicetree import edtlib
# Test suite for edtlib.py.
#
# Run it using pytest (path_to_url
#
# $ pytest testedtlib.py
#
# See the comment near the top of testdtlib.py fo... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test_edtlib.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10,178 |
```yaml
description: |
Includes can be added at any level, so can property-allowlist and
property-blocklist.
compatible: allow-and-blocklist-multilevel
include:
- name: include.yaml
property-allowlist: [x]
child-binding:
include:
- name: include.yaml
property-blocklist: [y]
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/allow-and-blocklist-multilevel.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 76 |
```yaml
description: |
A property-blocklist, if given, must be a list. This binding should
cause an error.
compatible: block-not-list
include:
- name: include.yaml
property-blocklist:
foo:
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/block-not-list.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```yaml
description: |
An include must not give both an allowlist and a blocklist.
This binding should cause an error.
compatible: allow-and-blocklist
include:
- name: include.yaml
property-blocklist: [x]
property-allowlist: [y]
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/allow-and-blocklist.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 61 |
```yaml
description: Test file for including other bindings
compatible: include
properties:
x:
type: int
y:
type: int
z:
type: int
child-binding:
properties:
child-prop-1:
type: int
child-prop-2:
type: int
child-binding:
properties:
grandchild-prop-1:
type: ... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/include.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 100 |
```yaml
description: |
Invalid include element: no name key is present.
compatible: include-no-name
include:
- property-allowlist: [x]
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/include-no-name.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 34 |
```yaml
description: Valid property-allowlist.
compatible: allowlist
include:
- name: include.yaml
property-allowlist: [x]
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/allowlist.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
description: |
Invalid include element: invalid keys are present.
compatible: include-invalid-keys
include:
- name: include.yaml
property-allowlist: [x]
bad-key-1: 3
bad-key-2: 3
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/include-invalid-keys.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 57 |
```yaml
description: |
A property-allowlist, if given, must be a list. This binding should
cause an error.
compatible: allow-not-list
include:
- name: include.yaml
property-allowlist:
foo:
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/allow-not-list.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 53 |
```yaml
description: Valid property-blocklist.
compatible: blocklist
include:
- name: include.yaml
property-blocklist: [x]
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/blocklist.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```yaml
description: Second file for testing "intermixed" includes.
compatible: include-2
properties:
a:
type: int
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/include-2.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```yaml
properties:
x:
type: int
y:
type: int
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/base.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```restructuredtext
This directory contains bindings used to test the 'include:' feature.
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```yaml
include: base.yaml
properties:
x:
required: true
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/modified.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```yaml
description: Test binding for filtering 'child-binding' properties
include:
- name: include.yaml
property-allowlist: [x]
child-binding:
property-blocklist: [child-prop-1]
child-binding:
property-allowlist: [grandchild-prop-1]
compatible: filter-child-bindings
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/filter-child-bindings.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 70 |
```yaml
description: |
Invalid include: wrong top level type.
compatible: include-invalid-type
include:
a-map-is-not-allowed-here: 3
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/include-invalid-type.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 34 |
```yaml
include: base.yaml
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/inc-base.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 7 |
```yaml
description: |
An include must not give both an allowlist and a blocklist in a
child binding. This binding should cause an error.
compatible: allow-and-blocklist-child
include:
- name: include.yaml
child-binding:
property-blocklist: [x]
property-allowlist: [y]
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/allow-and-blocklist-child.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 71 |
```yaml
description: A map element with just a name is valid, and has no filters.
compatible: include-no-list
include:
- name: include.yaml
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/include-no-list.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 34 |
```yaml
description: Test property-blocklist filters set by including bindings.
compatible: "top-blocklist"
include:
- name: inc-base.yaml
property-blocklist:
- x
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/top-blocks.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```yaml
description: Test property-allowlist filters set by including bindings
compatible: "top-allowlist"
include:
- name: inc-base.yaml
property-allowlist:
- x
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/top-allows.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 43 |
```yaml
description: Including intermixed file names and maps is valid.
compatible: intermixed
include:
- name: include.yaml
property-allowlist: [x]
- include-2.yaml
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings-include/intermixed.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```yaml
description: Property deprecated value test
compatible: "test-deprecated"
properties:
oldprop:
type: int
deprecated: true
required: false
curprop:
type: int
required: false
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/deprecated.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```yaml
description: child-binding test
compatible: "top-binding"
child-binding:
description: child node
properties:
child-prop:
type: int
required: true
child-ref:
type: phandle
child-binding:
description: grandchild node
properties:
grandchild-prop:
type: int
... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/child-binding.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 90 |
```yaml
description: Device on any bus
compatible: "on-any-bus"
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/device-on-any-bus.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```yaml
description: Binding in test-bindings/
compatible: "in-dir-1"
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/multidir.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```yaml
description: Controller with one data value
compatible: "phandle-array-controller-1"
phandle-array-foo-cells:
- one
gpio-cells:
- gpio-one
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/phandle-array-controller-1.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 41 |
```yaml
description: Controller with zero data values
compatible: "phandle-array-controller-0"
phandle-array-foo-cells: []
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/phandle-array-controller-0.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 29 |
```yaml
description: GPIO source for mapping test
compatible: "gpio-src"
properties:
foo-gpios:
type: phandle-array
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/gpio-src.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```yaml
description: Foo bus controller
compatible: "foo-bus"
bus: "foo"
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/foo-bus.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```yaml
description: Bar bus controller
compatible: "bar-bus"
bus: "bar"
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/bar-bus.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```yaml
description: Interrupt controller with three cells
compatible: "interrupt-three-cell"
interrupt-cells:
- one
- two
- three
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/interrupt-3-cell.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
description: Parent binding
compatible: "binding-include-test"
include: child.yaml
properties:
foo:
# Changed from not being required in grandchild-1.yaml
required: true
# Type set in grandchild
child-binding:
# child.yaml included at child-binding level
include: child.yaml
properties:... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/parent.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```yaml
properties:
qaz:
required: true
type: int
``` | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/grandchild-3.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```yaml
description: child-binding with separate compatible than the parent
compatible: "top-binding-with-compat"
child-binding:
compatible: child-compat
description: child node
properties:
child-prop:
type: int
required: true
child-binding:
description: grandchild node
properties:
... | /content/code_sandbox/scripts/dts/python-devicetree/tests/test-bindings/child-binding-with-compat.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.