-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend/sdoc_source_code: recognize C++ class function declarations/d…
…efinitions
- Loading branch information
Showing
14 changed files
with
447 additions
and
21 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
6 changes: 6 additions & 0 deletions
6
...atures/file_traceability/_language_parsers/cpp/01_cpp_class_function_declaration/file.hpp
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,6 @@ | ||
class EcuHal | ||
{ | ||
public: | ||
// @relation(REQ-1, scope=function) | ||
bool CanSend(const CanFrame &frame); | ||
}; |
10 changes: 10 additions & 0 deletions
10
...ures/file_traceability/_language_parsers/cpp/01_cpp_class_function_declaration/input.sdoc
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,10 @@ | ||
[DOCUMENT] | ||
TITLE: Hello world doc | ||
|
||
[REQUIREMENT] | ||
UID: REQ-1 | ||
TITLE: Requirement Title | ||
STATEMENT: Requirement Statement | ||
RELATIONS: | ||
- TYPE: File | ||
VALUE: file.hpp |
7 changes: 7 additions & 0 deletions
7
.../file_traceability/_language_parsers/cpp/01_cpp_class_function_declaration/strictdoc.toml
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,7 @@ | ||
[project] | ||
|
||
features = [ | ||
"REQUIREMENT_TO_SOURCE_TRACEABILITY", | ||
"SOURCE_FILE_LANGUAGE_PARSERS", | ||
"PROJECT_STATISTICS_SCREEN" | ||
] |
15 changes: 15 additions & 0 deletions
15
...ures/file_traceability/_language_parsers/cpp/01_cpp_class_function_declaration/test.itest
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,15 @@ | ||
REQUIRES: PYTHON_39_OR_HIGHER | ||
|
||
RUN: %strictdoc export %S --output-dir Output | filecheck %s --dump-input=fail | ||
CHECK: Published: Hello world doc | ||
|
||
RUN: %check_exists --file "%S/Output/html/_source_files/file.hpp.html" | ||
|
||
RUN: %cat %S/Output/html/%THIS_TEST_FOLDER/input.html | filecheck %s --dump-input=fail --check-prefix CHECK-HTML | ||
CHECK-HTML: <a{{.*}}href="../_source_files/file.hpp.html#REQ-1#4#5"> | ||
|
||
RUN: %cat %S/Output/html/_source_files/file.hpp.html | filecheck %s --dump-input=fail --check-prefix CHECK-SOURCE-FILE | ||
CHECK-SOURCE-FILE: <a{{.*}}href="../{{.*}}/input.html#1-REQ-1"{{.*}}> | ||
|
||
RUN: %cat %S/Output/html/source_coverage.html | filecheck %s --dump-input=fail --check-prefix CHECK-SOURCE-COVERAGE | ||
CHECK-SOURCE-COVERAGE: 33.3% |
3 changes: 3 additions & 0 deletions
3
...ceability/_language_parsers/cpp/02_cpp_class_function_declaration_and_definition/file.cpp
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 @@ | ||
bool EcuHal::CanSend(const CanFrame &frame) { | ||
return true; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ceability/_language_parsers/cpp/02_cpp_class_function_declaration_and_definition/file.hpp
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,6 @@ | ||
class EcuHal | ||
{ | ||
public: | ||
// @relation(REQ-1, scope=function) | ||
bool CanSend(const CanFrame &frame); | ||
}; |
10 changes: 10 additions & 0 deletions
10
...ability/_language_parsers/cpp/02_cpp_class_function_declaration_and_definition/input.sdoc
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,10 @@ | ||
[DOCUMENT] | ||
TITLE: Hello world doc | ||
|
||
[REQUIREMENT] | ||
UID: REQ-1 | ||
TITLE: Requirement Title | ||
STATEMENT: Requirement Statement | ||
RELATIONS: | ||
- TYPE: File | ||
VALUE: file.hpp |
7 changes: 7 additions & 0 deletions
7
...ity/_language_parsers/cpp/02_cpp_class_function_declaration_and_definition/strictdoc.toml
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,7 @@ | ||
[project] | ||
|
||
features = [ | ||
"REQUIREMENT_TO_SOURCE_TRACEABILITY", | ||
"SOURCE_FILE_LANGUAGE_PARSERS", | ||
"PROJECT_STATISTICS_SCREEN" | ||
] |
16 changes: 16 additions & 0 deletions
16
...ability/_language_parsers/cpp/02_cpp_class_function_declaration_and_definition/test.itest
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,16 @@ | ||
REQUIRES: PYTHON_39_OR_HIGHER | ||
|
||
RUN: %strictdoc export %S --output-dir Output | filecheck %s --dump-input=fail | ||
CHECK: Published: Hello world doc | ||
|
||
RUN: %check_exists --file "%S/Output/html/_source_files/file.hpp.html" | ||
|
||
RUN: %cat %S/Output/html/%THIS_TEST_FOLDER/input.html | filecheck %s --dump-input=fail --check-prefix CHECK-HTML | ||
CHECK-HTML: <a{{.*}}href="../_source_files/file.cpp.html#REQ-1#1#3"> | ||
CHECK-HTML: <a{{.*}}href="../_source_files/file.hpp.html#REQ-1#4#5"> | ||
|
||
RUN: %cat %S/Output/html/_source_files/file.hpp.html | filecheck %s --dump-input=fail --check-prefix CHECK-SOURCE-FILE | ||
CHECK-SOURCE-FILE: <a{{.*}}href="../{{.*}}/input.html#1-REQ-1"{{.*}}> | ||
|
||
RUN: %cat %S/Output/html/source_coverage.html | filecheck %s --dump-input=fail --check-prefix CHECK-SOURCE-COVERAGE | ||
CHECK-SOURCE-COVERAGE: 33.3% |
Oops, something went wrong.