cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

refs #12274 - test/cli/proj2_test.py: made it location-independent / some cleanups

Open firewave opened this issue 1 year ago • 4 comments

firewave avatar Jul 23 '24 15:07 firewave

This exposes an issue with the ignored paths not matching when the slashes differ from the given path.

firewave avatar Jul 24 '24 08:07 firewave

I filed https://trac.cppcheck.net/ticket/12972 about the issue with the mismatching slashes.

firewave avatar Jul 28 '24 18:07 firewave

There is still an issue that a Windows binary somehow reports an absolute path where a Linux one doesn't:

FAILED proj2_test.py::test_gui_project_loads_absolute_vs_solution_2 - AssertionError: assert 'D:\\a\\cppcheck\\cppcheck\\test\\cli\\proj2\\a\\a.c:1:7: error: Division by zero. [zerodiv]\nx = 3 / 0;\n      ^\nD:\\a\\cppcheck\\cppcheck\\test\\cli\\proj2\\b\\b.c:1:7: error: Division by zero. [zerodiv]\nx = 3 / 0;\n      ^\n' == 'a\\a.c:1:7: error: Division by zero. [zerodiv]\nx = 3 / 0;\n      ^\nb\\b.c:1:7: error: Division by zero. [zerodiv]\nx = 3 / 0;\n      ^\n'
  
  - a\a.c:1:7: error: Division by zero. [zerodiv]
  + D:\a\cppcheck\cppcheck\test\cli\proj2\a\a.c:1:7: error: Division by zero. [zerodiv]
    x = 3 / 0;
          ^
  - b\b.c:1:7: error: Division by zero. [zerodiv]
  + D:\a\cppcheck\cppcheck\test\cli\proj2\b\b.c:1:7: error: Division by zero. [zerodiv]
    x = 3 / 0;
          ^

firewave avatar Aug 04 '24 19:08 firewave

There is still an issue that a Windows binary somehow reports an absolute path where a Linux one doesn't:

This appears to be caused by Path::simplifyPath(). realFilename() within simplecpp does nothing on Linux but does a lot on Windows - but only if the file exists and the unit tests for those functions do not generate files.

firewave avatar Aug 07 '24 06:08 firewave

There is still an issue that a Windows binary somehow reports an absolute path where a Linux one doesn't:

This was an issue with relative paths and a missing path conversation when reading a .cppcheck project compared to what the CLI is doing.

firewave avatar Oct 30 '24 13:10 firewave

No feedback for two weeks - merging.

firewave avatar Nov 13 '24 09:11 firewave