aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/common
Commit message (Collapse)AuthorAgeFilesLines
* Build uhd_test library as static when `-DBUILD_SHARED_LIBS=ON`David Seifert2022-02-241-1/+1
| | | | | * A uhd_test.so lacks the necessary symbols for testing due to default visibility set to hidden.
* cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIRMartin Braun2021-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | See the CMake 3.8 documentation on these two variables: https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html Under normal circumstances, these two are identical. For sub-projects (i.e., when building UHD as part of something else that is also a CMake project), only the former is useful. There is no discernible downside of using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR. This was changed using sed: $ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \ `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}` $ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \ `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}` At the same time, we also replace the CMake variable UHD_HOST_ROOT (used in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables with the same meaning and different names, but more importantly, this means that UHD_SOURCE_DIR is defined even in those cases where MPM calls into CMake files from UHD without any additional patches. Shoutout to GitHub user marcobergamin for bringing this up.
* tests: Remove unused constantsMartin Braun2021-03-041-3/+0
| | | | This fixes some clang warnings.
* host: Update code base using clang-tidyMartin Braun2021-03-043-11/+11
| | | | | | | | | 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
* 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.
* 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-163-0/+46960
| | | | | | | | | | | | | 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-135-0/+47633
| | | | | | | | | | | | 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>
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-2/+1
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* tests: fixup compiler warningBrent Stapleton2019-12-301-1/+1
| | | | Fixes cb40069b ("tests: Port polling-mode dpdk_test to new DPDK...")
* tests: Port polling-mode dpdk_test to new DPDK frameworkAlex Williams2019-12-201-4/+10
| | | | | | The mock_send_transport and mock_recv_transport are used, which ends up with two layers of flow control. More work may be needed here for comparisons with the old data.
* rfnoc: Make polling I/O service not block on flow controlCiro Nishiguchi2019-11-261-9/+16
| | | | | | Add a new method to io_service::send_io to check whether the destination is ready for data, to make it possible to poll send_io rather than block waiting for flow control credits.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-262-4/+4
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* Remove proto-RFNoC filesMartin Braun2019-11-264-73/+2
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* transport: Add modeling of physical adaptersAlex Williams2019-11-261-0/+10
| | | | | | | Now link instances must have the ability to report the corresponding physical adapter that is used for the local side of the link. This information can be used to help identify when multiple links share the same adapter.
* rfnoc: add rx and tx transports, and amend rfnoc_graphCiro Nishiguchi2019-11-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | transports: Transports build on I/O service and implements flow control and sequence number checking. The rx streamer subclass extends the streamer implementation to connect it to the rfnoc graph. It receives configuration values from property propagation and configures the streamer accordingly. It also implements the issue_stream_cmd rx_streamer API method. Add implementation of rx streamer creation and method to connect it to an rfnoc block. rfnoc_graph: Cache more connection info, clarify contract Summary of changes: - rfnoc_graph stores more information about static connections at the beginning. Some search algorithms are replaced by simpler lookups. - The contract for connect() was clarified. It is required to call connect, even for static connections.
* transport: Implement a single-threaded I/O serviceAlex Williams2019-11-261-0/+369
| | | | | | | | | | | | | | | | | | | | The inline_io_service connects transports to links without any worker threads. Send operations go directly to the link, and recv will perform the I/O as part of the get_recv_buffer() call. The inline_io_service also supports muxed links natively. The receive mux is entirely inline. There is no separate thread for the inline_io_service, and that continues here. A queue is created for each client of the mux, and packets are processed as they come in. If a packet is to go up to a different client, the packet is queued up for later. When that client attempts to recv(), the queue is checked first, and the attempts to receive from the link happen ONLY if no packet was found. Also add mock transport to test I/O service APIs. Tests I/O service construction and some basic packet transmision. One case will also uses a single link that is shared between the send and recv transports. That link is muxed between two compatible but different transports.
* tests: add mock transport implementation and testCiro Nishiguchi2019-11-261-0/+256
| | | | Add test for transports using mock transports
* rfnoc: Read cmd FIFO size from blocks & configure ctrl_ifaceMartin Braun2019-09-041-1/+3
| | | | | | | | | | This requires noc_shell compat number 6.0. It will allow sending as many command packets, but no more, than there is space. Updated FPGA images for devices: - X310/X300 - N300/N310/N320 - E310/E320
* tests: Fix mock_ctrl_iface for 32-bit MSVCMartin Braun2019-05-231-2/+2
| | | | | Widening and narrowing of bitwidths causes errors on this platform without explicit casts.
* uhd: mpm: apply clang-format to all filesBrent Stapleton2019-01-164-114/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying formatting changes to all .cpp and .hpp files in the following directories: ``` find host/examples/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/tests/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find host/utils/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file find mpm/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Also formatted host/include/, except Cpp03 was used as a the language standard instead of Cpp11. ``` sed -i 's/ Cpp11/ Cpp03/g' .clang-format find host/include/ -iname *.hpp -o -iname *.cpp | \ xargs clang-format -i -style=file ``` Formatting style was designated by the .clang-format file.
* tests: Add benchmark of streaming code pathsCiro Nishiguchi2019-01-103-20/+104
| | | | | Add a benchmark of packet handlers and device3 flow control. Benchmarks use mock transport objects.
* tests: Fix compiler warning about unused timestampMartin Braun2019-01-071-2/+2
|
* tests: Retrofit sph test to use new mock transportCiro Nishiguchi2018-11-162-2/+126
|
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-141-2/+2
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* tests: device3_test: add graph impl testTrung Tran2018-10-315-0/+197