From df3f10a9633ec7b0ab0232e797331cf59231ad43 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Fri, 19 Jun 2020 11:55:59 +0200 Subject: [PATCH] tests/od: always include od_string in test This test removes the test case for od_string not being included, it instead keeps the second test script that rested od and od_string. --- tests/od/Makefile | 8 +------- tests/od/tests/01-run.py | 40 ++++++++++++++++++------------------- tests/od/tests/02-run.py | 43 ---------------------------------------- 3 files changed, 21 insertions(+), 70 deletions(-) delete mode 100755 tests/od/tests/02-run.py diff --git a/tests/od/Makefile b/tests/od/Makefile index 24788a3152..54315c8750 100644 --- a/tests/od/Makefile +++ b/tests/od/Makefile @@ -1,12 +1,6 @@ include ../Makefile.tests_common USEMODULE += od -# USEMODULE += od_string - -ifeq (,$(filter od_string,$(USEMODULE))) - TESTS=$(APPDIR)/tests/01-run.py -else - TESTS=$(APPDIR)/tests/02-run.py -endif +USEMODULE += od_string include $(RIOTBASE)/Makefile.include diff --git a/tests/od/tests/01-run.py b/tests/od/tests/01-run.py index 0a9969845e..a9de23120b 100755 --- a/tests/od/tests/01-run.py +++ b/tests/od/tests/01-run.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright (C) 2016 Freie Universität Berlin +# Copyright (C) 2017 Hamburg University of Applied Sciences # # 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 @@ -12,29 +12,29 @@ from testrunner import run def testfunc(child): child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)") - child.expect_exact("00000000 41 42 00") + child.expect_exact("00000000 41 42 00 AB.") child.expect_exact("od_hex_dump(long_str, sizeof(long_str), OD_WIDTH_DEFAULT)") - child.expect_exact("00000000 FF 2C 61 FF 2E 62 63 64 65 66 67 68 69 6A 6B 6C") - child.expect_exact("00000010 6D 6E 6F 70 00") + child.expect_exact("00000000 FF 2C 61 FF 2E 62 63 64 65 66 67 68 69 6A 6B 6C .,a..bcdefghijkl") + child.expect_exact("00000010 6D 6E 6F 70 00 mnop.") child.expect_exact("od_hex_dump(long_str, sizeof(long_str), 4)") - child.expect_exact("00000000 FF 2C 61 FF") - child.expect_exact("00000004 2E 62 63 64") - child.expect_exact("00000008 65 66 67 68") - child.expect_exact("0000000C 69 6A 6B 6C") - child.expect_exact("00000010 6D 6E 6F 70") - child.expect_exact("00000014 00") + child.expect_exact("00000000 FF 2C 61 FF .,a.") + child.expect_exact("00000004 2E 62 63 64 .bcd") + child.expect_exact("00000008 65 66 67 68 efgh") + child.expect_exact("0000000C 69 6A 6B 6C ijkl") + child.expect_exact("00000010 6D 6E 6F 70 mnop") + child.expect_exact("00000014 00 .") child.expect_exact("od_hex_dump(long_str, sizeof(long_str), 3)") - child.expect_exact("00000000 FF 2C 61") - child.expect_exact("00000003 FF 2E 62") - child.expect_exact("00000006 63 64 65") - child.expect_exact("00000009 66 67 68") - child.expect_exact("0000000C 69 6A 6B") - child.expect_exact("0000000F 6C 6D 6E") - child.expect_exact("00000012 6F 70 00") + child.expect_exact("00000000 FF 2C 61 .,a") + child.expect_exact("00000003 FF 2E 62 ..b") + child.expect_exact("00000006 63 64 65 cde") + child.expect_exact("00000009 66 67 68 fgh") + child.expect_exact("0000000C 69 6A 6B ijk") + child.expect_exact("0000000F 6C 6D 6E lmn") + child.expect_exact("00000012 6F 70 00 op.") child.expect_exact("od_hex_dump(long_str, sizeof(long_str), 8)") - child.expect_exact("00000000 FF 2C 61 FF 2E 62 63 64") - child.expect_exact("00000008 65 66 67 68 69 6A 6B 6C") - child.expect_exact("00000010 6D 6E 6F 70 00") + child.expect_exact("00000000 FF 2C 61 FF 2E 62 63 64 .,a..bcd") + child.expect_exact("00000008 65 66 67 68 69 6A 6B 6C efghijkl") + child.expect_exact("00000010 6D 6E 6F 70 00 mnop.") print("All tests successful") diff --git a/tests/od/tests/02-run.py b/tests/od/tests/02-run.py deleted file mode 100755 index a9de23120b..0000000000 --- a/tests/od/tests/02-run.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (C) 2017 Hamburg University of Applied Sciences -# -# 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 - - -def testfunc(child): - child.expect_exact("od_hex_dump(short_str, sizeof(short_str), OD_WIDTH_DEFAULT)") - child.expect_exact("00000000 41 42 00 AB.") - child.expect_exact("od_hex_dump(long_str, sizeof(long_str), OD_WIDTH_DEFAULT)") - child.expect_exact("00000000 FF 2C 61 FF 2E 62 63 64 65 66 67 68 69 6A 6B 6C .,a..bcdefghijkl") - child.expect_exact("00000010 6D 6E 6F 70 00 mnop.") - child.expect_exact("od_hex_dump(long_str, sizeof(long_str), 4)") - child.expect_exact("00000000 FF 2C 61 FF .,a.") - child.expect_exact("00000004 2E 62 63 64 .bcd") - child.expect_exact("00000008 65 66 67 68 efgh") - child.expect_exact("0000000C 69 6A 6B 6C ijkl") - child.expect_exact("00000010 6D 6E 6F 70 mnop") - child.expect_exact("00000014 00 .") - child.expect_exact("od_hex_dump(long_str, sizeof(long_str), 3)") - child.expect_exact("00000000 FF 2C 61 .,a") - child.expect_exact("00000003 FF 2E 62 ..b") - child.expect_exact("00000006 63 64 65 cde") - child.expect_exact("00000009 66 67 68 fgh") - child.expect_exact("0000000C 69 6A 6B ijk") - child.expect_exact("0000000F 6C 6D 6E lmn") - child.expect_exact("00000012 6F 70 00 op.") - child.expect_exact("od_hex_dump(long_str, sizeof(long_str), 8)") - child.expect_exact("00000000 FF 2C 61 FF 2E 62 63 64 .,a..bcd") - child.expect_exact("00000008 65 66 67 68 69 6A 6B 6C efghijkl") - child.expect_exact("00000010 6D 6E 6F 70 00 mnop.") - - print("All tests successful") - - -if __name__ == "__main__": - sys.exit(run(testfunc, timeout=1))