aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
Commit message (Collapse)AuthorAgeFilesLines
* host: Update code base using clang-tidyMartin Braun2021-03-171-6/+5
| | | | | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json Note: This is the same procedure as 107a49c0, but applied to all the new code since then.
* tests: Fix warnings for rf_control_gain_profile_testMartin Braun2021-03-111-4/+1
| | | | | - Remove unused const - Fix includes to IWYU and clang-format order
* lib: Fix warnings related to unnecessary lambda capturesMartin Braun2021-03-041-4/+1
|
* tests: Remove unused constantsMartin Braun2021-03-048-23/+0
| | | | This fixes some clang warnings.
* host: Update code base using clang-tidyMartin Braun2021-03-0422-111/+114
| | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
* devtest: reapply allow extra device arguments when running devtestsSteven Koo2021-02-122-2/+5
| | | | | | | | | | | | | | | | | | This change is substantially the same as 7b86a47, but implemented in a ninja supported way. ninja doesn't allow for arguments, so this uses an environment variable. This is compatible with both make and ninja. The only change from the calling point of view is you must set the environment variable before calling "make test_[devicetype]" instead of after as an arg. This allows running devtests for a single device instead of all connected devices or selecting a specific network interface. Set the additional device arguments with the EXTRA_DEV_ARGS variable. This can be set as an environment variable or on the command line. For example: EXTRA_DEV_ARGS=addr=192.168.30.2 make test_x3x0 Also-by: Matthew Crymble <matthew.crymble@ni.com> Signed-off-by: Steven Koo <steven.koo@ni.com>
* Revert "devtest: allow extra device arguments when running devtests"Matthew Crymble2021-02-082-5/+2
| | | | | This reverts commit 7b86a47bf7143df1cac252602e3c9ddbdd871d90. This was causing issues when building UHD with ninja
* devtest: lower rate for rx_all_chans_fast testMatthew Crymble2021-02-011-4/+4
| | | | Using 12.5 MS/s exceeded the maximum throughput when using 4 channels over 1 GbE
* devtest: allow extra device arguments when running devtestsMatthew Crymble2021-01-212-2/+5
| | | | | | | | | This allows running devtests for a single device instead of all connected devices or selecting a specific network interface. Set the additional device arguments with the EXTRA_DEV_ARGS variable. This can be set as an environment variable or on the command line. For example: make test_x3x0 EXTRA_DEV_ARGS=addr=192.168.30.2
* uhd: Split radio_control into rf_control interfacesLane Kolbly2021-01-112-0/+46
| | | | | | These rf_control interfaces allow easier implementation of radio controls as well as allowing easier sharing of code for implementing e.g. gain_profile.
* Create C++ wrappers for MPM RPC callsLane Kolbly2021-01-111-0/+1
| | | | | | | | | This gives us type-safety, as well as allowing us to create unit tests for RFNoC radio_controls without having to create actual RPC servers and clients in the unit tests. This change also fixes a bug in mpmd_mb_controller::set_sync_source, where it was calling the wrong MPM function.
* uhd: revert "Check property type at access..."Steven Koo2021-01-081-18/+0
| | | | | | | | | | This change reverts cb9329a681552e6ac6277d16e1627afcbb23e637. The type checking is causing some conversion issues on clang/macos. The type_index checking doesn't work correctly across shared libraries and should not be relied on to verify type, since it can vary from compiler to compiler. Signed-off-by: Steven Koo <steven.koo@ni.com>
* devtest: optionally generate XML report when running devtestsJoerg Hofrichter2021-01-081-1/+13
| | | | | | | If the unittests are invoked with an extra argument -x, an XML report is generated. This depends on the python module unittest-xml-reporting (aka. xmlrunner).
* tests: Add UT for node removal prop resol'n restorationAaron Rossetto2020-11-201-0/+53
|
* uhd_images_downloader: Add environment variable for http authLane Kolbly2020-10-152-0/+46
| | | | | | | | | This allows the image downloader to download files from restricted sources using HTTP basic auth, specifying the credentials in the UHD_IMAGES_USER and UHD_IMAGES_PASSWORD environment variables: ``` UHD_IMAGES_USER=lane UHD_IMAGES_PASSWORD=MyS3cretPassword uhd_images_downloader.py ```
* multi_usrp: Add get_mb_controller() API callCristina Fuentes2020-09-241-0/+1
|
* tests: Fix build issue with Boost 1.67Martin Braun2020-09-111-0/+3
| | | | | Boost 1.67 will fail to build some tests that include mock_transport.hpp if an additional include is missing.
* rfnoc: replay: Add support for 32-bit memory address widthsettus2020-09-031-2/+2
| | | | | | Increases the supported memory sizes in software to 2^32 and beyond. Signed-off-by: mattprost <matt.prost@ni.com>
* tests: fbs test: Fix issues around missing gitMartin Braun2020-08-251-1/+2
| | | | | | | | | - update_fbs.py would use git directly, instead of the requested git executable - There are other corner cases for the git executable detection, which are now all captured under a more general exception type Credit to Christopher Friedt for pointing out the original issue.
* devtest: Support multi_usrp_test on WindowsSteven Koo2020-08-101-1/+6
| | | | | | Windows requires the command 'python' to prepend calls to .py files. This change moves the path to multi_usrp_test.py to an argument on Windows.
* rfnoc: Remove M_PI usage to fix Windows buildsSteven Koo2020-08-071-7/+5
| | | | | | M_PI may not exist if _USE_MATH_DEFINES isn't defined before the first include of math.h or cmath on Windows. This changes avoids the issue all together by defining our own PI.
* tests: Add unit test for Keep One in N block controllerAaron Rossetto2020-08-052-0/+141
|
* devtest: Update filter for e31x devicesSteven Koo2020-08-041-1/+1
| | | | Filter for e3x0 no longer matches e31x devices. Switch to e3xx.
* tests: Add graph disconnect/reconnect unit testmichael-west2020-08-041-0/+37
| | | | Signed-off-by: michael-west <michael.west@ettus.com>
* RFNoC: Add xport disconnect callbacksmichael-west2020-08-041-2/+10
| | | | | | | | | | | | Transports were not disconnecting their links from the I/O service upon destruction, leaving behind inaccessible send and recv links used by nothing. This led to I/O errors after creating several transports. Added callbacks to transports to automatically disconnect their links from the I/O service when the transport is destroyed. Updated all callers to supply a disconnect callback. Signed-off-by: michael-west <michael.west@ettus.com>
* tests: Add Replay Block controller unit testmattprost2020-08-042-0/+764
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* tests: Add unit test for siggen RFNoC block controllerAaron Rossetto2020-07-302-0/+352
|
* rfnoc: Add Switchboard block unit testsJesse Zhang2020-07-302-0/+161
|
* rfnoc: Support instance overrides in set_properties()Aaron Rossetto2020-07-243-3/+42
| | | | | | | | | | | | | | | | | | | | | | | This commit adds an enhancement to node_t::set_properties() in which the instance argument provided to the function (which normally applies to all properties in the key/value list) can be overridden on a per-property basis using a special syntax. If the key consists of the property name followed by a colon (':') and then a number, the number following the colon is used to determine which instance of the property this set pertains to, and the value passed via the instance parameter is ignored for that property. For example, in the following call: node->set_properties("dog=10,cat:2=5,bird:0=0.5", 1) instance 1 of node's 'dog' property is set to 10, the 1 coming from the instance parameter, instance 2 of the node's 'cat' property is set to 5 due to the override syntax provided in the string, and instance 0 of the node's 'bird' property is set to 0.5 due to its override. If the name/instance pair is malformed, e.g. 'value:=10' or 'value:foobar=10', a runtime error is thrown.
* multi_usrp: Add get_radio_control() API callMartin Braun2020-07-161-0/+1
| | | | | This is an advanced API call that allows direct underlying access to the radio_control object for RFNoC devices.
* tests: Add unit test for Moving Average RFNoC blockmattprost2020-07-162-0/+111
| | | | Signed-off-by: mattprost <matt.prost@ni.com>
* python: Add payload agnostic methods to CHDR APISamuel O'Brien2020-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In the c++ api, methods like chdr_packet#set_payload() and chdr_packet#get_payload() are templated over the payload type (payload_t). For methods like set_payload, they are overloaded by the type of an argument, so in pybind we can just explicitly instaniate the template for each payload_t and register it with pybind under the same name. At runtime, pybind looks at the type of the argument and decides which to call. The problem arose with methods like get_payload, which are overloaded by return type. In C++, the compiler can infer the template type by the type of the target at the call site. In python, there is no way for the pybind to determine which variant of get_payload to call, and it would crash. Previously, the workaround for this was to declare get_payload_ctrl, get_payload_mgmt, etc, but this was rather anti-pythonic. This commit utilizes the fact that python methods don't have a constrained return type to resolve this. Now, get_payload will call a python method which looks at the chdr_packet#header#pkt_type field to determine which variant of get_payload to call and returns that type of payload_t. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* python: Document CHDR Test GenerationSamuel O'Brien2020-07-162-19/+44
| | | | | | | | | The script_test.py script is used to generate data .cpp files from a wireshark trace for the C++ CHDR Parser tests. This commit expands the script to also generate the data .py files for the Python CHDR Parser tests. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* python: Add bindings for C++ CHDR ParserSamuel O'Brien2020-07-165-0/+47029
| | | | | | | | | | | | | This commit adds pybind11 glue code for the userland chdr parsing code introduced in the uhd::utils::chdr namespace. Additionally, it moves some pybind11 adapter code to a common pybind_adaptors.hpp file which originally existed in the cal_python.hpp file. This commit also adds unit tests for the python bindings using a captured wireshark trace which is located in rfnoc_packets_*.py and some handwritten packets in hardcoded_packets.py Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* utils: Expose CHDR Parsing APISamuel O'Brien2020-07-137-2/+47798
| | | | | | | | | | | | This commit introduces a new public api in uhd::utils which allows serializing and deserializing chdr packets. As far as testing, this commit adds the chdr_parse_test test. It uses a wireshark trace located in rfnoc_packets_*.cpp as well as hand coded packets from hardcoded_packets.cpp to test the serialization and deserialization process Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* utils: Expose CHDR Types in Public APIrobot-rover2020-07-132-2/+2
| | | | | | | | | | This commit exposes uhdlib/rfnoc/chdr_types.hpp in the public includes. Additionally, it takes some types from uhdlib/rfnoc/rfnoc_common.hpp and exposes them publicly in uhd/rfnoc/rfnoc_types.hpp. Finally, one constant is moved from uhdlib/rfnoc/rfnoc_common.hpp to uhd/rfnoc/constants.hpp Signed-off-by: robot-rover <sam.obrien@ni.com>
* rfnoc: Rename chdr_packet to chdr_packet_writerSamuel O'Brien2020-07-132-18/+19
| | | | | | | | | It would be confusing to have two classes named chdr_packet. As it makes more sense to name the new public chdr parser class chdr_packet, the internal uhd::rfnoc::chdr::chdr_packet class is being renamed to chdr_packet_writer to better represent its functionality. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* rfnoc: Add unit test for Log Power RFNoC blockAaron Rossetto2020-06-292-0/+85
|
* rfnoc: Add unit test for Window RFNoC blockAaron Rossetto2020-06-292-0/+252
|
* CHDR: support multiple CHDR widthsAndrew Lynch2020-06-261-0/+106
| | | | | Support management payloads on busses over 64 bits Automatically set CHDR width for mpmd_link_if_ctrl_udp
* uhd: improved handling of empty serial number hintsMatthew Crymble2020-06-261-0/+3
| | | | | This allows device::find() calls to proceed even when encountering an empty/invalid serial number or serial number device argument hint.
* uhd: Create discoverable feature registry implementationLane Kolbly2020-06-252-35/+23
| | | | | | Classes which want to implement discoverable_feature can simply inherit from this registry and get access to an ergonomic map-backed registry of features.
* uhd: Add discoverable_features APILane Kolbly2020-06-252-0/+112
| | | | | | | | The "discoverable features" API handles how clients access the myriad features we offer, without simply adding a million has_FOO and do_FOO methods to radio_control and multi_usrp. discoverable_features allows clients to query the existance of, enumerate, and ultimately they get (by enum or by type) an object which implements their wanted feature.
* test: Add verify-flatbuffer testLars Amsel2020-06-232-0/+34
| | | | | | This runs update_fbs.py --verify as a unit test, and fail accordingly. The test passes if git executable is not found or the schema files are not within a git repo, because both are not a dependency of UHD.
* tests: Add unit test for FFT RFNoC blockAaron Rossetto2020-06-182-0/+191
|
* tests: Add infrastructure to run Python unit testsMartin Braun2020-06-152-0/+37
| | | | | | | | | | | | | | | | - Add UHD_ADD_PYTEST() CMake macro - Add CMake code to tests/CMakeLists.txt to auto-run all registered Python unit tests - Add a token unit test (it replicates parts of ranges_test.cpp) The way Python-based unit tests are implemented in UHD is that they can import uhd, and then operate on the module as usual. Writing unit tests in Python instead of C++ can have multiple advantages: - If they test PyBind-wrapped C++ code, they can test both the binding and the underlying C++ code at once - Writing unit tests in Python may be more concise
* devtest: Assert result of python_api_test correctlyMartin Braun2020-06-101-0/+15
| | | | Before this, the python_api_test didn't assert an error when it failed.
* devtest: Don't skip Python API tests if Python API is enabledMartin Braun2020-06-101-0/+5
| | | | | | | | 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.
* b200: tests: Fix PyLint issues in B200 devtestMartin Braun2020-06-101-1/+4
|
* tests: Fix multi_usrp_testMartin Braun2020-06-101-16/+28
| | | | | | | | This is a test that automatically executes API calls. The following tests were broken: - clock source: On B200mini, we need to set the time source back to internal to test the clock source. - The filter API call tests did not match the API calls themselves