Skip to content

Integrate CI unit testing #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 29, 2020
Merged

Integrate CI unit testing #122

merged 13 commits into from
Oct 29, 2020

Conversation

polldo
Copy link
Contributor

@polldo polldo commented Oct 7, 2020

Each class under test will have a dedicated test file.
Each test file is placed in a dedicated folder in extras/test/src . Such dedicated folder will also contain the mock (Fake) objects needed by the test.
Finally, an executable file will be generated for each test.

Steps to build tests:

cd extras/test/
mkdir -p build
cd build
cmake ..
make

Generated binaries will be placed in extras/test/build/bin

integrates and overwrites #121

@polldo polldo requested a review from facchinm October 7, 2020 16:23
polldo added 13 commits October 16, 2020 12:39
Now all the set methods of advertising data parameters return a bool value.
This bool indicates whether the parameter has been correctly set or not, depending on the size of the passed value.
A remaining length parameter of advertising data has been introduced. It can be publicly read, it indicates how many bytes can be still written into the packet.
In BLELocalDevice constructor, the flags field of the advertising data is set to a default value.
If a new advertising data is passed to BLELocalDevice, then:
     if it has no flags -> default flags are set (if there is enough space)
     if it already has flags -> nothing happens, the already set flags are used
Add raw data class.
When an AdvertisingData object has a rawData parameter set, the only advertised data will be the rawData parameter itself.
If the new value for the parameter is not valid, because too large, then
the old value will remain the actual value of the parameter.
This change is needed for mocking BLE classes in the CI environment
This change allows fake classes to override methods during unit testing.
This change allows to implement and use fake objects during unit testing
Classes to be mocked will be extended by fake classes. Each fake class will define a fake singleton instance
Each class under test will have a dedicated test file.
Each test file is placed in a dedicated folder in extras/test/src . Such dedicated folder will also contain the mock (Fake) objects needed by the test.
Finally, an executable file will be generated for each test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants