fix iteration over command

This commit is contained in:
Alex Groce
2018-07-13 21:24:02 -07:00
parent 7775492adc
commit 3a35a44496
3 changed files with 20 additions and 1 deletions

View File

@@ -11,6 +11,8 @@ class TestBasicFunctionality(TestCase):
else:
deepstates = ["deepstate-angr", "deepstate-manticore"]
print("RUNNING WITH DEEPSTATE COMMANDS:", deepstates)
for deepstate in deepstates:
if os.getenv("TASK") is None or os.getenv("TASK") == "CRASH":
(r, output) = logrun.logrun([deepstate, "build/examples/Crash"],
@@ -43,7 +45,22 @@ class TestBasicFunctionality(TestCase):
self.assertTrue("Passed: PrimePolynomial_OnlyGeneratesPrimes" in output)
self.assertTrue("Passed: PrimePolynomial_OnlyGeneratesPrimes_NoStreaming" in output)
if os.getenv("TASK") is None or os.getenv("TASK") == "TAKEOVER":
(r, output) = logrun.logrun([deepstate, "build/examples/TakeOver", "--take_over"],
"deepstate.out", 1800)
self.assertEqual(r, 0)
self.assertTrue("hi" in output)
self.assertTrue("bye" in output)
self.assertTrue("was not greater than" in output)
foundPassSave = False
for line in output.split("\n"):
if ("Saving input to" in line) and (".pass" in line):
foundPassSave = True
self.assertTrue(foundPassSave)
if os.getenv("TASK") is None or os.getenv("TASK") == "LISTS":
(r, output) = logrun.logrun([deepstate, "build/examples/Lists"],
"deepstate.out", 1800)