Building static library of HAL, profiling, tiny embedded unittest

Sysprogs forums Forums VisualGDB Building static library of HAL, profiling, tiny embedded unittest

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20596
    dabramson
    Participant

    Hello,

    I would like to build a static library (.a) that contains the HAL, the Semihosting/Profiler code, and the tiny embedded unit test framework. The reason is that I am likely to be required to use stand-alone projects, and I would like to have only 1 copy of those things with multiple unit test projects referencing them.

    I created a static lib project and added the semihosting/profiling framework via the visual gdb project settings GUI. I also added the unit test framework via the visual gdb project settings.

    When I build the library without the unit test framework added (unchecked in the unit test tab of vgdb settings) the build works without error, though there are some warnings (see attachment buildoutputNOUNITTEST.txt). When I build the library with the unit test framework added, I still get the .a file in the output directory but I get a message box in visual studio saying “Warning: cannot perform inline build: Invalid ELF file”, and errors in the build output (see attachment buildoutputWithTinyEmbedded.txt).

    Strangely, I still get the .a file in the output directory. I ran readelf -a on both version of of the library. The outputs are attached. The only difference is that the output generated by running on the .a with the unit tests lists symbols for TinyEmbeddedTest.o and SysprogsTestHooks.o (see attached readelf files).

    Regards,

    Dave

     

    Attachments:
    You must be logged in to view attached files.
    #20599
    dabramson
    Participant

    the readelf outputs were too large to attach, please provide me an alternative way to supply them if they would be of use

    #20612
    support
    Keymaster

    Hi,

    Sorry, the way test frameworks are currently implemented requires referencing them directly from each application project. This will let VisualGDB run some post-processing on the ELF file in order to discover and handle test cases and this won’t work for static library projects.

    If you absolutely want to build the test framework as a static library, please try adding the related sources (and specifying build flags) manually to the project, then reference the test framework from the application project file and manually remove the references to the test source files from it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.