mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #12314 from haukepetersen/add_test_nrfmin
tests: add distinct test app for nrfmin driver
This commit is contained in:
commit
aa7f23dbbd
15
tests/driver_nrfmin/Makefile
Normal file
15
tests/driver_nrfmin/Makefile
Normal file
@ -0,0 +1,15 @@
|
||||
BOARD ?= nrf52dk
|
||||
include ../Makefile.tests_common
|
||||
|
||||
# include nrfmin, the main purpose of this test
|
||||
USEMODULE += nrfmin
|
||||
# use a minimal GNRC configuration
|
||||
USEMODULE += gnrc_netdev_default
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_ipv6
|
||||
USEMODULE += gnrc_icmpv6_echo
|
||||
# also add the shell with some basic shell commands
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
10
tests/driver_nrfmin/README.md
Normal file
10
tests/driver_nrfmin/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Test for the `nrfmin` radio driver
|
||||
The `nrfmin` driver is a RIOT specific driver that runs the on-chip radios on
|
||||
Nordic nRF5x-based CPUs in a proprietary mode. But per default, we run the nRF's
|
||||
radios either in BLE mode (using NImBLE), or in IEEE802.15.4 mode (using the
|
||||
`nrf802154` driver).
|
||||
|
||||
To make sure the `nrfmin` driver is still covered by RIOT's test system, this
|
||||
test application is added. The test simply contains a basic GNRC configuration
|
||||
and of course the `nrfmin` driver, which should be enough to verify the drivers
|
||||
functionality.
|
43
tests/driver_nrfmin/main.c
Normal file
43
tests/driver_nrfmin/main.c
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup tests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Test for the Nordic specific nrfmin radio driver
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "shell.h"
|
||||
#include "msg.h"
|
||||
|
||||
#define MAIN_QUEUE_SIZE (8)
|
||||
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* we need a message queue for the thread running the shell in order to
|
||||
* receive potentially fast incoming networking packets */
|
||||
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);
|
||||
puts("Test for the RIOT integration of the nrfmin radio driver");
|
||||
|
||||
/* start shell */
|
||||
puts("All up, running the shell now");
|
||||
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||
|
||||
/* should be never reached */
|
||||
return 0;
|
||||
}
|
14
tests/driver_nrfmin/tests/01-run.py
Executable file
14
tests/driver_nrfmin/tests/01-run.py
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from testrunner import run
|
||||
|
||||
|
||||
def testfunc(child):
|
||||
child.expect("All up, running the shell now")
|
||||
child.sendline("ifconfig")
|
||||
child.expect(r"Iface\s+(\d+)\s+HWaddr:")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(run(testfunc, timeout=1, echo=False))
|
Loading…
Reference in New Issue
Block a user