diff --git a/tests/pkg_u8g2/Makefile b/tests/pkg_u8g2/Makefile index 9933ed988cece5c7287fbfe9d198497f447fc0fb..97b138aec2e6bd741f71f83e4dd1f3e50a100a06 100644 --- a/tests/pkg_u8g2/Makefile +++ b/tests/pkg_u8g2/Makefile @@ -59,3 +59,6 @@ CFLAGS += -DTEST_PIN_RESET=$(TEST_PIN_RESET) CFLAGS += -DTEST_DISPLAY=$(TEST_DISPLAY) include $(RIOTBASE)/Makefile.include + +test: + tests/01-run.py diff --git a/tests/pkg_u8g2/tests/01-run.py b/tests/pkg_u8g2/tests/01-run.py new file mode 100755 index 0000000000000000000000000000000000000000..a8000938a8b482f616eb84f152124e082bc78a1d --- /dev/null +++ b/tests/pkg_u8g2/tests/01-run.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2017 Inria +# +# 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 os +import sys + +EXPECTED_STDOUT = ( + '00| |', + '02| |', + '04| |', + '06| |', + '08| |', + '10| █████â–â–‹ â–â–‹â–â–‹ ▟██▖ |', + '12| â–ˆ â–â–‹ â–â–‹â–â–‹â–â–› â–â–ˆ |', + '14| â–ˆ â–████▋â–â–‹â–█▙▄ |', + '16| â–ˆ â–â–‹ â–â–‹â–â–‹ ▀▜▙ |', + '18| â–ˆ â–â–‹ â–â–‹â–â–‹â–â–™ â–—â–ˆ |', + '20| â–ˆ â–â–‹ â–â–‹â–â–‹ ▜██▘ |', + '22| |', + '24| |', + '26| |', + '28| |', + '30| |', + '00| |', + '02| |', + '04| |', + '06| |', + '08| |', + '10| â–â–‹ ▟██▖ |', + '12| â–â–‹â–â–› â–â–ˆ |', + '14| â–â–‹â–█▙▄ |', + '16| â–â–‹ ▀▜▙ |', + '18| â–â–‹â–â–™ â–—â–ˆ |', + '20| â–â–‹ ▜██▘ |', + '22| |', + '24| |', + '26| |', + '28| |', + '30| |', + '00| â–„â–„â–– |', + '02| ▗████▋ |', + '04| ▗█▛▘ ▜█▖ |', + '06| â–â–ˆ █▋ |', + '08| ██ █▋ |', + '10| ██ ▟█▘ |', + '12| ▜█ ▄▟█▛ â–„ â–„â–„ â–„â–„â–„â–„ |', + '14| ▗▄█▖â–â–ˆâ–██▀ █▋ ▟▛▜▙ ▀▜▛▀ |', + '16| ▗██▀ â–â–ˆ ■█▋ █▋ â–ˆ â–â–‹ |', + '18| â–Ÿâ–› â–â–ˆ â–„ █▋ █▋ â–ˆ â–â–‹ |', + '20| █▋ â–â–ˆ â–█▋ █▋ █▋ â–ˆ â–â–‹ |', + '22| █▋ â–â–ˆ ▜█ █▋ █▋ â–ˆ â–â–‹ |', + '24| █▙ ▗█▛ â–█▙ █▋ █▋▗█ â–â–‹ |', + '26| â–█▙▄██▘ ▜█ █▘ â–██▘ â–â–‹ |', + '28| â–▜█▀▘ |', + '30| |', +) + + +def testfunc(child): + child.expect_exact('Initializing to stdout.') + child.expect_exact('Initializing display.') + child.expect_exact('Drawing on screen.') + + for line in EXPECTED_STDOUT: + child.expect_exact(line) + +if __name__ == "__main__": + sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner')) + from testrunner import run + sys.exit(run(testfunc))