diff options
-rw-r--r-- | docs/zephyr/project_config.md | 8 | ||||
-rwxr-xr-x | zephyr/firmware_builder.py | 4 | ||||
-rw-r--r-- | zephyr/zmake/README.md | 42 | ||||
-rw-r--r-- | zephyr/zmake/tests/test_generate_readme.py | 2 | ||||
-rw-r--r-- | zephyr/zmake/tests/test_project.py | 11 | ||||
-rw-r--r-- | zephyr/zmake/tests/test_zmake.py | 4 | ||||
-rw-r--r-- | zephyr/zmake/zmake/__main__.py | 34 | ||||
-rw-r--r-- | zephyr/zmake/zmake/compare_builds.py | 3 | ||||
-rw-r--r-- | zephyr/zmake/zmake/configlib.py | 8 | ||||
-rw-r--r-- | zephyr/zmake/zmake/project.py | 3 | ||||
-rw-r--r-- | zephyr/zmake/zmake/zmake.py | 40 |
11 files changed, 12 insertions, 147 deletions
diff --git a/docs/zephyr/project_config.md b/docs/zephyr/project_config.md index f81cc083c9..27b5a7414d 100644 --- a/docs/zephyr/project_config.md +++ b/docs/zephyr/project_config.md @@ -222,12 +222,6 @@ When `BUILD.py` is sourced, the following two globals are defined: unnecessary modules as modules are typically guarded by Kconfig options, so the only reason to set this is if your project needs to build in a limited environment where not all modules are available. -- `is_test` (optional): `True` if the code should be executed as a - test after compilation, `False` otherwise. Defaults to `False`. -- `test_args` (optional): A list of command line arguments that should - be used when running the test. Instances of `{test_temp_dir}` - inside of an argument will be replaced with a path to a temporary - directory guaranteed to be unique for the current execution. - `dts_overlays` (optional): A list of files which should be concatenated together and applied as a Zephyr device-tree overlay. The recommended setting is to select the **project** specific devicetree overlay file. @@ -253,8 +247,6 @@ more defaults for you: - `register_host_project`: Define a project which runs in the chroot (not on hardware). -- `register_host_test`: Just like `register_host_project`, but - `is_test` gets set to `True`. - `register_raw_project`: Register a project which builds a single `.bin` file, no RO+RW packing, no FMAP. - `register_binman_project`: Register a project which builds RO and RW diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py index 0ccdf38aa1..a760855cc0 100755 --- a/zephyr/firmware_builder.py +++ b/zephyr/firmware_builder.py @@ -91,8 +91,6 @@ def build(opts): subprocess.run(cmd, cwd=zephyr_dir, check=True, stdin=subprocess.DEVNULL) if not opts.code_coverage: for project in zmake.project.find_projects(zephyr_dir).values(): - if project.config.is_test: - continue build_dir = ( platform_ec / "build" / "zephyr" / project.config.project_name ) @@ -217,8 +215,6 @@ def bundle_firmware(opts): zephyr_dir = pathlib.Path(__file__).parent.resolve() platform_ec = zephyr_dir.parent for project in zmake.project.find_projects(zephyr_dir).values(): - if project.config.is_test: - continue build_dir = ( platform_ec / "build" / "zephyr" / project.config.project_name ) diff --git a/zephyr/zmake/README.md b/zephyr/zmake/README.md index 196e9bde8f..c5de8c9b0f 100644 --- a/zephyr/zmake/README.md +++ b/zephyr/zmake/README.md @@ -126,48 +126,6 @@ Chromium OS's meta-build tool for Zephyr | `-h`, `--help` | show this help message and exit | | `--format FMT` | Output format to print projects (str.format(config=project.config) is called on this for each project). | -### zmake test - -**Usage:** `zmake test [-h] [--no-rebuild] [--bringup] [--clobber] [--static] [--save-temps] [--allow-warnings] [-B BUILD_DIR] [-c] [--delete-intermediates] [-D CMAKE_DEFS] [-t TOOLCHAIN] [--extra-cflags EXTRA_CFLAGS] (-a | project_name [project_name ...])` - -#### Positional Arguments - -| | | -|---|---| -| `project_name` | Name(s) of the project(s) to build | - -#### Optional Arguments - -| | | -|---|---| -| `-h`, `--help` | show this help message and exit | -| `--no-rebuild` | Do not configure or build before running tests. | -| `--bringup` | Enable bringup debugging features | -| `--clobber` | Delete existing build directories, even if configuration is unchanged | -| `--static` | Generate static version information for reproducible builds | -| `--save-temps` | Save the temporary files containing preprocessor output | -| `--allow-warnings` | Do not treat warnings as errors | -| `-B BUILD_DIR`, `--build-dir BUILD_DIR` | Root build directory, project files will be in ${build_dir}/${project_name} | -| `-c`, `--coverage` | Enable CONFIG_COVERAGE Kconfig. | -| `--delete-intermediates` | Delete intermediate files to save disk space | -| `-D CMAKE_DEFS`, `--cmake-define CMAKE_DEFS` | None | -| `-t TOOLCHAIN`, `--toolchain TOOLCHAIN` | Name of toolchain to use | -| `--extra-cflags EXTRA_CFLAGS` | Additional CFLAGS to use for target builds | -| `-a`, `--all` | Select all projects | - -### zmake testall - -**Usage:** `zmake testall [-h] [--clobber] [-B BUILD_DIR] [--static]` - -#### Optional Arguments - -| | | -|---|---| -| `-h`, `--help` | show this help message and exit | -| `--clobber` | Delete existing build directories, even if configuration is unchanged | -| `-B BUILD_DIR`, `--build-dir BUILD_DIR` | Build directory | -| `--static` | Generate static version information for reproducible builds | - ### zmake generate-readme **Usage:** `zmake generate-readme [-h] [-o OUTPUT_FILE] [--diff]` diff --git a/zephyr/zmake/tests/test_generate_readme.py b/zephyr/zmake/tests/test_generate_readme.py index e7873f1980..290d6d7b31 100644 --- a/zephyr/zmake/tests/test_generate_readme.py +++ b/zephyr/zmake/tests/test_generate_readme.py @@ -15,7 +15,7 @@ def test_generate_readme_contents(): readme = gen_readme.generate_readme() # Look for a string we know should appear in the README. - assert "### zmake testall\n" in readme + assert "### zmake build\n" in readme @pytest.mark.parametrize( diff --git a/zephyr/zmake/tests/test_project.py b/zephyr/zmake/tests/test_project.py index 661072959d..327d119bad 100644 --- a/zephyr/zmake/tests/test_project.py +++ b/zephyr/zmake/tests/test_project.py @@ -136,7 +136,7 @@ def test_find_projects_empty(tmp_path): CONFIG_FILE_1 = """ register_raw_project(project_name="one", zephyr_board="one") -register_host_test(test_name="two") +register_host_project(project_name="two") register_npcx_project(project_name="three", zephyr_board="three") register_binman_project(project_name="four", zephyr_board="four") """ @@ -165,22 +165,17 @@ def test_find_projects(tmp_path): projects = zmake.project.find_projects(tmp_path) assert len(projects) == 5 assert projects["one"].config.project_dir == cf1_dir - assert not projects["one"].config.is_test - assert projects["test-two"].config.project_dir == cf1_dir - assert projects["test-two"].config.zephyr_board == "native_posix" - assert projects["test-two"].config.is_test + assert projects["two"].config.project_dir == cf1_dir + assert projects["two"].config.zephyr_board == "native_posix" assert projects["three"].config.project_dir == cf1_dir - assert not projects["three"].config.is_test assert projects["three"].config.zephyr_board == "three" assert projects["four"].config.project_dir == cf1_dir - assert not projects["four"].config.is_test assert projects["four"].config.zephyr_board == "four" assert projects["five"].config.project_dir == cf2_dir - assert not projects["five"].config.is_test assert projects["five"].config.zephyr_board == "foo" diff --git a/zephyr/zmake/tests/test_zmake.py b/zephyr/zmake/tests/test_zmake.py index 3cccfe5aa4..ca6632e075 100644 --- a/zephyr/zmake/tests/test_zmake.py +++ b/zephyr/zmake/tests/test_zmake.py @@ -271,9 +271,9 @@ class TestFilters: ), ( ["link"], - "{config.project_name} is_test={config.is_test}\n", + "{config.project_name} {config.zephyr_board}\n", None, - "link is_test=False\n", + "link some_board\n", ), ], ) diff --git a/zephyr/zmake/zmake/__main__.py b/zephyr/zmake/zmake/__main__.py index 900c5fb5c5..b34922271f 100644 --- a/zephyr/zmake/zmake/__main__.py +++ b/zephyr/zmake/zmake/__main__.py @@ -244,40 +244,6 @@ def get_argparser(): ), ) - # TODO(b/b/242563072): Remove stub support for test and testall entirely after users have gotten - # used to twister. - test = sub.add_parser( - "test", - help="Configure, build and run tests on specified projects; DEPRECATED", - ) - test.add_argument( - "--no-rebuild", - action="store_true", - help="Do not configure or build before running tests.", - ) - add_common_configure_args(test) - add_common_build_args(test) - - testall = sub.add_parser( - "testall", - help="Alias for test --all; DEPRECATED", - ) - testall.add_argument( - "--clobber", - action="store_true", - dest="clobber", - help="Delete existing build directories, even if configuration is unchanged", - ) - testall.add_argument( - "-B", "--build-dir", type=pathlib.Path, help="Build directory" - ) - testall.add_argument( - "--static", - action="store_true", - dest="static_version", - help="Generate static version information for reproducible builds", - ) - generate_readme = sub.add_parser( "generate-readme", help="Update the auto-generated markdown documentation", diff --git a/zephyr/zmake/zmake/compare_builds.py b/zephyr/zmake/zmake/compare_builds.py index a1cc1ee953..6f1f804f68 100644 --- a/zephyr/zmake/zmake/compare_builds.py +++ b/zephyr/zmake/zmake/compare_builds.py @@ -108,9 +108,6 @@ def create_bin_from_elf(elf_input, bin_output): def _compare_non_test_projects(projects, cmp_method, *args): failed_projects = [] for project in projects: - if project.config.is_test: - continue - if not cmp_method(project, *args): failed_projects.append(project.config.project_name) diff --git a/zephyr/zmake/zmake/configlib.py b/zephyr/zmake/zmake/configlib.py index 2affaf08f5..ae965c7f0f 100644 --- a/zephyr/zmake/zmake/configlib.py +++ b/zephyr/zmake/zmake/configlib.py @@ -24,14 +24,6 @@ def register_host_project(**kwargs): return _register_project(**kwargs) -def register_host_test(test_name, **kwargs): - """Register a test project that runs on the host.""" - kwargs.setdefault("is_test", True) - return register_host_project( - project_name="test-{}".format(test_name), **kwargs - ) - - def register_raw_project(**kwargs): """Register a project that uses RawBinPacker.""" kwargs.setdefault("supported_toolchains", ["coreboot-sdk", "zephyr"]) diff --git a/zephyr/zmake/zmake/project.py b/zephyr/zmake/zmake/project.py index 15974af723..3c18520b55 100644 --- a/zephyr/zmake/zmake/project.py +++ b/zephyr/zmake/zmake/project.py @@ -47,14 +47,11 @@ class ProjectConfig: modules: typing.Iterable[str] = dataclasses.field( default_factory=lambda: ["ec"], ) - is_test: bool = dataclasses.field(default=False) - test_args: typing.List[str] = dataclasses.field(default_factory=list) dts_overlays: "list[str]" = dataclasses.field(default_factory=list) kconfig_files: "list[pathlib.Path]" = dataclasses.field( default_factory=list ) project_dir: pathlib.Path = dataclasses.field(default_factory=pathlib.Path) - test_timeout_secs: float = dataclasses.field(default=2 * 60) class Project: diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py index f58b07eda1..58554c9007 100644 --- a/zephyr/zmake/zmake/zmake.py +++ b/zephyr/zmake/zmake/zmake.py @@ -284,13 +284,12 @@ class Zmake: result = self.executor.wait() if result: return result - non_test_projects = [p for p in projects if not p.config.is_test] - if len(non_test_projects) > 1 and coverage and build_after_configure: + if coverage and build_after_configure: result = self.executor.wait() if result: return result result = self._merge_lcov_files( - projects=non_test_projects, + projects=projects, build_dir=build_dir, output_file=build_dir / "all_builds.info", ) @@ -433,32 +432,6 @@ class Zmake: return len(self.failed_projects) - def test( # pylint: disable=unused-argument - self, - project_names, - ): - """Build and run tests for the specified projects. - - Using zmake to run tests is no longer supported. Use twister. - """ - self.logger.error( - "zmake test is deprecated. Use twister -T zephyr/test/<test_dir>." - ) - - return 0 - - def testall( - self, - ): - """Build and run tests for all projects. - - Using zmake to run tests is no longer supported. Use twister. - """ - self.logger.error( - "zmake testall is deprecated. To build all packages, use zmake build -a." - ) - return self.test([]) - def _configure( self, project, @@ -757,9 +730,9 @@ class Zmake: if not newdir.exists(): newdir.mkdir() - # For non-tests, they won't link with coverage, so don't pack the - # firmware. Also generate a lcov file. - if coverage and not project.config.is_test: + # Projects won't link with coverage, so don't pack the firmware. + # Also generate a lcov file. + if coverage: self._run_lcov( build_dir, output_dir / "zephyr.info", @@ -801,8 +774,7 @@ class Zmake: cmd.append("-j1024") elif self._sequential: cmd.append("-j1") - # Only tests will actually build with coverage enabled. - if coverage and not project.config.is_test: + if coverage: cmd.append("all.libraries") self.logger.info( "Building %s:%s: %s", |