mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
misra mutations test - git diff error fix (#1964)
fix misra mutations - don't run git diff in temp folder
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user