Personal-Data-Acquisition / stm32_sensor_module

A stm32 based sensor module controller.
MIT License
0 stars 1 forks source link

Setup testing framework #2

Open jake-g00dwin opened 7 months ago

jake-g00dwin commented 7 months ago

Using a test harness setup unit testing for the embedded rust code.

jake-g00dwin commented 6 months ago

Have been working on setting up the Unit testing and integration testing. So far I have been able to get tests to work on a workspace I added into a local branch.

To get this to work I had to use cargo test --target x86_64-unknown-linux-gnu inside the workspace itself.

It's still not ideal, as it means at the moment we don't have a real solution for handling unit tests written alongside the main code.

jake-g00dwin commented 6 months ago

After refreshing on the rust book, I decided that the sensor module should probably act as a super repo with the drivers being sub-modules that can be separately pulled into the repo as needed.

This means we could fetch/pull only the needed sub-modules when building for a customized sensor module.

jake-g00dwin commented 6 months ago

Currently working on creating driver for the AHT20 humidity and temperature module.

Tests are being written for it by using the embedded-hal-mock crate at the moment. This is allowing me to abstract the dependency on the i2c peripheral.

Still need to work on finding solution for testing the main source files however.

jake-g00dwin commented 5 months ago

Have testing and TDD working for repos external to the stm32_sensor_module repo. This lets tdd occur in the libraries along with github actions for automatic checking of the tests.

Still need to find workaround for the testing inside the main repo here.

jake-g00dwin commented 5 months ago

Have testing and TDD working for repos external to the stm32_sensor_module repo. This lets tdd occur in the libraries along with github actions for automatic checking of the tests.

Still need to find workaround for the testing inside the main repo here.