Merge pull request #6805 from theotherjimmy/reorder-test-configs

tools: Reorder test configuration priority
pull/6365/merge
Cruz Monrreal 2018-05-07 19:15:14 -05:00 committed by GitHub
commit ceeedfd99c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -27,9 +27,9 @@ import fnmatch
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, ROOT)
from tools.config import ConfigException
from tools.config import ConfigException, Config
from tools.test_api import test_path_to_name, find_tests, get_test_config, print_tests, build_tests, test_spec_from_test_builds
import tools.test_configs as TestConfig
from tools.test_configs import get_default_config
from tools.options import get_default_options_parser, extract_profile, extract_mcus
from tools.build_api import build_project, build_library
from tools.build_api import print_build_memory_usage
@ -145,10 +145,13 @@ if __name__ == '__main__':
config = get_test_config(options.test_config, mcu)
if not config:
args_error(parser, "argument --test-config contains invalid path or identifier")
elif not options.app_config:
config = TestConfig.get_default_config(options.source_dir or ['.'], mcu)
else:
elif options.app_config:
config = options.app_config
else:
config = Config.find_app_config(options.source_dir)
if not config:
config = get_default_config(options.source_dir or ['.'], mcu)
# Find all tests in the relevant paths
for path in all_paths: