зеркало из https://github.com/microsoft/ivy.git
more repl tests
This commit is contained in:
Родитель
27cd798e61
Коммит
6dbd3e123d
|
@ -0,0 +1,19 @@
|
|||
import pexpect
|
||||
import sys
|
||||
|
||||
def run(name,opts,res):
|
||||
child = [pexpect.spawn('./{} {}'.format(name,idx)) for idx in range(2)]
|
||||
for idx in range(2):
|
||||
child[idx].logfile = sys.stdout
|
||||
try:
|
||||
child[0].expect('>')
|
||||
child[0].sendline('foo.send(1,2)')
|
||||
child[1].expect(r'< foo.recv\(2\)')
|
||||
child[1].sendline('foo.send(0,3)')
|
||||
child[0].expect(r'foo.recv\(3\)')
|
||||
child[0].sendline('foo.send(0,4)')
|
||||
child[0].expect(r'< foo.recv\(4\)')
|
||||
return True
|
||||
except pexpect.EOF:
|
||||
print child.before
|
||||
return False
|
|
@ -0,0 +1,16 @@
|
|||
import pexpect
|
||||
import sys
|
||||
|
||||
def run(name,opts,res):
|
||||
child = pexpect.spawn('./{}'.format(name))
|
||||
child.logfile = sys.stdout
|
||||
try:
|
||||
child.expect('>')
|
||||
child.sendline('foo.send(0,1,2)')
|
||||
child.expect(r'< foo.recv\(1,2\)')
|
||||
child.sendline('foo.send(1,0,3)')
|
||||
child.expect(r'foo.recv\(0,3\)')
|
||||
return True
|
||||
except pexpect.EOF:
|
||||
print child.before
|
||||
return False
|
|
@ -73,12 +73,14 @@ tests = [
|
|||
repls = [
|
||||
['../doc/examples',
|
||||
[
|
||||
['leader_election_ring_repl','isolate=iso_impl','leader_election_ring_repl_iso_impl_expect'],
|
||||
# ['leader_election_ring_repl','isolate=iso_impl','leader_election_ring_repl_iso_impl_expect'],
|
||||
# ['helloworld',None],
|
||||
# ['account',None],
|
||||
# ['account2',None],
|
||||
# ['account3',None],
|
||||
# ['leader_election_ring_repl',None],
|
||||
# ['udp_test','isolate=iso_impl',None],
|
||||
['udp_test2','isolate=iso_impl',None],
|
||||
]
|
||||
]
|
||||
]
|
||||
|
@ -110,7 +112,8 @@ class Test(object):
|
|||
child = pexpect.spawn(pc)
|
||||
child.logfile = sys.stdout
|
||||
child.expect(pexpect.EOF)
|
||||
if child.wait() != 0:
|
||||
child.close()
|
||||
if child.exitstatus != 0:
|
||||
print child.before
|
||||
return False
|
||||
return self.expect()
|
||||
|
@ -162,8 +165,8 @@ def get_tests(cls,arr):
|
|||
|
||||
#get_tests(IvyCheck,checks)
|
||||
#get_tests(IvyTest,tests)
|
||||
#get_tests(IvyRepl,repls)
|
||||
get_tests(IvyToCpp,to_cpps)
|
||||
get_tests(IvyRepl,repls)
|
||||
#get_tests(IvyToCpp,to_cpps)
|
||||
|
||||
num_failures = 0
|
||||
for test in all_tests:
|
||||
|
|
Загрузка…
Ссылка в новой задаче