mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
examples: add 2 CI build/test configurations for system/console
This commit is contained in:
parent
871ea650f6
commit
d0e1edcd53
29
examples/system/console/example_test.py
Normal file
29
examples/system/console/example_test.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
from __future__ import print_function
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
import IDF
|
||||||
|
except ImportError:
|
||||||
|
test_fw_path = os.getenv('TEST_FW_PATH')
|
||||||
|
if test_fw_path and test_fw_path not in sys.path:
|
||||||
|
sys.path.insert(0, test_fw_path)
|
||||||
|
import IDF
|
||||||
|
|
||||||
|
|
||||||
|
@IDF.idf_example_test(env_tag='Example_WIFI')
|
||||||
|
def test_examples_system_console(env, extra_data):
|
||||||
|
dut = env.get_dut('console_example', 'examples/system/console', app_config_name='history')
|
||||||
|
print("Using binary path: {}".format(dut.app.binary_path))
|
||||||
|
dut.start_app()
|
||||||
|
dut.expect("Command history enabled")
|
||||||
|
env.close_dut(dut.name)
|
||||||
|
|
||||||
|
dut = env.get_dut('console_example', 'examples/system/console', app_config_name='nohistory')
|
||||||
|
print("Using binary path: {}".format(dut.app.binary_path))
|
||||||
|
dut.start_app()
|
||||||
|
dut.expect("Command history disabled")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
test_examples_system_console()
|
@ -59,6 +59,10 @@ static void initialize_nvs(void)
|
|||||||
|
|
||||||
static void initialize_console(void)
|
static void initialize_console(void)
|
||||||
{
|
{
|
||||||
|
/* Drain stdout before reconfiguring it */
|
||||||
|
fflush(stdout);
|
||||||
|
fsync(fileno(stdout));
|
||||||
|
|
||||||
/* Disable buffering on stdin */
|
/* Disable buffering on stdin */
|
||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
|
|
||||||
@ -121,6 +125,9 @@ void app_main(void)
|
|||||||
|
|
||||||
#if CONFIG_STORE_HISTORY
|
#if CONFIG_STORE_HISTORY
|
||||||
initialize_filesystem();
|
initialize_filesystem();
|
||||||
|
ESP_LOGI(TAG, "Command history enabled");
|
||||||
|
#else
|
||||||
|
ESP_LOGI(TAG, "Command history disabled");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
initialize_console();
|
initialize_console();
|
||||||
|
1
examples/system/console/sdkconfig.ci.history
Normal file
1
examples/system/console/sdkconfig.ci.history
Normal file
@ -0,0 +1 @@
|
|||||||
|
CONFIG_STORE_HISTORY=y
|
1
examples/system/console/sdkconfig.ci.nohistory
Normal file
1
examples/system/console/sdkconfig.ci.nohistory
Normal file
@ -0,0 +1 @@
|
|||||||
|
CONFIG_STORE_HISTORY=n
|
Loading…
Reference in New Issue
Block a user