Make testing for all tests (got an error in TEST_MINIMAL_CASE)
This commit is contained in:
@@ -253,6 +253,7 @@ def TEST_CASE_GENERAL():
|
|||||||
expected_state = State.SOLVED
|
expected_state = State.SOLVED
|
||||||
if result.state == expected_state:
|
if result.state == expected_state:
|
||||||
print_result(result)
|
print_result(result)
|
||||||
|
return 1
|
||||||
else:
|
else:
|
||||||
state_name = ""
|
state_name = ""
|
||||||
if result.state == State.UNSOLVED:
|
if result.state == State.UNSOLVED:
|
||||||
@@ -262,6 +263,7 @@ def TEST_CASE_GENERAL():
|
|||||||
elif result.state == State.SOLVED:
|
elif result.state == State.SOLVED:
|
||||||
state_name = "SOLVED"
|
state_name = "SOLVED"
|
||||||
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
||||||
|
return 0
|
||||||
|
|
||||||
def TEST_MINIMIZE_CASE():
|
def TEST_MINIMIZE_CASE():
|
||||||
|
|
||||||
@@ -284,6 +286,7 @@ def TEST_MINIMIZE_CASE():
|
|||||||
expected_state = State.SOLVED
|
expected_state = State.SOLVED
|
||||||
if result.state == expected_state:
|
if result.state == expected_state:
|
||||||
print_result(result)
|
print_result(result)
|
||||||
|
return 1
|
||||||
else:
|
else:
|
||||||
state_name = ""
|
state_name = ""
|
||||||
if result.state == State.UNSOLVED:
|
if result.state == State.UNSOLVED:
|
||||||
@@ -293,6 +296,7 @@ def TEST_MINIMIZE_CASE():
|
|||||||
elif result.state == State.SOLVED:
|
elif result.state == State.SOLVED:
|
||||||
state_name = "SOLVED"
|
state_name = "SOLVED"
|
||||||
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -317,6 +321,7 @@ def TEST_WITH_SLACK_CASE():
|
|||||||
expected_state = State.SOLVED
|
expected_state = State.SOLVED
|
||||||
if result.state == expected_state:
|
if result.state == expected_state:
|
||||||
print_result(result)
|
print_result(result)
|
||||||
|
return 1
|
||||||
else:
|
else:
|
||||||
state_name = ""
|
state_name = ""
|
||||||
if result.state == State.UNSOLVED:
|
if result.state == State.UNSOLVED:
|
||||||
@@ -326,6 +331,7 @@ def TEST_WITH_SLACK_CASE():
|
|||||||
elif result.state == State.SOLVED:
|
elif result.state == State.SOLVED:
|
||||||
state_name = "SOLVED"
|
state_name = "SOLVED"
|
||||||
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
||||||
|
return 0
|
||||||
|
|
||||||
def TEST_UNBOUNDED_CASE():
|
def TEST_UNBOUNDED_CASE():
|
||||||
print("----------------------------RUNNING_TEST_UNBOUNDED_CASE----------------------------")
|
print("----------------------------RUNNING_TEST_UNBOUNDED_CASE----------------------------")
|
||||||
@@ -347,6 +353,7 @@ def TEST_UNBOUNDED_CASE():
|
|||||||
expected_state = State.SOLVED
|
expected_state = State.SOLVED
|
||||||
if result.state == expected_state:
|
if result.state == expected_state:
|
||||||
print_result(result)
|
print_result(result)
|
||||||
|
return 1
|
||||||
else:
|
else:
|
||||||
state_name = ""
|
state_name = ""
|
||||||
if result.state == State.UNSOLVED:
|
if result.state == State.UNSOLVED:
|
||||||
@@ -356,6 +363,7 @@ def TEST_UNBOUNDED_CASE():
|
|||||||
elif result.state == State.SOLVED:
|
elif result.state == State.SOLVED:
|
||||||
state_name = "SOLVED"
|
state_name = "SOLVED"
|
||||||
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
||||||
|
return 0
|
||||||
|
|
||||||
def TEST_UNSOLVABLE_CASE():
|
def TEST_UNSOLVABLE_CASE():
|
||||||
print("----------------------------RUNNING_TEST_UNSOLVABLE_CASE----------------------------")
|
print("----------------------------RUNNING_TEST_UNSOLVABLE_CASE----------------------------")
|
||||||
@@ -380,6 +388,7 @@ def TEST_UNSOLVABLE_CASE():
|
|||||||
expected_state = State.SOLVED
|
expected_state = State.SOLVED
|
||||||
if result.state == expected_state:
|
if result.state == expected_state:
|
||||||
print_result(result)
|
print_result(result)
|
||||||
|
return 1
|
||||||
else:
|
else:
|
||||||
state_name = ""
|
state_name = ""
|
||||||
if result.state == State.UNSOLVED:
|
if result.state == State.UNSOLVED:
|
||||||
@@ -388,4 +397,16 @@ def TEST_UNSOLVABLE_CASE():
|
|||||||
state_name = "INAPPLICABLE"
|
state_name = "INAPPLICABLE"
|
||||||
elif result.state == State.SOLVED:
|
elif result.state == State.SOLVED:
|
||||||
state_name = "SOLVED"
|
state_name = "SOLVED"
|
||||||
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
print(f"incorrect state type. expected SOLVED, got {state_name}.")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
tests = [TEST_CASE_GENERAL(), TEST_MINIMIZE_CASE(), TEST_WITH_SLACK_CASE(), TEST_UNBOUNDED_CASE(), TEST_UNSOLVABLE_CASE()]
|
||||||
|
tests_passed = 0
|
||||||
|
for test in tests:
|
||||||
|
tests_passed += test
|
||||||
|
|
||||||
|
|
||||||
|
print("----------------------------RESULTS----------------------------")
|
||||||
|
print("Total number of tests: " << tests.size())
|
||||||
|
print("Total number of passed tests: " << tests_passed)
|
||||||
Reference in New Issue
Block a user