Skip to content

Commit 4144bd1

Browse files
committed
tests(tests/integration): add a line marker test for Python source files
1 parent aa92629 commit 4144bd1

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def hello_world():
2+
# @relation(REQ-001, scope=line)
3+
print("Line marker") # noqa: T201
4+
5+
# @relation(REQ-001, scope=range_start)
6+
print("ignored hello world") # noqa: T201
7+
print("ignored hello world") # noqa: T201
8+
# @relation(REQ-001, scope=range_end)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[DOCUMENT]
2+
TITLE: Hello world doc
3+
4+
[REQUIREMENT]
5+
UID: REQ-001
6+
TITLE: Requirement Title
7+
STATEMENT: Requirement Statement
8+
RELATIONS:
9+
- TYPE: File
10+
VALUE: file.py
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[project]
2+
3+
features = [
4+
"REQUIREMENT_TO_SOURCE_TRACEABILITY",
5+
"SOURCE_FILE_LANGUAGE_PARSERS",
6+
]
7+
8+
exclude_source_paths = [
9+
"test.itest",
10+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# @relation(SDOC-SRS-124, scope=file)
2+
3+
RUN: %strictdoc export %S --output-dir %T | filecheck %s --dump-input=fail
4+
CHECK: Published: Hello world doc
5+
6+
RUN: %check_exists --file "%T/html/_source_files/file.py.html"
7+
8+
RUN: %cat %T/html/_source_files/file.py.html | filecheck %s --dump-input=fail --check-prefix CHECK-SOURCE-FILE
9+
CHECK-SOURCE-FILE: [ 2-3 ]
10+
CHECK-SOURCE-FILE: [ 5-8 ]

0 commit comments

Comments
 (0)