Skip to content
  • Petri Latvala's avatar
    lib: Help static analyzers figure out the execution flow · ace031dc
    Petri Latvala authored
    
    
    When running any kind of static analysis on IGT, one tends to drown in
    warnings about using uninitialized variables in subtests, because
    static analysis is unable to figure out that igt_fixture blocks are
    always entered if a subtest block is entered. Aid the discovery of
    correct execution flow by making static analysis always enter all
    igt_fixture blocks and all subtest blocks.
    
    Automatic discovery of static analyzers is done for Clang, Coverity
    and Klocwork, using macros found by quick googling. For explicit
    control on possible other analyzers, defining STATIC_ANALYSIS_BUILD=1
    manually will activate this hack.
    
    v2:
     - Hack not needed for igt_subtest()
     - Make sure igt_fixture is entered once instead of an infinite loop
    
    v3:
     - Rebase properly...
    
    Signed-off-by: default avatarPetri Latvala <petri.latvala@intel.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    ace031dc