Skip to content

Commit

Permalink
Revert "sanitycheck: remove import of dt kconfig symbols"
Browse files Browse the repository at this point in the history
PR zephyrproject-rtos#20204 broke master for boards without DTS
PR zephyrproject-rtos#20365 tried to partially fix it, but the filtering in
sanitycheck remained broken
Let's quickly revert it to allow other PRs to come in,
and then resubmit them in a separate PR.

This reverts commit 9b5720d.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
  • Loading branch information
aescolar committed Nov 6, 2019
1 parent a80fbe9 commit a3c33d6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/sanitycheck
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ class CMake():

self.defconfig = {}
self.cmake_cache = {}
self.devicetree = {}

self.instance = None
self.testcase = testcase
Expand Down Expand Up @@ -1862,7 +1863,10 @@ class FilterBuilder(CMake):
if self.platform.name == "unit_testing":
return {}

_generated_dt_confg = "include/generated/generated_dts_board.conf"

cmake_cache_path = os.path.join(self.build_dir, "CMakeCache.txt")
dt_config_path = os.path.join(self.build_dir, "zephyr", _generated_dt_confg)
defconfig_path = os.path.join(self.build_dir, "zephyr", ".config")

with open(defconfig_path, "r") as fp:
Expand All @@ -1888,13 +1892,26 @@ class FilterBuilder(CMake):

self.cmake_cache = cmake_conf

dt_conf = {}
if os.path.exists(dt_config_path):
with open(dt_config_path, "r") as fp:
for line in fp.readlines():
m = self.dt_re.match(line)
if not m:
if line.strip() and not line.startswith("#"):
sys.stderr.write("Unrecognized line %s\n" % line)
continue
dt_conf[m.group(1)] = m.group(2).strip()
self.devicetree = dt_conf

filter_data = {
"ARCH": self.platform.arch,
"PLATFORM": self.platform.name
}
filter_data.update(os.environ)
filter_data.update(self.defconfig)
filter_data.update(self.cmake_cache)
filter_data.update(self.devicetree)

if self.testcase and self.testcase.tc_filter:
try:
Expand Down

0 comments on commit a3c33d6

Please sign in to comment.