We had a home-made FileWrapper class, written in the days of Python 2,
whose main purpose was to add line numbers. Use the standard class fileinput
instead.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
All of our source files are encoded in UTF-8. We have other scripts that
make this assumption. We don't want to depend on the platform encoding.
This fixes a bug whereby non-ASCII characters in .function files led to an
error when writing the generated C file. FixMbed-TLS/mbedtls-framework#64.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
"\w" already matches "[a-zA-Z0-9_]" so CONDITION_VALUE_REGEX
can be simplified as proposed in this commit.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Upgrade mypy to 0.971, which is the last version that supports Python 3.6
(the oldest Python version that we currently run on the CI).
This fixes the error
```
framework/scripts/mbedtls_framework/outcome_analysis.py:119: error: Incompatible return value type (got "IO[Any]", expected "TextIO")
framework/scripts/mbedtls_framework/outcome_analysis.py:121: error: Incompatible return value type (got "IO[Any]", expected "TextIO")
```
As far as I can tell the fix is https://github.com/python/mypy/pull/9275
which was released in mypy 0.940.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Text mode ('t') is the default for the open builtin, but not for gzip.open
and its imitators. Always specify it explicitly to avoid making maintiners
wonder if there's an intended difference in behavior.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Command-line options allow choosing whether a never-executed test results in
a warning or an error. Also, a consuming script can make the default
permissive by setting FULL_COVERAGE_BY_DEFAULT to False.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Transparently read outcome files compressed with xz (which we currently use
on the CI) or with gzip.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Write the log of outcome analysis to a log file by default. This is a cheap
way of getting the outcome analysis log in an easy-to-access form on the CI:
with our current CI scripts, they are now automatically available as an
artifact called `analyze_outcomes.log`.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Do not allow values starting with a 0 because they can be either
accidentally octal or accidentally decimal. Hex values are not
affected by this change.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
In case of depends_on elements that include a conditional check
on some symbol's value, we allow the comparison element to
be anything and not just a fixed value as it was before.
This allows for more complex depends_on conditions where
build symbols and macros are used on both sides of the comparison.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Both commands use regex expressions to get a list of symbols.
The difference between the 2 is that:
- get-all returns both enabled and commented out symbols while
- get-all-enabled returns only enabled ones.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Upgrade mypy to 0.971, which is the last version that supports Python 3.6
(the oldest Python version that we currently run on the CI).
This fixes the error
```
framework/scripts/mbedtls_framework/outcome_analysis.py:119: error: Incompatible return value type (got "IO[Any]", expected "TextIO")
framework/scripts/mbedtls_framework/outcome_analysis.py:121: error: Incompatible return value type (got "IO[Any]", expected "TextIO")
```
As far as I can tell the fix is https://github.com/python/mypy/pull/9275
which was released in mypy 0.940.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit moves version.h back into /include/mbedtls from
tf-psa-crypto/drivers/builtin/include. This commit also changes the
necessary build files and scripts to generate version_features.c
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
And add temporary solution so it works with 3.6 and 4.0
Temporary solution to be resolved in #51.
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
`tests/opt-testcases/tls13-compat.sh` is supposed to be automatically
generated by `tests/scripts/generate_tls13_compat_tests.py`. So far, the
output has been updated by running the script manually and committing the
output. Switch to using our framework for generated files.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
To get rid on the reliance on sections, change "full" and friends to enable
settings based on whether the setting is boolean, rather than based on the
section it contains.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>