diff --git a/test/maple_test/compare.py b/test/maple_test/compare.py index dd2eeb1de5255abbcfc28e04968fcaadedb54bf4..3ac77e75801eaf9d12482cee352f1311f52b2354 100644 --- a/test/maple_test/compare.py +++ b/test/maple_test/compare.py @@ -31,7 +31,7 @@ EXPECTED_REGEX = r"\:{line_num}\:.*\:.*" SCAN_KEYWORDS = ["auto", "not", "next", "end"] CMP_KEYWORDS = ["end", "not", "next", "full"] -EXPECTED_KEYWORDS = ["scan", "scan-not"] +EXPECTED_KEYWORDS = ["scan", "scan-not", "scan-auto"] class CompareError(Exception): @@ -74,9 +74,13 @@ def main(): pattern_flag, pattern = split_pattern_line(compare_pattern) info = "" + keywords = pattern_flag.split("-") if flag.strip() in assert_flags: info = "It's a assert, " elif flag.strip() in expected_flags: + if "auto" in keywords: + pattern = r"\s+".join([re.escape(word) for word in pattern.split()]) + keywords.remove("auto") pattern = EXPECTED_REGEX.format(line_num=line_num) + pattern if pattern_flag.strip() not in EXPECTED_KEYWORDS: raise CompareError( @@ -85,7 +89,6 @@ def main(): else: raise CompareError("Unsupport flag: {!r}".format(flag)) - keywords = pattern_flag.split("-") match_func = gen_match_func(keywords) if "next" not in keywords and "end" not in keywords: start = 0 diff --git a/test/maple_test/task.py b/test/maple_test/task.py index 8cef13ba65548a49de5842cf80fea7b2564eb9a4..b321b1e61a2d0245655d5cf26e8d6a80825c542a 100644 --- a/test/maple_test/task.py +++ b/test/maple_test/task.py @@ -207,7 +207,7 @@ class TestSuiteTask: case_files.update(_cases) else: logger.info( - "Testlist: {}, ALL-TEST-CASE: {} is contain not test case".format( + "Testlist: {}, ALL-TEST-CASE: {} is invalid test case".format( testlist_path, pattern ) ) @@ -217,7 +217,7 @@ class TestSuiteTask: case_files -= _cases else: logger.info( - "Testlist: {}, EXCLUDE-TEST-CASE: {} is contain not test case".format( + "Testlist: {}, EXCLUDE-TEST-CASE: {} is invalid test case".format( testlist_path, pattern ) )