tests: Add basic tests for menu plugin

This checks basic features of kas menu, some option selection, yaml
including, rebuilding and target selection.

The UI is operated by mocking smack's GridFormHelp.runOnce and some
result evaluation functions. Injecting keys from the keyboard was not
easily possibly (if at all), thus this approach. The menu rendering is
not shown due to pytest.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2021-10-08 17:24:46 +02:00
parent da62e0bfbd
commit 95df3720e1
7 changed files with 153 additions and 1 deletions

32
tests/test_menu/Kconfig Normal file
View File

@@ -0,0 +1,32 @@
config KAS_INCLUDE_MAIN
string
default "test.yaml"
config KAS_BUILD_SYSTEM
string
default "openembedded"
config BOOL_OPT1
bool "ppt1"
config KAS_INCLUDE_OPT1
string
default "opt1.yaml"
depends on BOOL_OPT1
choice
prompt "choice"
default CHOICE1
config CHOICE1
bool "choice1"
config CHOICE2
bool "choice2"
endchoice
config KAS_TARGET_CHOICE
string
default "target1" if CHOICE1
default "target2" if CHOICE2

3
tests/test_menu/bitbake Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "$@" > bitbake.options

View File

@@ -0,0 +1,3 @@
#!/bin/sh
export PATH=$(pwd):$PATH

View File

@@ -0,0 +1,7 @@
header:
version: 11
local_conf_header:
opt1: |
OPT1 = "1"

View File

@@ -0,0 +1,5 @@
header:
version: 11
repos:
this: