summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-08-10 11:55:06 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-11 02:42:37 +0000
commitbbf00434d68f9433727a231ea41128cbcca53a25 (patch)
treef36bdfac7ad523a91bccaa5bb4e57913e027d988
parentd8b43b5c98a6ab10bfe3ab6e3d6cd7dd90aef9a9 (diff)
downloadchrome-ec-bbf00434d68f9433727a231ea41128cbcca53a25.tar.gz
zephyr: zmake: drop "print-versions" subcommand
This command was intended for use in ebuild, but never instrumented. Remove the dead code. BUG=b:195571108 BRANCH=none TEST=zephyr/zmake/run_tests.sh Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I68d3da2e4dfdb4a44b5a58d2b8e2c01da373c06f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3086366 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/zmake/tests/test_print_versions.py38
-rw-r--r--zephyr/zmake/zmake/__main__.py5
-rw-r--r--zephyr/zmake/zmake/zmake.py7
3 files changed, 0 insertions, 50 deletions
diff --git a/zephyr/zmake/tests/test_print_versions.py b/zephyr/zmake/tests/test_print_versions.py
deleted file mode 100644
index f65fa569a3..0000000000
--- a/zephyr/zmake/tests/test_print_versions.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2021 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import pathlib
-import tempfile
-
-import zmake.zmake as zm
-
-
-def generate_zmake_yaml(dest, versions):
- with open(dest, "w") as f:
- f.write("board: test\n")
- f.write("output-type: elf\n")
- f.write("toolchain: llvm\n")
- f.write("supported-zephyr-versions:\n")
- for version in versions:
- f.write(" - {}\n".format(version))
-
-
-def test_single_version(capsys):
- with tempfile.TemporaryDirectory() as temp_dir_name:
- generate_zmake_yaml(pathlib.Path(temp_dir_name) / "zmake.yaml", ["v2.5"])
- zm.Zmake().print_versions(temp_dir_name)
- captured = capsys.readouterr().out.splitlines()
- assert captured == ["v2.5"]
-
-
-def test_multiple_versions(capsys):
- with tempfile.TemporaryDirectory() as temp_dir_name:
- generate_zmake_yaml(
- pathlib.Path(temp_dir_name) / "zmake.yaml", ["v2.5", "v2.6"]
- )
- zm.Zmake().print_versions(temp_dir_name)
- captured = capsys.readouterr().out.splitlines()
- # Compare the sorted lists since we don't guarantee anything about the
- # print order
- assert sorted(captured) == sorted(["v2.5", "v2.6"])
diff --git a/zephyr/zmake/zmake/__main__.py b/zephyr/zmake/zmake/__main__.py
index 9ee8e57a2c..74845d9bbc 100644
--- a/zephyr/zmake/zmake/__main__.py
+++ b/zephyr/zmake/zmake/__main__.py
@@ -105,11 +105,6 @@ def main(argv=None):
sub = parser.add_subparsers(dest="subcommand", help="Subcommand")
sub.required = True
- print_versions = sub.add_parser("print-versions")
- print_versions.add_argument(
- "project_dir", type=pathlib.Path, help="Path to the project to build"
- )
-
configure = sub.add_parser("configure")
configure.add_argument(
"--ignore-unsupported-zephyr-version",
diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py
index baaced8ca8..45e23fd904 100644
--- a/zephyr/zmake/zmake/zmake.py
+++ b/zephyr/zmake/zmake/zmake.py
@@ -193,13 +193,6 @@ class Zmake:
return util.locate_zephyr_base(self.checkout, version)
- def print_versions(self, project_dir):
- """Print all the supported versions for a project directory"""
- project = zmake.project.Project(pathlib.Path(project_dir))
- supported_versions = project.config.supported_zephyr_versions
- for version in supported_versions:
- print("v{}.{}".format(*version[:2]))
-
def configure(
self,
project_dir,