autotest: explicitly run hello-world test and check for string

This commit is contained in:
Peter Barker 2020-05-28 12:15:44 +10:00 committed by Peter Barker
parent 67e79638d4
commit c44b760f3c
1 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,7 @@
from __future__ import print_function from __future__ import print_function
import os import os
import pexpect
import signal import signal
import subprocess import subprocess
import time import time
@ -43,6 +44,22 @@ def run_example(filepath, valgrind=False, gdb=False):
def run_examples(debug=False, valgrind=False, gdb=False): def run_examples(debug=False, valgrind=False, gdb=False):
dirpath = util.reltopdir(os.path.join('build', 'linux', 'examples')) dirpath = util.reltopdir(os.path.join('build', 'linux', 'examples'))
print("Running Hello")
# explicitly run helloworld and check for output
hello_path = os.path.join(dirpath, "Hello")
p = pexpect.spawn(hello_path, ["Hello"])
ex = None
try:
p.expect("hello world", timeout=5)
except pexpect.TIMEOUT as e:
ex = e
print("ran Hello")
p.close()
if ex is not None:
raise ex
skip = { skip = {
"BARO_generic": "Most linux computers don't have baros...", "BARO_generic": "Most linux computers don't have baros...",
"RCProtocolDecoder": "This assumes specific hardware is connected", "RCProtocolDecoder": "This assumes specific hardware is connected",