ztest: add missing headers

Recent changes to architecture headers did not address ztest headers due
to this bug in sanitycheck. Fixing them now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2019-10-23 05:24:00 -07:00
commit 529791dff7
2 changed files with 27 additions and 16 deletions

View file

@ -8,22 +8,6 @@
#include <sys/atomic.h>
/* These stubs aren't provided by the mocking framework, and I can't
* find a proper place to put them as mocking seems not to have a
* proper "arch" layer.
*/
#ifdef ZTEST_UNITTEST
static inline int z_arch_irq_lock(void)
{
return 0;
}
static inline void z_arch_irq_unlock(int key)
{
ARG_UNUSED(key);
}
#endif
/* There's a spinlock validation framework available when asserts are
* enabled. It adds a relatively hefty overhead (about 3k or so) to
* kernel code size, don't use on platforms known to be small. (Note

View file

@ -1,5 +1,32 @@
/*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SUBSYS_TESTSUITE_ZTEST_INCLUDE_ARCH_CPU_H
#define ZEPHYR_SUBSYS_TESTSUITE_ZTEST_INCLUDE_ARCH_CPU_H
/* This file exists as a hack around Zephyr's dependencies */
static inline u32_t z_arch_k_cycle_get_32(void)
{
return 0;
}
static ALWAYS_INLINE unsigned int z_arch_irq_lock(void)
{
return 0;
}
static inline void z_arch_irq_unlock(unsigned int key)
{
ARG_UNUSED(key);
}
static inline bool z_arch_irq_unlocked(unsigned int key)
{
return 0;
}
#include <sys/arch_inlines.h>
#endif /* ZEPHYR_SUBSYS_TESTSUITE_ZTEST_INCLUDE_ARCH_CPU_H */