[travis new boards check] We now have two lists that contain the boards based on board_info and TRAVIS_BOARDS

C47D 4 years ago
parent a1db6c4379
commit b279d6b335

@ -8,9 +8,9 @@ import build_board_info
# Get boards in json format
boards_info_json = build_board_info.get_board_mapping()
# print(boards_info_json)
# TODO (Carlos) Find all the boards on the json format
# Get all the boards out of the json format
info_boards = boards_info_json.keys()
# We need to know the path of the .travis.yml file
base_path = os.path.dirname(__file__)
@ -22,12 +22,15 @@ with open(travis_path, 'r') as travis:
# Get all lines that contain the substring 'TRAVIS_BOARDS'
for line in travis:
line = travis.readline()
if 'TRAVIS_BOARDS' in line:
print('TRAVIS_BOARDS found')
# TODO (Carlos) Store the line content
# Get the lines with TRAVIS_BOARDS= in it
if line.find('TRAVIS_BOARDS=') is not -1:
# Store all the boards names into travis_boards
begin_of_names = line.find('TRAVIS_BOARDS=') + len('TRAVIS_BOARDS=') + 1
end_of_names = line.rfind('"')
boards = line[begin_of_names:end_of_names]
boards = boards.split(' ')
# We've reached the end of the env: section
elif 'addons' in line:
@ -35,8 +38,4 @@ with open(travis_path, 'r') as travis:
# TODO (Carlos) Getting all the boards on TRAVIS_BOARDS using regex matching
# Tranks sommersoft for the pattern
pattern = '(.+)'
# TODO (Carlos) Comparing boards listed in TRAVIS_BOARDS and boards got from get_board_mapping