The filter `--diff-filter=d' causes deleted files to be ignored from
the frozen tools check. But there is no reason for this, as deleting
a file can break compatibility with the legacy tools.
Having recently moved the frozen tools check to a standalone stage
at the end, we need to fetch the base branch so make comparison
work. Travis environments are not shared across different stages.
Without the fetch, the check always passes as a PR is compared with
itself.
We only compare files in current PR with the base branch. There's no
need to fetch the full git history or branches that are not involved
in the comparison.
This is to save time in Travis runs.
When the scripts for the old tools are modified (e.g. when a new
target is added), the frozen tools check fails but we allow the change
if it's really needed. By moving the frozen tools check to the end,
Travis doesn't terminate early and the other tests get to run.
The default distribution of CMake that comes with focal is 3.16.3. Add
kitware's repository (https://apt.kitware.com/) to the source list so
the latest copy of CMake is installed during CI.
Fixes#14494
MBED_TEST_MODE is required for backward compatibilty with CLI1. This
adds a test to ensure that the macro is created when using CLI2 for
testing. This also adds a test in `.travis.yml` that checks whether
CMake defines the macro when BUILD_TESTING is on.
CLI1 Reference: https://os.mbed.com/docs/mbed-os/v6.9/debug-test/greentea-for-testing-applications.html
Also, explicitly create and set the macro BUILD_TESTING to allow for
MBED_TEST_MODE to be defined by CMake. MBED_TEST_MODE is required for
backward compatibilty with CLI1. BUILD_TESTING is used to determine
whether to define MBED_TEST_MODE. Normally, this would be automatically
done by CTest (which we intend to add for test automation) but this
hasn't yet been added to our Greentea tests.
The removed tests were building applications from the content of their
respective README files. The events test was building with the full profile twice.
The first time with the repository as is; and the second time after deleting
some directories (to simulate the baremetal profile).
The littlefs test was building once with the full profile.
Testing make.py is no longer required as it is no longer supported.
There is already test coverage for APIs in the removed tests.
Do not force red status for PRs due to SPDX missing (license must be there). We will
add better SPDX checks later (more work required to enable these for 3rd party code).
ScanCode can possibly return many licenses found for a single file scanned.
This commit ensures that the file is not reported as lacking a permissive license
if at least one license found in it is permissive.
Previously the script was reporting an issue if it found at least one license
in a file that was not permissive.
Additionally catch more errors and provide specific details about failures.
Provide unitest.
Unfortunately, we need to remove status functionality as it exposes an information
it should rather not. There is no other way we can do it in the pull request coming
from forks (most of our PRs are from forks). It is better if we use pass/failure what
Travis provides. The information are in the logs. It should always print the status info at
the very end. A test should have "echo Failed with a reason...."
Fail if new file does not contain SPDX identifier. We only checked for changed files,
and warn if any found. This is not sufficient because new files should follow our license guide.
This fixes the problem.
As part of freezing the current tools, reject any changes to tools that
would require a re-release of the tools for the online compiler. This is
to free up our effort on existing tool releases which are very error
prone, time consuming, and labor intensive, so we can focus on
developing a far more maintainable set of tools.
As the online compiler contains a copy of the whole mbed-os folder, it
is not clear which parts of mbed-os are actually used. This change
estimates the dependency between the online compiler, online IDE, and
Mbed OS by searching for "from tools" in Python code in the os.mbed.com
repo
(https://github.com/ARMmbed/os.mbed.com/search?q=%22from+tools%22&unscoped_q=%22from+tools%22)
For further context and explanation on why we've frozen the legacy
tools, please see the blog post at
https://os.mbed.com/blog/entry/Introducing-the-new-Mbed-Tools/