-
Notifications
You must be signed in to change notification settings - Fork 3
Debugging and Unit Testing
Enable uSched debug messages by setting the CONFIG_DEBUG definition to 1 in include/config.h file:
#define CONFIG_DEBUG 1
Always use, at least, the following compiler flags when using gcc or clang:
-fstrict-aliasing -pedantic -Wall -Werror
If you're using another compiler, make sure you setup it correctly to trigger the same warnings that are issued by gcc (or clang) with the above flags.
After Enabling Debugging, build and install the project. Then start uSched modules using valgrind in the following order:
~# valgrind --leak-check=full --show-reachable=yes --track-origins=yes uss
~# valgrind --leak-check=full --show-reachable=yes --track-origins=yes use
~# valgrind --leak-check=full --show-reachable=yes --track-origins=yes usd
Always use splint to analyze the code. If you're unsure about what flags you should use, cleanup the project (running the undo script) and perform:
~# make test
This will run several static analysis tools, including splint, scan-build and pscan.
Grant that all features behave as expected. Although the make test procedure will perform some behavioral testing by using uSched Client, it's not granted that everything is covered there at all times. Think about what you've done and what will be directly or indirectly affected and run some tests of your own.
When working with code that may affect remote management features, always grant that remote connections are working as expected. If possible, run the client and the server in two different architectures with different endianness (you can use qemu for that purpose). If you can't, or don't want to perform such tests, request some uSched developer to do it for you.
All technical details of the uSched can be found here. A FAQ and a Getting Started guide are also available.
Quick Links:
- Wiki Home
- Coding Guidelines
- Debugging and Unit Testing
- FAQ
- Getting Started
- Next Development Steps
- Request of Features
- Roadmap
Looking for an overview of the uSched? Check the project README.md.