Unit Testing
Tools¶
Assuming you have Visual Studio Code and PlatformIO installed
Windows Prerequisite¶
- Install mingw-w64 from sourceforge.net
- In the windows search bar type
env
and select Edit the system environment variables - Click the
Environment Variables...
button and in theSystem variables
section double-clickPath
and clickNew
then pasteC:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
. This path may be different on your system, but it is the path that mingw-w64 was installed previously and whereg++.exe
is located.
Running the tests¶
- In VSCode with the ExpressLRS project open, click on the
New Terminal
button in the status bar - Ensure the native platform is installed by entering
pio platform install native
in the terminal window. - Now you can enter
pio test -e native
to run the tests. - It is also possible to use the PlatformIO module and select Native/Advanced/Test in the target selection list.