From 672dbd707eed9aef92b301cea78540d414cc3714 Mon Sep 17 00:00:00 2001 From: Federico Pellegrin Date: Fri, 29 Mar 2019 07:19:26 +0100 Subject: [PATCH] tests/periph_flashpage: add RWWEE automatic test if hw supports it --- tests/periph_flashpage/tests/01-run.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/periph_flashpage/tests/01-run.py b/tests/periph_flashpage/tests/01-run.py index 34327efe3caf..338ffd8b5760 100755 --- a/tests/periph_flashpage/tests/01-run.py +++ b/tests/periph_flashpage/tests/01-run.py @@ -11,6 +11,10 @@ def testfunc(child): + # Make sure we are at a clean prompt before starting + child.sendline("") + child.expect('>') + # writes and verifies the last page of the flash child.sendline("test_last") child.expect_exact('wrote local page buffer to last flash page') @@ -25,6 +29,15 @@ def testfunc(child): child.expect_exact('wrote raw short buffer to last flash page') child.expect('>') + # check if board has RWWEE capability and if so test that as well + # capability is deduced from help contents + child.sendline("help") + index = child.expect(['test_last_rwwee', '>']) + if index == 0: + child.sendline("test_last_rwwee") + child.expect_exact('wrote local page buffer to last RWWEE flash page') + child.expect('>') + if __name__ == "__main__": sys.exit(run(testfunc))