diff --git a/tests/sys/progress_bar/Makefile b/tests/sys/progress_bar/Makefile index 842ee1ee9452..1519c5ea504c 100644 --- a/tests/sys/progress_bar/Makefile +++ b/tests/sys/progress_bar/Makefile @@ -3,24 +3,10 @@ include ../Makefile.sys_common USEMODULE += xtimer USEMODULE += progress_bar -CONFIG_PROGRESS_BAR_LENGTH ?= 50 -CONFIG_PROGRESS_BAR_FULL_CHARACTER ?= "█" -CONFIG_PROGRESS_BAR_EMPTY_CHARACTER ?= " " - -# Other nice progress bar characters: -#CONFIG_PROGRESS_BAR_FULL_CHARACTER ?= "◉" -#CONFIG_PROGRESS_BAR_EMPTY_CHARACTER ?= "◯" -#CONFIG_PROGRESS_BAR_FULL_CHARACTER ?= "▣" -#CONFIG_PROGRESS_BAR_EMPTY_CHARACTER ?= "▢" - -CFLAGS += -DCONFIG_PROGRESS_BAR_FULL_CHARACTER=\"$(CONFIG_PROGRESS_BAR_FULL_CHARACTER)\" -CFLAGS += -DCONFIG_PROGRESS_BAR_EMPTY_CHARACTER=\"$(CONFIG_PROGRESS_BAR_EMPTY_CHARACTER)\" -CFLAGS += -DCONFIG_PROGRESS_BAR_LENGTH=$(CONFIG_PROGRESS_BAR_LENGTH) - include $(RIOTBASE)/Makefile.include -# Make custom progress bar characters available in Python test script via -# environment variables +# Make custom progress bar configuration from app.config +# available in Python test script via environment variables export CONFIG_PROGRESS_BAR_FULL_CHARACTER export CONFIG_PROGRESS_BAR_EMPTY_CHARACTER export CONFIG_PROGRESS_BAR_LENGTH diff --git a/tests/sys/progress_bar/app.config b/tests/sys/progress_bar/app.config new file mode 100644 index 000000000000..312540e792e7 --- /dev/null +++ b/tests/sys/progress_bar/app.config @@ -0,0 +1,9 @@ +CONFIG_PROGRESS_BAR_LENGTH=50 +CONFIG_PROGRESS_BAR_FULL_CHARACTER="█" +CONFIG_PROGRESS_BAR_EMPTY_CHARACTER=" " + +# Other nice progress bar characters: +#CONFIG_PROGRESS_BAR_FULL_CHARACTER="◉" +#CONFIG_PROGRESS_BAR_EMPTY_CHARACTER="◯" +#CONFIG_PROGRESS_BAR_FULL_CHARACTER="▣" +#CONFIG_PROGRESS_BAR_EMPTY_CHARACTER="▢" diff --git a/tests/sys/progress_bar/tests/01-run.py b/tests/sys/progress_bar/tests/01-run.py index f7b4ed1b1dfc..e9c1a8192b61 100755 --- a/tests/sys/progress_bar/tests/01-run.py +++ b/tests/sys/progress_bar/tests/01-run.py @@ -18,14 +18,14 @@ def testfunc(child): - for i in range(0, 100, 10): + for i in range(0, 101, 10): ratio = int(i * LENGTH / 100.0) progress_str = FULL_CHARACTER * ratio progress_str += EMPTY_CHARACTER * (LENGTH - ratio) check_str = 'Progress bar 0 |{}| {:3}%'.format( progress_str, i) # todo: temporary printout for debugging this flaky test - print("EXPECTS:", check_str) + print("EXPECTS:", check_str, "LENGTH:", LENGTH, "ratio:", ratio) child.expect_exact(check_str) child.expect_exact("Done!")