aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/devtest
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-06-09 17:10:39 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2020-06-10 12:46:33 -0500
commit6db281792b57e42d9c6456aa94e17e7b7d12690a (patch)
tree05ad4f3a636e1336b1445e288c08efdebc868220 /host/tests/devtest
parentf04d109936249606afe92cac4add2ecf7c73d937 (diff)
downloaduhd-6db281792b57e42d9c6456aa94e17e7b7d12690a.tar.gz
uhd-6db281792b57e42d9c6456aa94e17e7b7d12690a.tar.bz2
uhd-6db281792b57e42d9c6456aa94e17e7b7d12690a.zip
devtest: Don't skip Python API tests if Python API is enabled
One of the devtests (the python_api_test) gets skipped without failures if the uhd module can't be loaded. However, this can mask errors if the uhd module can't be loaded because it's broken. This change will verify if the uhd module should have been loaded, and throw an error if that's the case.
Diffstat (limited to 'host/tests/devtest')
-rw-r--r--host/tests/devtest/python_api_test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/tests/devtest/python_api_test.py b/host/tests/devtest/python_api_test.py
index d9fcda0b0..0e2ca45f7 100644
--- a/host/tests/devtest/python_api_test.py
+++ b/host/tests/devtest/python_api_test.py
@@ -22,6 +22,11 @@ class uhd_python_api_test(uhd_test_case):
Run test and report results.
"""
if uhd is None:
+ print("UHD module not found -- checking for Python API")
+ config_info_app = shell_application('uhd_config_info')
+ config_info_app.run(['--enabled-components'])
+ if "Python API" in config_info_app.stdout:
+ raise RuntimeError("Python API enabled, but cannot load uhd module!")
print("Skipping test, Python API not installed.")
self.report_result("python_api_tester", 'status', 'Skipped')
return