Skip to content

Fixing constant cleaning when compiling tests #2712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/testing_mbed_OS_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The way tests are run and compiled in mbed OS 5 is substantially different from
- [Test names](#test-names)
- [Building tests](#building-tests)
- [Building process](#building-process)
- [App config](#app-config)
- [Running tests](#running-tests)
- [Writing tests](#writing-tests)
- [Debugging tests](#debugging-tests)
Expand Down Expand Up @@ -73,6 +74,12 @@ The full build process is:
1. For each discovered test, build all of its source files and link it with the non-test code that was built in step 1.
1. If specified, create a test specification file and place it in the given directory for use by testing tools. This is placed in the build directory by default when using mbed CLI.

#### App config

When building an mbed application, the presence of a `mbed_app.json` file allows you to set or override different config settings from libraries and targets. However, because the tests share a common build, this can cause issues when tests have different configurations that affect the OS.

If you need to use app config, this must be set via the `--app-config` option when calling `mbed test`. **If this option is not specified, the build system will ignore all `mbed_app.json` files and use the default config values.**

### Running tests

Automated tests can be run easily through mbed CLI. For information on using mbed CLI, please see its documentation.
Expand Down
10 changes: 9 additions & 1 deletion tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@
"Currently set search path: %s"
% (toolchain, search_path))

# App config
# Disable finding `mbed_app.json` files in the source tree if not
# explicitly defined on the command line. Config system searches for
# `mbed_app.json` files if `app_config` is None, but will set the
# app config data to an empty dictionary if the path value is another
# falsey value besides None.
if options.app_config is None:
options.app_config = ''

# Find all tests in the relevant paths
for path in all_paths:
all_tests.update(find_tests(path, mcu, toolchain, options.options,
Expand Down Expand Up @@ -184,7 +193,6 @@
verbose=options.verbose,
notify=notify,
archive=False,
remove_config_header_file=True,
app_config=options.app_config)

library_build_success = True
Expand Down