Speeding up unit testing?

I love the idea of unit testing. However, are there any tricks to making the procedure faster? My rather simple units test takes over 60s when I run it on a RaspberryPi. Even on a desktop it still takes much longer than an avrdude ISP upload.

I want to use unit testing as part of a production upload and test procedure, however over 60s it too slow.

Pio test is compiling the unit test on each runtime, is is possible to tell pio just to execute a pre-compiled unit test?

The workflow of PlatformIO Unit Testing Engine:

  1. Build project and tests
  2. Upload firmware to device
  3. Connect to it via Serial, gather tests results
  4. Process results, build formatted output

  • PIO compiles when a source code of project or test was changed. I
  • Do you mean that you don’t want to build/upload each time and just perform steps 3-4 from the workflow above?

I would like to perform steps 2-4 if this is possible.

Hm… Step number 1 takes < 2sec. Could you explain your issue in details?

We added 2 new options for pio test command:

  1. pio test --without-building
  2. pio test --without-uploading

Hope that will help you.

1 Like

Awesome! Thanks :grinning: