Linux command
pio-test 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run unit tests
pio test
Run tests for specific environment
pio test -e [native]
Run specific test
pio test -f [test_example]
Run tests with verbose output
pio test -v
说明
pio test runs unit tests for PlatformIO projects. Supports both native (desktop) and embedded testing. Uses Unity test framework by default. Tests can run on actual hardware or simulators.
参数
- -e, --environment _name_
- Test environment.
- -f, --filter _pattern_
- Test filter pattern.
- -i, --ignore _pattern_
- Ignore tests matching pattern.
- --upload-port _port_
- Upload port for device tests.
- --test-port _port_
- Serial/UART port used as communication interface for tests.
- -d, --project-dir _path_
- Specify project directory path.
- -c, --project-conf _file_
- Use a custom platformio.ini file.
- -v, --verbose
- Verbose output (repeat for more: -vv, -vvv).
- --without-building
- Skip the build stage.
- --without-uploading
- Skip the upload stage.
- --without-testing
- Skip the test stage.
- --list-tests
- List tests without running them.
- --json-output
- Return output in JSON format.
- --junit-output-path _file_
- Generate a JUnit XML report at the given path.
FAQ
What is the pio-test command used for?
pio test runs unit tests for PlatformIO projects. Supports both native (desktop) and embedded testing. Uses Unity test framework by default. Tests can run on actual hardware or simulators.
How do I run a basic pio-test example?
Run `pio test` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e, --environment _name_ do in pio-test?
Test environment.