I'm currently investigating the possibility to force the rvct compiler not to link in specific translation units and just pretend that it has linked it.
Our product is running very tight on space constraints and have trouble integrating some unit tests with it while keeping the space under control.
Basically, the memory we can leverage during run time is more than sufficient to store our unit tests, but we don't have sufficient rom space to hold them.
We have means to control exactly which segment of memory of our code goes in on our device in the scatter file, so we're thinking along the lines of defining which region the unit test codes will be located and somehow force the compiler not to link in that specific code during compile time.
Something like the following:
Result UnitTestEntryPoint (UnitTest suite) {
if (hasTestInMemory) {
switch (suite) {
case EncrpytionTest:
return EncrptyUnitTest();
// more tests.
}
}
}
// Actual Tests, can we not link this code, but just pretend we link to them?
Result EncrpyUnitTest (void) {
// Do stuff...
}
Then during runtime, we'll upload the unit test binaries to the specified memory region that we define in the scatter file, and flip the hasTestInMemory
to true
.
Is this possible?
Or if not, can someone point me to the right direction of looking for a solution that somehow meets our space constraint and able to load unit tests during run time.
Thanks,