Skip to content

Commit 14a3283

Browse files
Merge pull request #99 from riscv/98-add-comments-to-norm-rule-testadoc-to-identify-cases-expected-to-pass-and-fail
Fixed #97 and #98
2 parents 2f436fa + 8501025 commit 14a3283

File tree

6 files changed

+134
-115
lines changed

6 files changed

+134
-115
lines changed

normative-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What is a Normative Rule?
44

5-
Normative rules specify the behaviors an implementation must meet in order to be compliant with the standard. Each normative rule can be thought of as a complete individually testable behavior. In some cases, a normative rule allows multiple acceptable implementation behaviors. These are called "parameters" and can be thought of as a special case of a normative rule.
5+
Normative rules specify the behaviors an implementation must meet in order to be compliant with the standard. Each normative rule can be thought of as a complete architecturally-visible behavior. In some cases, a normative rule allows multiple acceptable implementation behaviors. These are called "parameters" and can be thought of as a special case of a normative rule.
66

77
### Examples of Normative Rules:
88
| ISA Manual Text |

tests/norm-rule/expected/test-norm-rules.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,50 @@
1919
]
2020
},
2121
{
22-
"name": "inline-anchors-in-paragraph",
22+
"name": "paragraph-with-a-really-wide-rule-name",
23+
"def_filename": "tests/norm-rule/test.yaml",
24+
"chapter_name": "my-chapter_name",
25+
"description": "Here's a description.\nIt's got 2 lines.\n",
26+
"tags": [
27+
{
28+
"name": "norm:paragraph:no-inline-anchors",
29+
"text": "Paragraph without inline anchors",
30+
"tag_filename": "/build/test-norm-tags.json"
31+
}
32+
]
33+
},
34+
{
35+
"name": "inline-anchors-in-paragraph-entire",
2336
"def_filename": "tests/norm-rule/test.yaml",
2437
"chapter_name": "my-chapter_name",
2538
"tags": [
2639
{
27-
"name": "norm:paragraph:inline-anchors-in-paragraph",
40+
"name": "norm:paragraph:inline-anchors:entire",
2841
"text": "Paragraph with inline anchor and something.",
2942
"tag_filename": "/build/test-norm-tags.json"
3043
}
3144
]
3245
},
3346
{
34-
"name": "inline-anchors-in-tagged-paragraph",
47+
"name": "inline-anchors-in-paragraph-inline-anchor",
3548
"def_filename": "tests/norm-rule/test.yaml",
3649
"chapter_name": "my-chapter_name",
3750
"tags": [
3851
{
39-
"name": "norm:paragraph:inline-anchors-in-paragraph:inline-anchors",
52+
"name": "norm:paragraph:inline-anchors:inline-anchor",
4053
"text": "inline anchor",
4154
"tag_filename": "/build/test-norm-tags.json"
4255
}
4356
]
4457
},
4558
{
46-
"name": "paragraph-with-a-really-wide-rule-name",
59+
"name": "rule_with_newlines",
4760
"def_filename": "tests/norm-rule/test.yaml",
4861
"chapter_name": "my-chapter_name",
49-
"description": "Here's a description.\nIt's got 2 lines.\n",
5062
"tags": [
5163
{
52-
"name": "norm:paragraph:no-inline-anchors-in-paragraph",
53-
"text": "Paragraph without inline anchors",
64+
"name": "norm:paragraph:tag_with_newlines",
65+
"text": "Here’s the first line. Here’s the second line.",
5466
"tag_filename": "/build/test-norm-tags.json"
5567
}
5668
]
@@ -86,7 +98,7 @@
8698
"tags": [
8799
{
88100
"name": "norm:unordered-list:anchors-in-items:entire-list",
89-
"text": "Unordered List with anchors:",
101+
"text": "Item 1\n Item 2\nItem 3",
90102
"tag_filename": "/build/test-norm-tags.json"
91103
}
92104
]
@@ -120,12 +132,12 @@
120132
"tags": [
121133
{
122134
"name": "norm:description-list:anchors-in-items:item1",
123-
"text": "Description Item 1",
135+
"text": "Item 1",
124136
"tag_filename": "/build/test-norm-tags.json"
125137
},
126138
{
127139
"name": "norm:description-list:anchors-in-items:item3",
128-
"text": "Description Item 3",
140+
"text": "Item 3",
129141
"tag_filename": "/build/test-norm-tags.json"
130142
}
131143
]
@@ -137,24 +149,12 @@
137149
"tags": [
138150
{
139151
"name": "norm:description-list:anchors-in-items:item1",
140-
"text": "Description Item 1",
152+
"text": "Item 1",
141153
"tag_filename": "/build/test-norm-tags.json"
142154
},
143155
{
144156
"name": "norm:description-list:anchors-in-items:item3",
145-
"text": "Description Item 3",
146-
"tag_filename": "/build/test-norm-tags.json"
147-
}
148-
]
149-
},
150-
{
151-
"name": "rule_with_newlines",
152-
"def_filename": "tests/norm-rule/test.yaml",
153-
"chapter_name": "my-chapter_name",
154-
"tags": [
155-
{
156-
"name": "norm:tag_with_newlines",
157-
"text": "Here’s the first line. Here’s the second line.",
157+
"text": "Item 3",
158158
"tag_filename": "/build/test-norm-tags.json"
159159
}
160160
]
-14 Bytes
Binary file not shown.

tests/norm-rule/expected/test-norm-tags.json

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
{
22
"tags": {
33
"norm:inline": "inside inline",
4-
"norm:tag_with_newlines": "Here’s the first line. Here’s the second line.",
5-
"norm:paragraph:no-inline-anchors-in-paragraph": "Paragraph without inline anchors",
6-
"norm:paragraph:inline-anchors-in-paragraph:inline-anchors": "inline anchor",
7-
"norm:paragraph:inline-anchors-in-paragraph": "Paragraph with inline anchor and something.",
4+
"norm:paragraph:no-inline-anchors": "Paragraph without inline anchors",
5+
"norm:paragraph:inline-anchors:inline-anchor": "inline anchor",
6+
"norm:paragraph:inline-anchors:entire": "Paragraph with inline anchor and something.",
7+
"norm:paragraph:tag_with_newlines": "Here’s the first line. Here’s the second line.",
8+
"norm:table:no-anchors-in-cells:entire-table": "Header 1|Header 2\n===\nCell in column 1, row 1|Cell in column 2, row 1\nCell in column 1, row 2|Cell in column 2, row 2\n===",
89
"norm:table:anchors-in-cells:cell": "",
910
"norm:table:anchors-in-cells:entire-table": "===\n cell with anchor\ncell without anchor\n===",
10-
"norm:table:no-anchors-in-cells:entire-table": "Header 1|Header 2\n===\nCell in column 1, row 1|Cell in column 2, row 1\nCell in column 1, row 2|Cell in column 2, row 2\n===",
11-
"norm:unordered-list:anchors-in-items:entire-list": "Unordered List with anchors:",
11+
"norm:unordered-list:no-anchors-in-items:entire-list": "Item A\nItem B\nItem C",
1212
"norm:unordered-list:anchors-in-items:item1": "",
1313
"norm:unordered-list:anchors-in-items:item2": "",
14-
"norm:unordered-list:no-anchors-in-items:entire-list": "Unordered List without anchors:",
14+
"norm:unordered-list:anchors-in-items:entire-list": "Item 1\n Item 2\nItem 3",
1515
"norm:unordered-list:multiple-levels": "Zca and not F\nZca, Zcf and F (but not D) is specified (RV32 only)\nZca, Zcf and Zcd if D is specified (RV32 only)\n\nthis configuration excludes Zcmp, Zcmt\nZca, Zcd if D is specified (RV64 only)\n\nthis configuration excludes Zcmp, Zcmt",
16-
"norm:ordered-list:anchors-in-items:entire-list": "Ordered List with anchors:",
16+
"norm:ordered-list:no-anchors-in-items:entire-list": "Item A\nItem B\nItem C",
1717
"norm:ordered-list:anchors-in-items:item1": "",
1818
"norm:ordered-list:anchors-in-items:item2": "",
19-
"norm:ordered-list:no-anchors-in-items:entire-list": "Ordered List without anchors:",
20-
"norm:description-list:anchors-in-items:item1": "Description Item 1",
21-
"norm:description-list:anchors-in-items:item3": "Description Item 3",
22-
"norm:description-list:no-anchors-in-items:entire-list": "Description List without anchors in items:",
19+
"norm:ordered-list:anchors-in-items:entire-list": "Item 1\n Item 2\nItem 3",
20+
"norm:description-list:no-anchors-in-items:entire-list": "Description-A\nItem A\nDescription-B\nItem B\nDescription-C\nItem C",
21+
"norm:description-list:anchors-in-items:entire-list": "Description-1",
22+
"norm:description-list:anchors-in-items:item1": "Item 1",
23+
"norm:description-list:anchors-in-items:item3": "Item 3",
2324
"norm:admonition:single-paragraph-note": "",
25+
"norm:admonition:no-anchors-in-notes:entire-note": "Paragraph A\n\nParagraph B\n\nParagraph C",
2426
"norm:admonition:anchors-in-notes:note1": "Paragraph 1",
2527
"norm:admonition:anchors-in-notes:note3": "Paragraph 3",
2628
"norm:admonition:anchors-in-notes:entire-note": "Paragraph 1\n\nParagraph 2\n\nParagraph 3",
27-
"norm:admonition:no-anchors-in-notes:entire-note": "Paragraph 1\n\nParagraph 2\n\nParagraph 3",
2829
"norm:admonition:only-anchors-in-notes:note1": "Paragraph 1",
2930
"norm:admonition:only-anchors-in-notes:note3": "Paragraph 3"
3031
},
@@ -41,28 +42,28 @@
4142
"id": "_chapter_1_1_inline_tagging",
4243
"children": [],
4344
"tags": [
44-
"norm:inline",
45-
"norm:tag_with_newlines"
45+
"norm:inline"
4646
]
4747
},
4848
{
4949
"title": "Chapter 1.2 - Paragraph Tagging",
5050
"id": "_chapter_1_2_paragraph_tagging",
5151
"children": [],
5252
"tags": [
53-
"norm:paragraph:no-inline-anchors-in-paragraph",
54-
"norm:paragraph:inline-anchors-in-paragraph:inline-anchors",
55-
"norm:paragraph:inline-anchors-in-paragraph"
53+
"norm:paragraph:no-inline-anchors",
54+
"norm:paragraph:inline-anchors:inline-anchor",
55+
"norm:paragraph:inline-anchors:entire",
56+
"norm:paragraph:tag_with_newlines"
5657
]
5758
},
5859
{
5960
"title": "Chapter 2 - Table Tagging",
6061
"id": "_chapter_2_table_tagging",
6162
"children": [],
6263
"tags": [
64+
"norm:table:no-anchors-in-cells:entire-table",
6365
"norm:table:anchors-in-cells:cell",
64-
"norm:table:anchors-in-cells:entire-table",
65-
"norm:table:no-anchors-in-cells:entire-table"
66+
"norm:table:anchors-in-cells:entire-table"
6667
]
6768
}
6869
],
@@ -73,10 +74,10 @@
7374
"id": "_chapter_3_tagging_unordered_lists",
7475
"children": [],
7576
"tags": [
76-
"norm:unordered-list:anchors-in-items:entire-list",
77+
"norm:unordered-list:no-anchors-in-items:entire-list",
7778
"norm:unordered-list:anchors-in-items:item1",
7879
"norm:unordered-list:anchors-in-items:item2",
79-
"norm:unordered-list:no-anchors-in-items:entire-list",
80+
"norm:unordered-list:anchors-in-items:entire-list",
8081
"norm:unordered-list:multiple-levels"
8182
]
8283
},
@@ -85,20 +86,21 @@
8586
"id": "_chapter_4_tagging_ordered_lists",
8687
"children": [],
8788
"tags": [
88-
"norm:ordered-list:anchors-in-items:entire-list",
89+
"norm:ordered-list:no-anchors-in-items:entire-list",
8990
"norm:ordered-list:anchors-in-items:item1",
9091
"norm:ordered-list:anchors-in-items:item2",
91-
"norm:ordered-list:no-anchors-in-items:entire-list"
92+
"norm:ordered-list:anchors-in-items:entire-list"
9293
]
9394
},
9495
{
9596
"title": "Chapter 5 - Tagging Description Lists",
9697
"id": "_chapter_5_tagging_description_lists",
9798
"children": [],
9899
"tags": [
100+
"norm:description-list:no-anchors-in-items:entire-list",
101+
"norm:description-list:anchors-in-items:entire-list",
99102
"norm:description-list:anchors-in-items:item1",
100-
"norm:description-list:anchors-in-items:item3",
101-
"norm:description-list:no-anchors-in-items:entire-list"
103+
"norm:description-list:anchors-in-items:item3"
102104
]
103105
},
104106
{
@@ -107,10 +109,10 @@
107109
"children": [],
108110
"tags": [
109111
"norm:admonition:single-paragraph-note",
112+
"norm:admonition:no-anchors-in-notes:entire-note",
110113
"norm:admonition:anchors-in-notes:note1",
111114
"norm:admonition:anchors-in-notes:note3",
112115
"norm:admonition:anchors-in-notes:entire-note",
113-
"norm:admonition:no-anchors-in-notes:entire-note",
114116
"norm:admonition:only-anchors-in-notes:note1",
115117
"norm:admonition:only-anchors-in-notes:note3"
116118
]

0 commit comments

Comments
 (0)