zephyr/tests/kernel/interrupt/src/main.c
Enjia Mai c9c8cec3b6 tests: interrupt: add test cases of direct interrupt for arch x86 and posix
Add test cases of direct interrupt for arch x86 and posix.

We register two direct interrupt at build time, then triggering
interrupt and check if ISR handler has executed or not. We also
check irq_enable and irq_disable works.

Why we add an extra compiler option "-mgeneral-regs-only" to make
it works in arch x86. because there might be some existing x87
instructions executing inside interrupt context.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-05-07 23:24:17 -04:00

32 lines
894 B
C

/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <ztest.h>
extern void test_isr_dynamic(void);
extern void test_nested_isr(void);
extern void test_prevent_interruption(void);
extern void test_isr_regular(void);
extern void test_isr_offload_job_multiple(void);
extern void test_isr_offload_job_identi(void);
extern void test_isr_offload_job(void);
extern void test_direct_interrupt(void);
void test_main(void)
{
ztest_test_suite(interrupt_feature,
ztest_unit_test(test_isr_dynamic),
ztest_unit_test(test_nested_isr),
ztest_unit_test(test_prevent_interruption),
ztest_unit_test(test_isr_regular),
ztest_unit_test(test_isr_offload_job_multiple),
ztest_unit_test(test_isr_offload_job_identi),
ztest_unit_test(test_isr_offload_job),
ztest_unit_test(test_direct_interrupt)
);
ztest_run_test_suite(interrupt_feature);
}