tests/drivers/pci_enum: move to ztest and run in HW when possible
This test case just exercises the PCI enumeration and there is no real way to test success/failure other than running it and the kernel not crashing. Moved to ztest. Retag so it is actually ran on QEMU/x86 and galileo once we deploy in the HW pool. Note this means that we need to force CONFIG_PCI on Qemu/x86, which can run this testcase. Change-Id: I85b64800f7d989357927b4a25777041047293b34 Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This commit is contained in:
parent
f23b038431
commit
bcb6ed95e7
8 changed files with 18 additions and 40 deletions
|
@ -1,5 +1,9 @@
|
||||||
BOARD ?= qemu_x86
|
BOARD ?= qemu_x86
|
||||||
MDEF_FILE = prj.mdef
|
# In QEMU x86, we have to force CONFIG_PCI being defined, as the defconfig does not have it.
|
||||||
|
ifeq ($(BOARD), qemu_x86)
|
||||||
|
CONF_FILE = prj_$(BOARD).conf
|
||||||
|
else
|
||||||
CONF_FILE = prj.conf
|
CONF_FILE = prj.conf
|
||||||
|
endif
|
||||||
|
|
||||||
include ${ZEPHYR_BASE}/Makefile.inc
|
include ${ZEPHYR_BASE}/Makefile.inc
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
CONFIG_STDOUT_CONSOLE=y
|
CONFIG_STDOUT_CONSOLE=y
|
||||||
CONFIG_PCI_ENUMERATION=y
|
CONFIG_PCI_ENUMERATION=y
|
||||||
CONFIG_PCI_DEBUG=y
|
CONFIG_PCI_DEBUG=y
|
||||||
|
CONFIG_ZTEST=y
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
% Application : PCI enumeration application
|
|
||||||
|
|
||||||
% TASK NAME PRIO ENTRY STACK GROUPS
|
|
||||||
% ===========================================
|
|
||||||
TASK TASKA 7 task_enum_pci 1024 [EXE]
|
|
5
tests/drivers/pci_enum/prj_qemu_x86.conf
Normal file
5
tests/drivers/pci_enum/prj_qemu_x86.conf
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
CONFIG_PCI=y
|
||||||
|
CONFIG_STDOUT_CONSOLE=y
|
||||||
|
CONFIG_PCI_ENUMERATION=y
|
||||||
|
CONFIG_PCI_DEBUG=y
|
||||||
|
CONFIG_ZTEST=y
|
|
@ -1,5 +0,0 @@
|
||||||
# @testcase dynamic
|
|
||||||
# @targets \
|
|
||||||
# board:(galileo|qemu_x86|qemu_cortex_m3)
|
|
||||||
#
|
|
||||||
# @eval console-rx %(console)s:20 Enumeration complete on %(bsp)s
|
|
|
@ -1,3 +1,3 @@
|
||||||
|
include $(ZEPHYR_BASE)/tests/Makefile.test
|
||||||
ccflags-y += -I${ZEPHYR_BASE}/include/drivers
|
ccflags-y += -I${ZEPHYR_BASE}/include/drivers
|
||||||
|
|
||||||
obj-y = pci_enum.o
|
obj-y = pci_enum.o
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#include <zephyr.h>
|
#include <ztest.h>
|
||||||
#include <stdint.h>
|
|
||||||
#include <misc/printk.h>
|
|
||||||
#include <pci/pci.h>
|
#include <pci/pci.h>
|
||||||
|
|
||||||
void pci_enumerate(void)
|
static void pci_enumerate(void)
|
||||||
{
|
{
|
||||||
struct pci_dev_info info = {
|
struct pci_dev_info info = {
|
||||||
.function = PCI_FUNCTION_ANY,
|
.function = PCI_FUNCTION_ANY,
|
||||||
|
@ -39,28 +37,8 @@ void pci_enumerate(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MICROKERNEL
|
void test_main(void)
|
||||||
|
|
||||||
|
|
||||||
static int done;
|
|
||||||
|
|
||||||
void task_enum_pci(void)
|
|
||||||
{
|
{
|
||||||
if (done) {
|
ztest_test_suite(pci_test, ztest_unit_test(pci_enumerate));
|
||||||
task_yield();
|
ztest_run_test_suite(pci_test);
|
||||||
}
|
|
||||||
|
|
||||||
pci_enumerate();
|
|
||||||
printk("Enumeration complete on %s", CONFIG_ARCH);
|
|
||||||
done = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* CONFIG_NANOKERNEL */
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
pci_enumerate();
|
|
||||||
printk("Enumeration complete on %s", CONFIG_ARCH);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CONFIG_MICROKERNEL */
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[test]
|
[test]
|
||||||
build_only = true
|
|
||||||
tags = samples
|
tags = samples
|
||||||
filter = CONFIG_PCI
|
filter = CONFIG_PCI
|
||||||
|
platform_whitelist = qemu_x86 galileo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue