This adds some bits to support tagged arguments to be used for
packaging. If enabled, the packaging function no longer looks at
the format strings to determine the types of arguments, but
instead, each argument is tagged with a type by preceding it
with another argument as type (integer). This allows the format
strings to be removed from the final binary to conserve space.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add flag to copy function which indicates that read-only
string locations shall be kept in the output package.
Updated cbprintf_package test to pass.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added new flags to packaging API:
- CBPRINTF_PACKAGE_ADD_RO_STR_IDXS - when set, read-only string
locations are appended to the package
- CBPRINTF_PACKAGE_ADD_RW_STR_IDXS - when set, read-write string
locations are appended to the package (instead of appending actual
strings)
- CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(n) - indicate that n first strings
are known to be read only. Ignored in runtime packaging.
Add function for copying packages with optional appending strings.
Changed CBPRINTF_MUST_RUNTIME_PACKAGE to use same flags as packaging.
Aligned logging and test to those changes.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Long double test fails on riscv32 for unknown reason. Previously,
testcase.yaml was excluding whole test. Removed that and added
skipping in the code so that rest of the suite is executed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Reworked test to use different approach for C++ testing.
Instead of hackish include of test.inc, cmake is forcing
C++ compilation on test file when C++ option is set in
test configuration.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add flags to macro which checks if string must be packaged
using runtime approach.
Added flag CBPRINTF_MUST_RUNTIME_PACKAGE_CONST_CHAR. When flag
is set then const char pointers are considered as pointers to
fixed strings and do not require runtime packaging.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Ensure that length variables (len0, len1, len2) are positive
before they are used for array indexing.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Temporary disable logging-related failing tests on qemu_arc_hs6x
until we fix the rootcause so we can enable qemu_arc_hs6x in
upstream verification.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Added tests for fully self-contained packages and use of
CBPRINTF_PACKAGE_ADD_STRING_IDXS flag.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added support for conversion from a standard package which contains
pointers to read only strings to fully self-contained (fsc) package.
Fsc package contains all strings associated with the package thus
access to read only strings is not needed to format a string.
In order to allow conversion to fsc package, standard package must
contain locations of all string pointers within the package. Appending
that information is optional and is controlled by flags parameter
which was added to packaging API. If option flag is set then
package contains header, arguments, locations of read only strings and
transient strings (each prefixed with string argument location).
Package header has been extended with field which contains number of
read only string locations.
A function for conversion to fsc package has been added
(cbprintf_fsc_package()).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Puts all filter in common section and fix filters. Platforms in
integration_platforms must also be allowed first, otherwise the tests
will never run.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adding static to local functions. Using void * for %p argument
which often triggered compilation warning.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add validation of the case when package buffer is not aligned to
CBPRINTF_PACKAGE_ALIGNMENT.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Fixing issue 219727. Potentially negative return value was passed
to a function that was expecting positive value.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Extend test to validate cbprintf static packaging on various
platforms.
Added more test configurations: complete, nano, long double.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>