diff mbox

[U-Boot,2/6] test/py: parse include/autoconf.mk for config options

Message ID 1447816804-6312-3-git-send-email-swarren@wwwdotorg.org
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren Nov. 18, 2015, 3:20 a.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Many config options aren't yet converted to Kconfig. Update the test
scripts to parse include/autoconf.mk to pick up the non-converted
options. This will allow tests to be marked as depending on those
options.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 test/py/conftest.py | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

Comments

Tom Rini Nov. 23, 2015, 11:44 p.m. UTC | #1
On Tue, Nov 17, 2015 at 08:20:00PM -0700, Stephen Warren wrote:

> From: Stephen Warren <swarren@nvidia.com>
> 
> Many config options aren't yet converted to Kconfig. Update the test
> scripts to parse include/autoconf.mk to pick up the non-converted
> options. This will allow tests to be marked as depending on those
> options.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/test/py/conftest.py b/test/py/conftest.py
index da8618ba998c..27f6f4d69c15 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -98,17 +98,20 @@  def pytest_configure(config):
                 continue
             ubconfig.__dict__[k] = v
 
-    dot_config = build_dir + "/.config"
-    if not os.path.exists(dot_config):
-        raise Exception(".config file does not exist; " +
-            "try passing --build option?")
-
-    with open(dot_config, "rt") as f:
-        ini_str = "[root]\n" + f.read()
-        ini_sio = StringIO.StringIO(ini_str)
-        parser = ConfigParser.RawConfigParser()
-        parser.readfp(ini_sio)
-        ubconfig.buildconfig = dict(parser.items("root"))
+    ubconfig.buildconfig = dict()
+
+    for conf_file in (".config", "include/autoconf.mk"):
+        dot_config = build_dir + "/" + conf_file
+        if not os.path.exists(dot_config):
+            raise Exception(conf_file + " does not exist; " +
+                "try passing --build option?")
+
+        with open(dot_config, "rt") as f:
+            ini_str = "[root]\n" + f.read()
+            ini_sio = StringIO.StringIO(ini_str)
+            parser = ConfigParser.RawConfigParser()
+            parser.readfp(ini_sio)
+            ubconfig.buildconfig.update(parser.items("root"))
 
     ubconfig.test_py_dir = test_py_dir
     ubconfig.source_dir = source_dir