aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-04-24 11:15:11 -0700
committerMartin Braun <martin.braun@ettus.com>2019-04-25 10:46:44 -0700
commit600f655e8e13c934873ad72a9228f1cfb28c05bc (patch)
tree8b1f320a160f315b21a75aa036bb1cfdddf57253 /host/tests
parentf6f2e96116164d416387d828121fb330d5108b05 (diff)
downloaduhd-600f655e8e13c934873ad72a9228f1cfb28c05bc.tar.gz
uhd-600f655e8e13c934873ad72a9228f1cfb28c05bc.tar.bz2
uhd-600f655e8e13c934873ad72a9228f1cfb28c05bc.zip
tests: Make the Python interpreter for devtests a parameter
When running 'make test_***', it now also defaults to RUNTIME_PYTHON_EXECUTABLE.
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/devtest/CMakeLists.txt3
-rwxr-xr-xhost/tests/devtest/run_testsuite.py11
2 files changed, 8 insertions, 6 deletions
diff --git a/host/tests/devtest/CMakeLists.txt b/host/tests/devtest/CMakeLists.txt
index c74b74a99..3b17f38d1 100644
--- a/host/tests/devtest/CMakeLists.txt
+++ b/host/tests/devtest/CMakeLists.txt
@@ -23,12 +23,13 @@ UHD_INSTALL(PROGRAMS
macro(ADD_DEVTEST pattern filter devtype)
message(STATUS "Adding ${devtype} device test target")
add_custom_target("test_${pattern}"
- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_testsuite.py
+ ${RUNTIME_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_testsuite.py
"--src-dir" "${CMAKE_CURRENT_SOURCE_DIR}"
"--devtest-pattern" "${pattern}"
"--device-filter" "${filter}"
"--build-type" "${CMAKE_BUILD_TYPE}"
"--build-dir" "${CMAKE_BINARY_DIR}"
+ "--python-interp" "${RUNTIME_PYTHON_EXECUTABLE}"
COMMENT "Running device test on all connected ${devtype} devices:"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
diff --git a/host/tests/devtest/run_testsuite.py b/host/tests/devtest/run_testsuite.py
index 99871b150..9f557a946 100755
--- a/host/tests/devtest/run_testsuite.py
+++ b/host/tests/devtest/run_testsuite.py
@@ -21,11 +21,13 @@ def setup_parser():
""" Set up argparser """
parser = argparse.ArgumentParser(description="Test utility for UHD/USRP.")
parser.add_argument('--devtest-pattern', '-p', default='*', help='e.g. b2xx')
- parser.add_argument('--device-filter', '-f', default=None, required=True, help='b200, x300, ...')
+ parser.add_argument('--device-filter', '-f', required=True, help='b200, x300, ...')
parser.add_argument('--log-dir', '-l', default='.')
- parser.add_argument('--src-dir', default='.', help='Directory where the test sources are stored')
- parser.add_argument('--build-dir', default=None, help='Build dir (where examples/ and utils/ are)')
+ parser.add_argument('--src-dir', default='.',
+ help='Directory where the test sources are stored')
+ parser.add_argument('--build-dir', help='Build dir (where examples/ and utils/ are)')
parser.add_argument('--build-type', default='Release')
+ parser.add_argument('--python-interp', default=sys.executable)
return parser
def setup_env(args):
@@ -114,7 +116,7 @@ def main():
env['_UHD_DEVTEST_SRC_DIR'] = str(args.src_dir)
proc = subprocess.Popen(
[
- "python", "-m", "unittest", "discover", "-v",
+ args.python_interp, "-m", "unittest", "discover", "-v",
"-s", args.src_dir,
"-p", devtest_pattern,
],
@@ -133,4 +135,3 @@ def main():
if __name__ == "__main__":
exit(not main())
-