Commit graph

12 commits

Author SHA1 Message Date
Martin Braun
21107ff36c mpm: Fix test utilities
- Fix MockGpiod object: This class should mock the gpiod module, but it was
  missing the LINE_REQ_EV_FALLING_EDGE attribute.
- While we're at it, fix some pylint warnings.
2023-02-08 16:59:34 -06:00
Martin Braun
ee75bd984c mpm: Add CompatNumber utility class
This is a class that allows handling compat numbers as a type:

>>> cn = CompatNumber(4, 3)
>>> print(cn.major)
4
>>> cn < CompatNumber(4, 5)
True
>>> cn == CompatNumber(4.3)
True
2022-06-29 12:08:02 -07:00
Aaron Rossetto
f69d88ed1f mpm: tests: Add lib/ to library load path
Ensure that DYLD_LIBRARY_PATH on OS X or LD_LIBRARY_PATH on Linux
platforms is set appropriately before invoking MPM's Python unit tests.
2021-06-18 07:28:28 -05:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
Michael Auchter
15b94c53ed mpm: sys_utils: add libgpiod-based Gpio helper
This adds a new Gpio helper class, which uses libgpiod under the
hood instead of the deprecated sysfs GPIO access. This class provides
the ability to get/set a specific GPIO, which is looked up by name.
2021-06-03 09:34:55 -05:00
Lars Amsel
73462501f0 mpm: add unit tests for EEPROM readers 2021-05-31 05:28:47 -07:00
Toni Jones
f11fa1bff7 mpm: Create Mock classes for unit testing
Create Mock classes which mimic the behavior of a register interface
and logger to facilitate unit testing needs.
2021-02-18 07:25:34 -06:00
Samuel O'Brien
f54a22c60a sim: Embed MPM into libpyuhd
When ENABLE_SIM and ENABLE_PYTHON_API are set, this commit embeds MPM
(Built with -DMPM_DEVICE=sim) into the pyuhd package.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-10-07 15:29:19 -05:00
Lane Kolbly
11bc3fa3a8 mpm: Make contextmanagers exception-safe
When making context managers in Python, the yield statement has to be wrapped in a try/finally clause in order to properly clean up after exceptions happen.
2020-03-03 15:16:06 -06:00
Joerg Hofrichter
6ee886cfe2 mpm: optionally generate XML report when running unittests
If the unittests are invoked with an extra argument -x, an XML report
is generated if the xmlrunner module is installed
2020-01-22 12:19:03 -08:00
Toni Jones
3642ac013e mpm: Generalize unittest Test Case functionality
Pull some general functionality out of a specific test case and create
a TestBase class. Future test cases will inherit from TestBase and have
access to this general functionality.
2019-04-11 09:11:43 -07:00
Toni Jones
8b080a8a14 cmake: Add unit testing framework to MPM
Add unit testing framework to MPM which can be run by calling
"make test". The testing is done using the built in unittest Python
module. Tests can be run on a dev machine or on the USRP itself when
compiling natively.
2019-03-26 15:15:05 -07:00