Some failures were crashing the test driver

Some tests are meant to fail, however some failures were actually
crashing the test driver.

This fixes the issue.
master
Salvo 'LtWorf' Tomaselli 2016-04-18 16:28:56 +07:00
parent eb6a033298
commit 6fe70e12fe
1 changed files with 4 additions and 6 deletions

@ -191,27 +191,25 @@ def run_fail_test(testname):
print ("Running fail test: " + colorize(testname, COLOR_MAGENTA)) print ("Running fail test: " + colorize(testname, COLOR_MAGENTA))
query = readfile('%s%s.fail' % (tests_path, testname)).strip() query = readfile('%s%s.fail' % (tests_path, testname)).strip()
o_query = optimizer.optimize_all(query, rels)
expr = parser.parse(query)
o_expr = parser.parse(o_query)
test_succeed = True test_succeed = True
try: try:
expr = parser.parse(query)
expr(rels) expr(rels)
test_succeed = False test_succeed = False
except: except:
pass pass
try: try:
o_query = optimizer.optimize_all(query, rels)
o_expr = parser.parse(o_query)
o_expr(rels) o_expr(rels)
test_succeed = False test_succeed = False
except: except:
pass pass
c_expr = parser.tree(query).toCode()
try: try:
c_expr = parser.tree(query).toCode()
eval(c_expr, rels) eval(c_expr, rels)
test_succeed = False test_succeed = False
except: except: