-
Notifications
You must be signed in to change notification settings - Fork 25
Fix: Update RST File Based Tests #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9966bad
c1ca974
c4dcc69
87baf48
f3656f5
d6dbf9e
1896170
6899b9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,8 @@ The test files are expected to contain the following format: | |
|
|
||
| #CHECK: <check functions> | ||
|
|
||
| #EXPECT: <warning message> | ||
| #EXPECT-NOT: <warning message> | ||
| #EXPECT[+x]: <warning message> | ||
| #EXPECT-NOT[+x]: <warning message> | ||
|
|
||
| <need information> | ||
|
|
||
|
|
@@ -36,18 +36,37 @@ Message text which is expected/not expected during the | |
| This message is checked for the Sphinx-Needs directive | ||
| specified after the EXPECT/EXPECT-NOT statement. | ||
|
|
||
| This message needs a '[+x]'offset after the 'EXPECT/-NOT' that should point to the need | ||
| that should (not) emit the warning. | ||
|
|
||
| **\<need information>**<br> | ||
| One or more Sphinx-Needs directives needed for the | ||
| Sphinx document build | ||
|
|
||
| **Example:** | ||
|
|
||
| #CHECK: check_options | ||
| #EXPECT: std_wp__test__abcd: is missing required attribute: `status`. | ||
| #EXPECT[+2]: std_wp__test__abcd: is missing required attribute: `status`. | ||
|
|
||
| .. std_wp:: Test requirement | ||
| :id: std_wp__test__abcd | ||
|
|
||
| This example verifies that the warning message | ||
| *std_wp__test__abcd: is missing required attribute: \`status\`* | ||
| is shown during the Sphinx build. Only the *check_options* check is enabled. | ||
|
|
||
| With the '[+2]' after the 'EXPECT' we tell the parser that we want this warning | ||
| to be emitted and checked for 2 lines underneath | ||
|
|
||
| There is multiple things that are not allowed for example, you need to have | ||
| a new line between the EXPECT/-NOT and the need that it refers to | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There needs to be a new line between the |
||
|
|
||
| **Negative Example** | ||
|
|
||
|
|
||
| #EXPECT-NOT[+1]: std_wp__test__abcd: is missing required attribute: `status`. | ||
| .. std_wp:: Test requirement | ||
| :id: std_wp__test__abcd | ||
|
|
||
| This will error and let you know that an offset of '1' is not allowed and you | ||
| need to add a new line beneath the Warning Statement | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to practically always be
[+2]. So it feels more like unnecessary boilerplate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is currently cause we only have 1 EXPECT there. If we had 2 or more it would be `
EXPECT[+3]: ...
EXPECT[+2]: ...
etc.
It truly is only an offset that EXACTLY tells us where they want the warning to be.
This way we can also safeguard a bit against sphinx not seeing a need but we do.