This test takes a pathologically long time to run. The PR
this is part of takes 10x as long to run the test as it did
before.
Such behavior cannot be reproduced on real Xtensa hardware,
where the test completes on an Intel S1000 in 4 seconds.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
One fundamental validation criteria is to never have consecutive free
chunks. If that ever happens we failed to merge them. That means a free
chunk must always be surrounded by used chunks.
It is a pain to extend valid_chunk() with new rules as it is.
So a VALIDATE() macro is introduced to make things easier to work with.
It also allows for isolating each test, possibly making VALIDATE() into
__ASSERT() to determine exactly which test is tripping when debugging.
Finally, because of that new validation rule, sys_heap_validate() must
be modified so not to use valid_chunk() while it is flipping all the
"used" flags. So let's run valid_chunk() up front before alterating
chunk headers.
Now sys_heap_validate() has become justifiably more expensive and a few
emulated targets are about to bust the tests/lib/heap test timeout. So
bump the timeout as well.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
nsim is slow, if the MEMSZ is too targe, the test will
run a long time and make sanitycheck timeout.
There are two possible fixes to pass the sanitycheck test
* filter out nsim, not to block the sanitcheck test
* use a small MEMSZ for nsim to reduce the execution time.
Considering there are potential improvements for nsim (because
some qemu targets can pass), we use the 1st fix to pass the
sanitycheck temporarily.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
... because it is (required).
This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.
In this particular case, REQUIRED turns this harmless looking log
statement:
-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
Cannot specify sources for target "app" which is not built by
this project.
... into this louder, clearer, faster and (last but not least) final
error:
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by "Zephyr" with
any of the following names:
ZephyrConfig.cmake
zephyr-config.cmake
Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
"Zephyr_DIR" to a directory containing one of the above files. If
"Zephyr" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
On some STM32 boards : nucleo_wb55rg, nucleo_l152re
the test lasts longer than defaut 60sec timeout.
Increase timeout to 120 sec.
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
This CPU-bound test on qemu_riscv32 platform is very slow when
QEMU icount mode enabled, taking upwards of several minutes.
There's little value here, this is a unit test of library code
and we have coverage of the RISC-V 32 bit arch via hifive1.
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
The following PR's #23941#23601 was merged using old boilerplate
inclusion.
This commit updates those tests to use find_package(Zephyr)
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Some of the ARC platforms aren't consistent between kconfig and their
linker scripts as to the size of memory, add a special case.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The renode emulator is REALLY slow on this test, what completes in 20
seconds on qemu takes 4-10 minutes on renode. That's causing trouble
in CI.
And this is a CPU-bound unit test of library code, where we have
coverage for riscv32 via qemu anyway. There's no value to having
better platform emulation here.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
CONFIG_SRAM_SIZE is a kconfig value, which is an int (units of kb),
but when doing math on it to produce a memory buffer size needs to be
done in size_t precision otherwise we could overflow on 64 bit
platforms with >4G memory.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Use the white box validation and test rig added as part of the
sys_heap work. Add a layer that puts hashed cookies into the blocks
to detect corruption, check the validity state after every operation,
and enumerate a few different usage patterns:
+ Small heap, "real world" allocation where the heap is about half
full and most allocations succeed.
+ Small heap, "fragmentation runaway" scenario where most allocations
start failing, but the heap must remain consistent.
+ Big heap. We can't test this with the same exhaustive coverage
(many re/allocations for every byte of storage) for performance
reasons, but we do what we can.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>