tests: kernel: common: fix where suites are defined

Remove definition of testcases in yaml file, those are now detected from
binary.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-05-22 14:38:56 +00:00
parent 75c11c0564
commit 8dae3cd4d2
14 changed files with 46 additions and 38 deletions

View File

@ -4,11 +4,6 @@ cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(kernel_common)
if(NOT CONFIG_ARM)
target_sources(app PRIVATE
src/bitfield.c
)
endif()
if(CONFIG_PRINTK)
target_sources(app PRIVATE
src/printk.c

View File

@ -337,6 +337,9 @@ ZTEST(atomic, test_threads_access_atomic)
zassert_true(total_atomic == (TEST_CYCLE * THREADS_NUM),
"atomic counting failure");
}
extern void *common_setup(void);
ZTEST_SUITE(atomic, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -665,6 +665,8 @@ ZTEST(bitarray, test_ffs)
zassert_equal(find_lsb_set(value), bit + 1, "LSB is not matched");
}
}
extern void *common_setup(void);
ZTEST_SUITE(bitarray, NULL, common_setup, NULL, NULL, NULL);
/**
* @}

View File

@ -33,6 +33,9 @@
*/
ZTEST(bitfield, test_bitfield)
{
#ifdef CONFIG_ARM
ztest_test_skip();
#else
uint32_t b1 = 0U;
unsigned char b2[BITFIELD_SIZE >> 3] = { 0 };
unsigned int bit;
@ -124,8 +127,14 @@ ZTEST(bitfield, test_bitfield)
"sys_bitfield_test_and_clear_bit set bit %d\n",
bit);
}
#endif
}
extern void *common_setup(void);
ZTEST_SUITE(bitfield, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -39,6 +39,9 @@ ZTEST(boot_delay, test_bootdelay)
(NSEC_PER_MSEC * CONFIG_BOOT_DELAY));
}
extern void *common_setup(void);
ZTEST_SUITE(boot_delay, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -456,6 +456,9 @@ ZTEST(byteorder, test_sys_put_le64)
zassert_mem_equal(tmp, buf, sizeof(uint64_t), "sys_put_le64() failed");
}
extern void *common_setup(void);
ZTEST_SUITE(byteorder, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -230,6 +230,10 @@ ZTEST(clock, test_ms_time_duration)
/** cleanup environment */
k_timer_stop(&ktimer);
}
extern void *common_setup(void);
ZTEST_SUITE(clock, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -160,3 +160,7 @@ ZTEST_USER(common_errno, test_errno)
k_thread_join(tid, K_FOREVER);
}
extern void *common_setup(void);
ZTEST_SUITE(common_errno, NULL, common_setup, NULL, NULL, NULL);

View File

@ -130,3 +130,6 @@ ZTEST(common_1cpu, test_nested_irq_offload)
k_thread_abort(&offload_thread);
}
extern void *common_setup(void);
ZTEST_SUITE(irq_offload, NULL, common_setup, NULL, NULL, NULL);

View File

@ -18,13 +18,6 @@
*
*/
#ifdef CONFIG_ARM
ZTEST(bitfield, test_bitfield)
{
ztest_test_skip();
}
#endif
#ifndef CONFIG_PRINTK
ZTEST(printk, test_printk)
{
@ -73,7 +66,7 @@ ZTEST(common, test_bounds_check_mitigation)
extern struct k_stack eno_stack;
extern struct k_thread eno_thread;
static void *common_setup(void)
void *common_setup(void)
{
#if CONFIG_USERSPACE
k_thread_access_grant(k_current_get(), &eno_thread, &eno_stack);
@ -83,28 +76,3 @@ static void *common_setup(void)
}
ZTEST_SUITE(common, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(atomic, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(bitarray, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(bitfield, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(boot_delay, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(byteorder, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(clock, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(common_errno, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(irq_offload, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(multilib, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(pow2, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(printk, NULL, common_setup, NULL, NULL, NULL);
ZTEST_SUITE(common_1cpu, NULL, common_setup,
ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL);

View File

@ -26,6 +26,9 @@ ZTEST(multilib, test_multilib)
zassert_equal(c, 33, "smoke-test failed: wrong multilib selected");
}
extern void *common_setup(void);
ZTEST_SUITE(multilib, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -75,3 +75,6 @@ ZTEST(pow2, test_pow2_ceil)
test_pow2_ceil_x(8, 8);
test_pow2_ceil_x(9, 16);
}
extern void *common_setup(void);
ZTEST_SUITE(pow2, NULL, common_setup, NULL, NULL, NULL);

View File

@ -194,6 +194,10 @@ ZTEST(printk, test_printk)
pk_console[count] = '\0';
zassert_true((strcmp(pk_console, expected) == 0), "snprintk failed");
}
extern void *common_setup(void);
ZTEST_SUITE(printk, NULL, common_setup, NULL, NULL, NULL);
/**
* @}
*/

View File

@ -88,6 +88,10 @@ ZTEST(common_1cpu, test_timeout_order)
}
}
extern void *common_setup(void);
ZTEST_SUITE(common_1cpu, NULL, common_setup,
ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL);
/**
* @}
*/