-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add constants in a class and make codebeamer_url configurable
- Loading branch information
1 parent
b9f6424
commit 02a6620
Showing
8 changed files
with
142 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,64 @@ | ||
import re | ||
|
||
# URLs | ||
GIT_BASEDIR = "/vispiron-swe" | ||
GITHUB_URL = "https://github.com/" | ||
CODEBEMAER_URL = "https://codebeamer.bmwgroup.net/cb" | ||
|
||
class Constants: | ||
def __init__(self, codebeamer_url = ''): | ||
|
||
NON_EXISTING_INFO = "---" | ||
self.CODEBEAMER_LINK = codebeamer_url + "/issue/" | ||
self.REQUIREMENT = re.compile(r".*[@\\]requirement\s+" | ||
r"([\s*/]*(((CB-#)|({}))\d+)\s*,?)+" | ||
.format(self.CODEBEAMER_LINK)) | ||
self.REQUIREMENT_TAG_HTTP = ((r"([@\\]requirement(\s+" | ||
r"(CB-#\d+\s+)*({}\d+\s*,?\s*/*\*?)+)+)") | ||
.format(self.CODEBEAMER_LINK)) | ||
self.REQUIREMENT_TAG_HTTP_NAMED = r"({}(?P<number>\d+))".format(self.CODEBEAMER_LINK) | ||
|
||
LOBSTER_GENERATOR = "lobster_coda" | ||
NON_EXISTING_INFO = "---" | ||
|
||
VALID_TEST_MACROS = [ | ||
"TEST", | ||
"TEST_P", | ||
"TEST_F", | ||
"TYPED_TEST", | ||
"TYPED_TEST_P", | ||
"TYPED_TEST_SUITE", | ||
"TEST_P_INSTANCE", | ||
"TEST_F_INSTANCE", | ||
] | ||
LOBSTER_GENERATOR = "lobster_coda" | ||
|
||
VALID_TESTMETHODS = [ | ||
"TM_EQUIVALENCE", | ||
"TM_PAIRWISE", | ||
"TM_GUESSING", | ||
"TM_BOUNDARY", | ||
"TM_CONDITION", | ||
"TM_REQUIREMENT", | ||
"TM_TABLE", | ||
] | ||
VALID_TESTMETHODS = [ | ||
"TM_EQUIVALENCE", | ||
"TM_PAIRWISE", | ||
"TM_GUESSING", | ||
"TM_BOUNDARY", | ||
"TM_CONDITION", | ||
"TM_REQUIREMENT", | ||
"TM_TABLE", | ||
] | ||
|
||
VALID_TEST_MACROS = [ | ||
"TEST", | ||
"TEST_P", | ||
"TEST_F", | ||
"TYPED_TEST", | ||
"TYPED_TEST_P", | ||
"TYPED_TEST_SUITE", | ||
"TEST_P_INSTANCE", | ||
"TEST_F_INSTANCE", | ||
] | ||
|
||
# Regex | ||
TEST_CASE_INTRO = re.compile(r"^\s*(" + | ||
"|".join(VALID_TEST_MACROS) + | ||
r")\s*\(") | ||
TEST_CASE_INFO = re.compile( | ||
r"^\s*(" + "|".join(VALID_TEST_MACROS) + | ||
r")\s*\(\s*(?P<suite_name>\w+),\s*(?P<test_name>\w+)\)" | ||
) | ||
TEST_CASE_INTRO = re.compile(r"^\s*(" + | ||
"|".join(VALID_TEST_MACROS) + | ||
r")\s*\(") | ||
TEST_CASE_INFO = re.compile( | ||
r"^\s*(" + "|".join(VALID_TEST_MACROS) + | ||
r")\s*\(\s*(?P<suite_name>\w+),\s*(?P<test_name>\w+)\)" | ||
) | ||
REQUIREMENT_TAG = r"(CB-#\d+)" | ||
|
||
CODEBEAMER_LINK = CODEBEMAER_URL + "/issue/" | ||
REQUIREMENT = re.compile(r".*[@\\]requirement\s+" | ||
r"([\s*/]*(((CB-#)|({}))\d+)\s*,?)+" | ||
.format(CODEBEAMER_LINK)) | ||
REQUIREMENT_TAG = r"(CB-#\d+)" | ||
REQUIREMENT_TAG_HTTP = ((r"([@\\]requirement(\s+" | ||
r"(CB-#\d+\s+)*({}\d+\s*,?\s*/*\*?)+)+)") | ||
.format(CODEBEAMER_LINK)) | ||
REQUIREMENT_TAG_HTTP_NAMED = r"({}(?P<number>\d+))".format(CODEBEAMER_LINK) | ||
REQUIRED_BY = re.compile(r".*[@\\]requiredby\s+([\s*/]*(\w*::\w+),?\s*)+") | ||
REQUIRED_BY_TAG = r"(\w*::\w+)" | ||
DEFECT = re.compile( | ||
r"(@defect\s+)(((?:(CB-#\d+)|(OCT-#\d+)),?\s*)+)" + | ||
r"(?:///|/)\s+(((?:(CB-#\d+)|(OCT-#\d+)),?\s)+)?" | ||
) | ||
BRIEF = re.compile(r"(@brief\s+)([^@]+)") | ||
VERSION = re.compile(r"(@version\s+)(\d+([,]? \d+)*)+") | ||
OCT_TAG = r"(OCT-#\d+)" | ||
TESTMETHODS = re.compile(r"(@testmethods\s+)([^@]+)") | ||
# unmatch whole testmethod if invalid method is used | ||
# TESTMETHODS = re.compile(r"(@testmethods\s+ | ||
# )((" + "|".join(VALID_TESTMETHODS) + | ||
# ")([,]? (" + "|".join(VALID_TESTMETHODS) + "))*)+") | ||
TEST = re.compile(r"(@test\s+)([^@]+)") | ||
REQUIRED_BY = re.compile(r".*[@\\]requiredby\s+([\s*/]*(\w*::\w+),?\s*)+") | ||
REQUIRED_BY_TAG = r"(\w*::\w+)" | ||
DEFECT = re.compile( | ||
r"(@defect\s+)(((?:(CB-#\d+)|(OCT-#\d+)),?\s*)+)" + | ||
r"(?:///|/)\s+(((?:(CB-#\d+)|(OCT-#\d+)),?\s)+)?" | ||
) | ||
BRIEF = re.compile(r"(@brief\s+)([^@]+)") | ||
VERSION = re.compile(r"(@version\s+)(\d+([,]? \d+)*)+") | ||
OCT_TAG = r"(OCT-#\d+)" | ||
TESTMETHODS = re.compile(r"(@testmethods\s+)([^@]+)") | ||
# unmatch whole testmethod if invalid method is used | ||
# TESTMETHODS = re.compile(r"(@testmethods\s+ | ||
# )((" + "|".join(VALID_TESTMETHODS) + | ||
# ")([,]? (" + "|".join(VALID_TESTMETHODS) + "))*)+") | ||
TEST = re.compile(r"(@test\s+)([^@]+)") |
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
Oops, something went wrong.