Skip to content

Commit

Permalink
misra mutations - fix tables overwrite by multiple workers
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed May 31, 2024
1 parent 9fdbb17 commit 6d9ebef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions tests/misra/test_misra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ fi

# ensure checked in coverage table is up to date
cd $DIR
python $CPPCHECK_DIR/addons/misra.py -generate-table > coverage_table
if ! git diff --quiet coverage_table; then
echo -e "${YELLOW}MISRA coverage table doesn't match. Update and commit:${NC}"
exit 1
if [ -z "$SKIP_TABLES_DIFF" ]; then
python $CPPCHECK_DIR/addons/misra.py -generate-table > coverage_table
if ! git diff --quiet coverage_table; then
echo -e "${YELLOW}MISRA coverage table doesn't match. Update and commit:${NC}"
exit 2
fi
fi

cd $PANDA_DIR
Expand Down Expand Up @@ -77,7 +79,7 @@ printf "\n${GREEN}Success!${NC} took $SECONDS seconds\n"

# ensure list of checkers is up to date
cd $DIR
if ! git diff --quiet $CHECKLIST; then
if [ -z "$SKIP_TABLES_DIFF" ] && ! git diff --quiet coverage_table; then
echo -e "\n${YELLOW}WARNING: Cppcheck checkers.txt report has changed. Review and commit...${NC}"
exit 1
exit 3
fi
2 changes: 1 addition & 1 deletion tests/misra/test_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ def test_misra_mutation(fn, patch, should_fail):
assert r == 0

# run test
r = subprocess.run("tests/misra/test_misra.sh", cwd=tmp, shell=True)
r = subprocess.run("SKIP_TABLES_DIFF=1 tests/misra/test_misra.sh", cwd=tmp, shell=True)
failed = r.returncode != 0
assert failed == should_fail

0 comments on commit 6d9ebef

Please sign in to comment.