-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSON Compilation Database: support case sensitive paths
Depending on whether the file system is case sensitive or case insentitive, paths/comparisons of paths must be handled differently. - case sensitive: (default Linux): Paths must not be changed. - case insentitive (default Windows): Here, paths in reports from tools are often stored with lower case letters. The original spelling in the file system must be restored before a path comparison. - add additional integration test samples for Windows/Linux using upper case filenames - close #2691
- Loading branch information
Showing
23 changed files
with
157 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
integration-tests/testdata/json_db_project_case_insensitive/sonar-project.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# metadata | ||
sonar.projectKey=json_db_project_case_insensitive | ||
|
||
# disable SCM support | ||
sonar.scm.disabled=true | ||
|
||
# disable XML sensor | ||
sonar.xml.file.suffixes=.disable-xml | ||
|
||
# file extensions assigned to the cxx programming language | ||
sonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h | ||
|
||
# comma-separated paths to directories containing source files | ||
sonar.sources=src | ||
|
||
# read a JSON Compilation Database file | ||
sonar.cxx.jsonCompilationDatabase=compile_commands.json | ||
sonar.cxx.jsonCompilationDatabase.analyzeOnlyContainedFiles=true |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
integration-tests/testdata/json_db_project_case_sensitive/compile_commands.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[ | ||
{ | ||
"_comment_": "example extension to define global defines and includes for headers and for files which are not compiled", | ||
"file": "__global__", | ||
"defines": { | ||
"GLOBAL_DEFINE": "1" | ||
}, | ||
"includes": [ | ||
"/usr/include" | ||
] | ||
}, | ||
{ | ||
"_comment_": "source file to use", | ||
"directory": "./src", | ||
"file": "file1.cc", | ||
"command": "gcc -o output1 -I/usr/local/include -I /another/include/dir -DSIMPLE1 -DCOMMAND_DEFINE=1 file1.cpp", | ||
"output": "output1" | ||
}, | ||
{ | ||
"_comment_": "source file to use", | ||
"directory": "./src", | ||
"file": "FILE2.cc", | ||
"command": "gcc -o output2 -I/usr/local/include -I /another/include/dir -DSIMPLE2 -DCOMMAND_DEFINE=2 FILE2.cpp", | ||
"output": "output2" | ||
}, | ||
{ | ||
"_comment_": "source file to use", | ||
"directory": "./src", | ||
"file": "File3.cc", | ||
"command": "gcc -o output3 -I/usr/local/include -I /another/include/dir -DSIMPLE3 -DCOMMAND_DEFINE=3 File3.cpp", | ||
"output": "output3" | ||
} | ||
] |
2 changes: 1 addition & 1 deletion
2
.../json_db_project/sonar-project.properties → ...t_case_sensitive/sonar-project.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
integration-tests/testdata/json_db_project_case_sensitive/src/FILE2.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int func2(){ | ||
return 2; | ||
} |
3 changes: 3 additions & 0 deletions
3
integration-tests/testdata/json_db_project_case_sensitive/src/File3.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int func3(){ | ||
return 3; | ||
} |
3 changes: 3 additions & 0 deletions
3
integration-tests/testdata/json_db_project_case_sensitive/src/file1.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int func1(){ | ||
return 1; | ||
} |
3 changes: 3 additions & 0 deletions
3
integration-tests/testdata/json_db_project_case_sensitive/src/file4.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int func4(){ | ||
return 4; | ||
} |
3 changes: 3 additions & 0 deletions
3
integration-tests/testdata/json_db_project_case_sensitive/src/file5.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int func5(){ | ||
return 5; | ||
} |
3 changes: 3 additions & 0 deletions
3
integration-tests/testdata/json_db_project_case_sensitive/src/file6.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int func6(){ | ||
return 6; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters