osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40841?usp=email )
Change subject: testenv/osmo-dev: split get_targets to own func ......................................................................
testenv/osmo-dev: split get_targets to own func
Split the code for getting osmo-dev targets into a separate function, so this can be reused in the next patch.
Change-Id: I2bd7c05102ca472614289870957cdca335c01eaf --- M _testenv/testenv/osmo_dev.py 1 file changed, 16 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/40841/1
diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py index fd5fa4e..8f9667e 100644 --- a/_testenv/testenv/osmo_dev.py +++ b/_testenv/testenv/osmo_dev.py @@ -51,6 +51,21 @@ sys.exit(1)
+def get_targets(cfg): + ret = [] + + for section in cfg: + section_data = cfg[section] + if section == "testsuite": + # Gets built with testenv.testsuite.build() + continue + + if "make" in section_data and section_data["make"] != "no" and section_data["make"] not in ret: + ret += [section_data["make"]] + + return ret + + def init(): global init_done
@@ -100,17 +115,7 @@
def make(cfg): - targets = [] - - for section in cfg: - section_data = cfg[section] - if section == "testsuite": - # Gets built with testenv.testsuite.build() - continue - - if "make" in section_data and section_data["make"] != "no" and section_data["make"] not in targets: - targets += [section_data["make"]] - + targets = get_targets(cfg) if not targets: logging.debug("No osmo-dev make targets found in testenv.cfg") return