Skip to content

Commit 698df11

Browse files
LukaszMrugalaaescolar
authored andcommitted
scripts: twister: RegEx speedup
Replace unoptimal RegEx with a faster solution. Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
1 parent 3a044ae commit 698df11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/pylib/twister/twisterlib/testplan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import copy
1717
import shutil
1818
import random
19+
1920
import snippets
2021
from pathlib import Path
2122
from argparse import Namespace
@@ -396,7 +397,6 @@ def info(what):
396397
sys.stdout.write(what + "\n")
397398
sys.stdout.flush()
398399

399-
400400
def add_configurations(self):
401401
board_dirs = set()
402402
# Create a list of board roots as defined by the build system in general
@@ -448,7 +448,7 @@ def add_configurations(self):
448448
# cmake/modules/extensions.cmake.
449449
revision_patterns = ["[A-Z]",
450450
"[0-9]+",
451-
"(0|[1-9][0-9]*)(_[0-9]+)*(_[0-9]+)*"]
451+
"(0|[1-9][0-9]*)(_[0-9]+){0,2}"]
452452

453453
for pattern in revision_patterns:
454454
result = re.match(f"{platform.name}_(?P<revision>{pattern})\\.conf", item)

0 commit comments

Comments
 (0)