Menu

Is the MISRA test still supposed to be functional?

2020-10-23
2020-10-25
  • Richard Smith

    Richard Smith - 2020-10-23

    The misra tests seem to have a regression from 2.1 to 2.2.

    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ git checkout 2.1 
    Previous HEAD position was 8636dd855 2.2: Updated Makefile
    HEAD is now at 0f23bde2b 2.1: Set release mode in Makefile
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ 
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ 
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ 
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ ./do_test.sh 
    Checking misra/misra-test.c ...
    Checking ./misra/misra-test.c.dump, config ...
    0
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ 
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ 
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ git checkout 2.2 
    Previous HEAD position was 0f23bde2b 2.1: Set release mode in Makefile
    HEAD is now at 8636dd855 2.2: Updated Makefile
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ ./do_test.sh 
    Checking misra/misra-test.c ...
    Checking ./misra/misra-test.c.dump, config ...
    Expected but not seen: 390:12.3
    Expected but not seen: 391:12.3
    Expected but not seen: 396:12.3
    Expected but not seen: 402:12.3
    Expected but not seen: 403:12.3
    Expected but not seen: 404:12.3
    Expected but not seen: 406:12.3
    Expected but not seen: 407:12.3
    Expected but not seen: 418:12.3
    Expected but not seen: 420:12.3
    Expected but not seen: 421:12.3
    Expected but not seen: 422:12.3
    Expected but not seen: 425:12.3
    Expected but not seen: 426:12.3
    Expected but not seen: 427:12.3
    Expected but not seen: 428:12.3
    Expected but not seen: 429:12.3
    Expected but not seen: 430:12.3
    Expected but not seen: 433:12.3
    Expected but not seen: 435:12.3
    Expected but not seen: 438:12.3
    Expected but not seen: 439:12.3
    Expected but not seen: 440:12.3
    Expected but not seen: 442:12.3
    Expected but not seen: 443:12.3
    Expected but not seen: 444:12.3
    Expected but not seen: 445:12.3
    1
    rsmith@rsmith-xps13:/home/src/cppcheck.git/addons/test$ 
    
     
  • Richard Smith

    Richard Smith - 2020-10-23

    do_test.sh is mine. Here's what it does.

    find . -name '*.dump' -exec rm {} \;
    ../../build/bin/cppcheck --dump  --suppress=uninitvar --suppress=uninitStructMember --std=c89 -I. ./misra/misra-test.c
    
    python3 ../misra.py -verify ./misra/*.dump
    echo $?
    
     
  • Daniel Marjamäki

    We run these tests in the CI also. The latest Travis result says:

    $ ${CPPCHECK} --dump --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.c
    Checking misra/misra-test.c ...
    The command "${CPPCHECK} --dump --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.c" exited with 0.
    $ python3 ../misra.py -verify misra/misra-test.c.dump
    Checking misra/misra-test.c.dump, config ...
    The command "python3 ../misra.py -verify misra/misra-test.c.dump" exited with 0.
    

    Since you do not rebuild the cppcheck binary it is possible that this caused the problem. Not sure.

     
  • Richard Smith

    Richard Smith - 2020-10-25

    Ooops. Yes that was the issue. Sory for the noise. I was working with misra.py and using --inline-suppr with cppcheck and forgot to rebuild when I updated my tree.
    Thank you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.