aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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
* rfnoc: Add unit test for Add/Sub RFNoC blockAaron Rossetto2020-05-282-0/+93
|
* tests: Add unit test for Split Stream RFNoC blockAaron Rossetto2020-05-282-0/+232
| | | | This commit adds a unit test for the split stream RFNoC block.
* tests: Add unit test for USE_MAP action forwarding policyAaron Rossetto2020-05-281-0/+137
| | | | This commit adds a unit test for the USE_MAP action forwarding policy.
* tests: Add unit test for USE_MAP prop forwarding policyAaron Rossetto2020-05-282-1/+259
| | | | | | | | | | | | | | | This commit adds a unit test for the USE_MAP property forwarding policy. It also adds a pair of new mock RFNoC nodes for use in unit testing: - mock_edge_node_t is a node with a configurable number of input and output ports each having an edge property named 'prop' associated with each. The node is also able to source actions from any of its edges and records incoming actions in a map. - mock_routing_node_t is a do-nothing node specifically for testing property and action forwarding between edges with the USE_MAP forwarding strategy. The node has functions to configure the property and action forwarding maps.
* tests: updated devtest runner to use standard device argsMatthew Crymble2020-05-272-3/+3
| | | | | This will allow run_testsuite.py to be called for specific devices instead of all devices for a certain type.
* cal: Minor fixes in power container, add unit testMartin Braun2020-05-261-0/+24
| | | | | | | - min_power and max_power arguments were swapped. They were always called correctly, so this is more of a documentation fix. - Add a unit test for the case where power values are not regular, which is the normal case with real data.
* tests: Add unit tests for pwr_cal_mgrMartin Braun2020-05-202-0/+157
|
* cal: database: Add option to register flash cal callbacksMartin Braun2020-05-201-0/+36
| | | | | | | | | | | This adds the possibility to read cal data from flash/EEPROM by adding callbacks to the database. Unlike the RC and FILESYSTEM data, this is very device-specific, but we can let devices register callbacks in the database so that reading cal data from flash can use the same APIs as from RC or filesystem. Note that this also gives a convenient way to inject call data during unit tests, if desired.
* tests: Added unit test for Vector IIR RFNoC blockAaron Rossetto2020-05-192-0/+225
|
* tests: Remove 'six' dependency from devtestMartin Braun2020-05-121-2/+1
| | | | This removes 'six' as a dependency for devtest.
* Remove remaining Python 2 referencesMartin Braun2020-05-075-5/+0
| | | | | | | This changes two things in all applicable files: - Remove imports from __future__ - Change default shebangs from /usr/bin/env python to /usr/bin/env python3
* test: Add output for gpio_testMichael West2020-04-301-0/+3
| | | | | | Print output from stdout and stderr upon error. Signed-off-by: Michael West <michael.west@ettus.com>
* devtest: Add support for TwinRX to x3x0Michael West2020-04-301-52/+92
| | | | | | | Adding necessary code to examine number of TX and RX channels and adjust test cases accordingly. Signed-off-by: Michael West <michael.west@ettus.com>
* devtest: Add method to get number of channelsMichael West2020-04-301-0/+36
| | | | | | Adding method to get number of TX and RX channels to usrp_probe. Signed-off-by: Michael West <michael.west@ettus.com>
* devtest: Fix benchmark_rate_test success criteriaMichael West2020-04-301-2/+2
| | | | | | | Allow success if testing either TX or RX. Previously required both TX and RX to be tested simultaneously. Signed-off-by: Michael West <michael.west@ettus.com>