diff --git a/.travis.yml b/.travis.yml index 5dd5701..2eb85b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/tests/logrun.py b/tests/logrun.py index 535a0ea..016dd25 100644 --- a/tests/logrun.py +++ b/tests/logrun.py @@ -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) diff --git a/tests/test_basic_functionality.py b/tests/test_basic_functionality.py index f6bffc5..becf1ea 100644 --- a/tests/test_basic_functionality.py +++ b/tests/test_basic_functionality.py @@ -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)