[SOLVED] Linux IDE

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Linux IDE

    Hi
    I would like to run unit tests for my native linux apps in the SEGGER Linux IDE.
    For example with googletests or github.com/ThrowTheSwitch/Unity .
    The latter , when used in platform.io produces colored output like this:

    Processing test_host in native environment
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Building...
    Testing...
    test/test_host/test_h_statefct.cpp:113: test_single [PASSED] <== GREEN
    test/test_host/test_h_statefct.cpp:114: test_clear [PASSED]
    test/test_host/test_h_statefct.cpp:115: test_add_one [PASSED]
    test/test_host/test_h_statefct.cpp:116: test_systick [PASSED]
    test/test_host/test_h_statefct.cpp:117: test_program [PASSED]

    -----------------------
    5 Tests 0 Failures 0 Ignored
    OK

    How I can get this in the SEGGER IDE. In fact , for the moment , I have no output at all, after I build the app, nothing seems to happen. However, an executable has been produced that I can run from a linux terminal.

    Kind regards
    Peter
  • I am not sure if Googletest is the right framework for your puprose.
    As the introduction says : "GoogleTest works on different OSes...", "Whether you work on Linux, Windows, or a Mac...".
    These statements imply that host and target are identical.

    And this is not the case for embedded development, especially the target the Segger toolchain supports.
    Thus the test tool would need to integrate the target toolchain, deploy the test code to the target (which contains means to collect and transfer the test results to the host), and monitor the test procedure.

    My company uses a commercial tool in the 5-digit price range (Win only, AFAIK no support for Segger integration).
    And we use only simulated targets, which requires target toolchains that support such a target simulation.
  • Hi Frank

    Thanks for the suggestions. In fact, yes, I am aware that dual target testing is not fully feasible with basic tools.
    However, the platform.io ecosystem uses the github.com/ThrowTheSwitch/Unity testing framework that allows me to switch between a host and a target configuration.
    This is simple but nice. Maybe, the SEGGER IDE is not meant to be used in this way ...


    Kind regards
    Peter
  • > Maybe, the SEGGER IDE is not meant to be used in this way ...

    As a side note, none of the target toolchains we use specifically designed for that, or include explicit support for this or other test tools.
    The "support" comes with the test tool itself, which creates specific projects (derived from elaborate templates) for a certain platform.
    Execution is usually done by running the IDE with the specific project as cmd line parameter, whenever possible headless.

    As a side note, we do only module tests and most integration tests this way.
    Validations (tests against user-visible requirments) are done manually of via a HIL.

    > However, the platform.io ecosystem uses the github.com/ThrowTheSwitch/Unity testing framework that allows me to switch between a host and a target configuration.

    This depends on your environment and context.
    Because we deal with safety-related software, a "host configuration" is not an option.
    The certification agency does not permit that as a valid environment, the target toolchain must necessarily be involved.
  • > Anyway, good to to know how it's done by the experts.

    Let's settle on "professionals", as we (including myself) doing it for a living.

    It can get much "worse" if you go into the automotive or aircraft industry.
    In difference to the heavy machinery we build, an automobile or airplane is not in a safe state when you cut off all actuators.