Update test builder to use new resources

pull/7183/head
Jimmy Brisson 2018-04-24 15:01:24 -05:00
parent 3e6e9e8c26
commit 7c42302854
3 changed files with 13 additions and 14 deletions

View File

@ -137,8 +137,7 @@ def get_config(src_paths, target, toolchain_name, app_config=None):
toolchain = prepare_toolchain(src_paths, None, target, toolchain_name,
app_config=app_config)
# Scan src_path for config files
scan_resources(src_paths, toolchain)
res = Resources().scan_with_toolchain(src_paths, toolchain, exclude=False)
if toolchain.config.has_regions:
_ = list(toolchain.config.regions)
@ -676,10 +675,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
try:
# Call unified scan_resources
resources = scan_resources(src_paths, toolchain,
dependencies_paths=dependencies_paths,
inc_dirs=inc_dirs)
resources = Resources().scan_with_toolchain(
src_paths, toolchain, dependencies_paths, inc_dirs=inc_dirs)
# Copy headers, objects and static libraries - all files needed for
# static lib

View File

@ -168,7 +168,11 @@ class Resources(object):
self.features = LazyDict()
self.ignored_dirs = []
self.labels = {}
self.labels = {
"TARGET": [],
"TOOLCHAIN": [],
"FEATURE": []
}
# Pre-mbed 2.0 ignore dirs
self.legacy_ignore_dirs = (LEGACY_IGNORE_DIRS | TOOLCHAINS)

View File

@ -65,8 +65,8 @@ from tools.build_api import prep_properties
from tools.build_api import create_result
from tools.build_api import add_result_to_report
from tools.build_api import prepare_toolchain
from tools.build_api import scan_resources
from tools.build_api import get_config
from tools.resources import Resources
from tools.libraries import LIBRARIES, LIBRARY_MAP
from tools.options import extract_profile
from tools.toolchains import TOOLCHAIN_PATHS
@ -2082,12 +2082,9 @@ def find_tests(base_dir, target_name, toolchain_name, app_config=None):
# List of common folders: (predicate function, path) tuple
commons = []
# Prepare the toolchain
toolchain = prepare_toolchain([base_dir], None, target_name, toolchain_name,
app_config=app_config)
# Scan the directory for paths to probe for 'TESTS' folders
base_resources = scan_resources([base_dir], toolchain)
base_resources = Resources()
base_resources.add_directory(base_dir, None)
dirs = base_resources.inc_dirs
for directory in dirs:
@ -2096,7 +2093,8 @@ def find_tests(base_dir, target_name, toolchain_name, app_config=None):
# If the directory contains a subdirectory called 'TESTS', scan it for test cases
if 'TESTS' in subdirs:
walk_base_dir = join(directory, 'TESTS')
test_resources = toolchain.scan_resources(walk_base_dir, base_path=base_dir)
test_resources = Resources()
test_resources.add_directory(walk_base_dir, base_dir)
# Loop through all subdirectories
for d in test_resources.inc_dirs: