regression.py 906 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#!/usr/bin/env python
import sys, os, time, pexpect, subprocess
sys.path.append(os.path.abspath(".."))
import commonRegression

timeout = 5

binaries = [
    "binary/binaries/obj187"
]

expected = [
    "\[b\] startup",
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"],
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"],
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"],
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"],
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"],
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"],
    ["\[b\] callee invoked!!!", "\[b\] callee2 invoked!!!"]
]

p = None
try:
    p = subprocess.Popen("binary/binaries/obj105", stdout=subprocess.PIPE)
    if p == None:
        sys.exit(1)
except:
    sys.exit(1)
result=commonRegression.test(binaries, expected, timeout)
p.kill()
p.wait()
if 0!=result:
    sys.exit(1)