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
+2
View File
@@ -23,6 +23,8 @@ env:
- TASK=KLEE DEEPSTATE_CMD=deepstate-manticore
- TASK=PRIMES DEEPSTATE_CMD=deepstate-angr
- TASK=PRIMES DEEPSTATE_CMD=deepstate-manticore
- TASK=TAKEOVER DEEPSTATE_CMD=deepstate-angr
- TASK=TAKEOVER DEEPSTATE_CMD=deepstate-manticore
- TASK=LISTS DEEPSTATE_CMD=deepstate-angr
- TASK=LISTS DEEPSTATE_CMD=deepstate-manticore
- TASK=ONEOF DEEPSTATE_CMD=deepstate-angr
+1 -1
View File
@@ -6,7 +6,7 @@ import sys
def logrun(cmd, file, timeout):
sys.stderr.write("=" * 80 + "\n")
sys.stderr.write("RUNNING: ")
sys.stderr.write(" ".join(cmd) + "\n")
sys.stderr.write(str(cmd) + "\n")
sys.stderr.flush()
with open(file, 'w') as outf:
p = subprocess.Popen(cmd, stdout=outf, stderr=outf)
+17
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)