You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DOC.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,15 +68,20 @@ e.g
68
68
69
69
But [other coverage tools](https://vladfilippov.com/blog/rust-code-coverage-tools/) might work as well
70
70
71
+
## Highlighting unit tests
72
+
By default, the plugin will highlight Rust unit tests for functions having attributes `#[test]` or `#[tokio::test]`
73
+
You may configure different attributes with parameter `community.rust.unitttests.attributes`
74
+
71
75
72
76
## Adding test measures
73
77
74
78
Optionally SonarQube can also display tests measures.
75
79
76
-
This Community Rust plugin doesn't run your tests or generate tests reports for you. That has to be done before analysis and provided in the form of reports.
80
+
This Community Rust plugin doesn't run your tests or generate tests reports for you. That has to be done before analysis
81
+
and provided in the form of reports.
77
82
78
83
Currently, only `junit report` formats are supported :
79
84
80
-
Insert a parameter `community.rust.test.reportPath` into you `sonar-project.properties` file. As an example, one of such tool
85
+
Insert a parameter `community.rust.test.reportPath` into you `sonar-project.properties` file.
86
+
As an example, one of such tool for Rust that converts `cargo test` report to `junit report` is [cargo2junit](https://crates.io/crates/cargo2junit).
81
87
82
-
for Rust than converts `cargo test` report to `junit report` is [cargo2junit](https://crates.io/crates/cargo2junit).
@@ -73,7 +76,7 @@ public void define(Context context) {
73
76
.name("LCOV Files")
74
77
.description("Paths (absolute or relative) to the files with LCOV data.")
75
78
.onQualifiers(Qualifiers.PROJECT)
76
-
.subCategory("Test and Coverage")
79
+
.subCategory(TEST_AND_COVERAGE)
77
80
.category("Rust")
78
81
.multiValues(true)
79
82
.build(),
@@ -84,12 +87,20 @@ public void define(Context context) {
84
87
.name("LCOV Files")
85
88
.description("Paths (absolute or relative) to the files with LCOV data.")
86
89
.onQualifiers(Qualifiers.PROJECT)
87
-
.subCategory("Test and Coverage")
90
+
.subCategory(TEST_AND_COVERAGE)
88
91
.category("Rust")
89
92
.multiValues(true)
90
-
.build()
91
-
93
+
.build(),
92
94
95
+
PropertyDefinition.builder(UNIT_TEST_ATTRIBUTES)
96
+
.defaultValue(DEFAULT_UNIT_TEST_ATTRIBUTES)
97
+
.name("Unit tests")
98
+
.description("Comme separated list of Rust attributes for Unit Tests")
99
+
.onQualifiers(Qualifiers.PROJECT)
100
+
.subCategory(TEST_AND_COVERAGE)
101
+
.category("Rust")
102
+
.multiValues(true)
103
+
.build()
93
104
);
94
105
95
106
@@ -98,7 +109,7 @@ public void define(Context context) {
98
109
.name("Path to xunit report(s)")
99
110
.description("Path to the report of test execution, relative to project's root. Ant patterns are accepted. The reports have to conform to the junitreport XML format.")
0 commit comments