You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A while ago I removed the old tests from maniacbug days because they relied on older Arduino compilation convention and necessary hardware (RX & TX nodes driven by AVR-based MCUs from a Linux host). I think its time to tackle the creation of new tests.
Software tests should ensure expected behavior in all methods & attributes. I intend to override SPI transactions to do this, so I can match SPI out/input with the expected behavior. If we use a test lib like catch2, we could optionally perform software tests with CMake. These may be be limited to Linux only because of the time-oriented libs that we use.
Hardware tests should be similar to what maniacbug had done but modernized by using PlatformIO. Running hardware tests will be no more tedious to setup than any Arduino example (which only highlight radio features instead of lib features). If we utilize the platformio.ini configs properly, it should be simply a matter of specifying the right PIO env from PIO CLI.
It may be possible to use ArduinoCLI tool, but PIO seems easier out-of-the-box.
Additional context
It would be prudent to add tests that would ensure compatibility with other libs like ArduinoJSON, but that is a secondary goal for now.
Implementation details like how to override SPI transactions for software tests are TBD (what this thread is meant for). Initially, I thought about making read/write_registers(), ce(), and csn() protected when a RF24_TESTS macro is defined. But, it may be easier to use a utility/test driver instead (which would allow using cross-platform compatible time-oriented libs as well).
If done right, this could be extended to pyrf24 pkg. And yes, I am also considering the other RF24* libs, but that should be rather trivial after this is done with the RF24 core lib.
The text was updated successfully, but these errors were encountered:
A while ago I removed the old tests from maniacbug days because they relied on older Arduino compilation convention and necessary hardware (RX & TX nodes driven by AVR-based MCUs from a Linux host). I think its time to tackle the creation of new tests.
Additional context
It would be prudent to add tests that would ensure compatibility with other libs like ArduinoJSON, but that is a secondary goal for now.
Implementation details like how to override SPI transactions for software tests are TBD (what this thread is meant for). Initially, I thought about making
read/write_registers()
,ce()
, andcsn()
protected when aRF24_TESTS
macro is defined. But, it may be easier to use a utility/test driver instead (which would allow using cross-platform compatible time-oriented libs as well).If done right, this could be extended to pyrf24 pkg. And yes, I am also considering the other RF24* libs, but that should be rather trivial after this is done with the RF24 core lib.
The text was updated successfully, but these errors were encountered: