mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/turo_txt: Add turo_txt tests
This commit is contained in:
parent
7ab6729b04
commit
4337f97662
7
tests/turo_txt/Makefile
Normal file
7
tests/turo_txt/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
USEMODULE += test_utils_result_output
|
||||
USEMODULE += test_utils_result_output_txt
|
||||
USEMODULE += shell
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
4
tests/turo_txt/README.md
Normal file
4
tests/turo_txt/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# TURO (Test Utils Result Output) Test - TXT
|
||||
|
||||
This is only to test the txt variant of turo.
|
||||
Please check [the turo test](../turo) for more info.
|
4
tests/turo_txt/app.config.test
Normal file
4
tests/turo_txt/app.config.test
Normal file
@ -0,0 +1,4 @@
|
||||
CONFIG_MODULE_FMT=y
|
||||
CONFIG_MODULE_SHELL=y
|
||||
CONFIG_MODULE_TEST_UTILS_RESULT_OUTPUT=y
|
||||
CONFIG_MODULE_TEST_UTILS_RESULT_OUTPUT_TXT=y
|
1
tests/turo_txt/main.c
Symbolic link
1
tests/turo_txt/main.c
Symbolic link
@ -0,0 +1 @@
|
||||
../turo/main.c
|
55
tests/turo_txt/tests/01-run.py
Executable file
55
tests/turo_txt/tests/01-run.py
Executable file
@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (C) 2017 Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
#
|
||||
# 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.
|
||||
|
||||
import sys
|
||||
from testrunner import run
|
||||
|
||||
|
||||
PASSING_CMDS = [
|
||||
'turo_simple_s32 0',
|
||||
'turo_simple_s32 -1',
|
||||
'turo_simple_s32 0x7FFFFFFF',
|
||||
'turo_simple_s32 -2147483648',
|
||||
'turo_simple_array_u8 1',
|
||||
'turo_simple_array_u8 2 255',
|
||||
'turo_simple_array_s32 0 -1 0x7FFFFFFF -2147483648',
|
||||
'turo_simple_dict_string foo bar',
|
||||
'turo_simple_dict_s32 baz -2147483648',
|
||||
'turo_simple_exit_status 0',
|
||||
'test_multi_element_dict a b c d',
|
||||
'test_netif'
|
||||
]
|
||||
|
||||
|
||||
FAILING_CMDS = [
|
||||
'turo_simple_s32 a',
|
||||
'turo_simple_s32 0x100000000',
|
||||
'turo_simple_s32 -2147483649',
|
||||
'turo_simple_array_u8 -1',
|
||||
'turo_simple_array_u8 2 256',
|
||||
'turo_simple_array_s32 a b',
|
||||
'turo_simple_array_s32 -2147483649',
|
||||
'turo_simple_dict_s32 baz s',
|
||||
'turo_simple_dict_s32 baz -2147483649',
|
||||
'turo_simple_exit_status 1'
|
||||
]
|
||||
|
||||
|
||||
def testfunc(child):
|
||||
|
||||
# Simple checking if the exit code works across everything
|
||||
for cmd in PASSING_CMDS:
|
||||
child.sendline(cmd)
|
||||
child.expect('Success')
|
||||
for cmd in FAILING_CMDS:
|
||||
child.sendline(cmd)
|
||||
child.expect('Error')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(run(testfunc))
|
Loading…
Reference in New Issue
Block a user