Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-sdk-tools by
Diff: test/config_test/config_test.py
- Revision:
- 32:8ea194f6145b
- Parent:
- 22:9e85236d8716
--- a/test/config_test/config_test.py Mon Aug 29 11:56:59 2016 +0100 +++ b/test/config_test/config_test.py Wed Jan 04 11:58:24 2017 -0600 @@ -27,6 +27,7 @@ if cfg[k].value != expected[k]: return "'%s': expected '%s', got '%s'" % (k, expected[k], cfg[k].value) except KeyError: + raise return "Unexpected key '%s' in configuration data" % k for k in expected: if k not in ["desc", "expected_macros", "expected_features"] + cfg.keys(): @@ -39,13 +40,17 @@ if "test_data" in sys.modules: del sys.modules["test_data"] import test_data + # If the test defines custom targets, they must exist in a file called + # "targets.json" in the test's directory. + if os.path.isfile(os.path.join(full_name, "targets.json")): + set_targets_json_location(os.path.join(full_name, "targets.json")) + else: # uset the regular set of targets + set_targets_json_location() for target, expected in test_data.expected_results.items(): sys.stdout.write("%s:'%s'(%s) " % (name, expected["desc"], target)) sys.stdout.flush() err_msg = None try: - # Use 'set_targets_json_location' to remove the previous custom targets from the target list - set_targets_json_location(Target._Target__targets_json_location) cfg, macros, features = get_config(full_name, target, "GCC_ARM") macros = Config.config_macros_to_macros(macros) except ConfigException as e: