From 96fc87f78199198089e1d1e7323e5648d936057d Mon Sep 17 00:00:00 2001 From: Alex Groce Date: Sat, 14 Jul 2018 06:27:48 -0700 Subject: [PATCH] keep alive long silent tests, add integer overflow --- .travis.yml | 2 ++ tests/logrun.py | 5 +++++ tests/test_basic_functionality.py | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1ede2f5..fded504 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,8 @@ env: - TASK=STREAMINGANDFORMATTING DEEPSTATE_CMD=deepstate-manticore - TASK=ONEOF DEEPSTATE_CMD=deepstate-angr - TASK=ONEOF DEEPSTATE_CMD=deepstate-manticore +- TASK=OVERFLOW DEEPSTATE_CMD=deepstate-angr +- TASK=OVERFLOW DEEPSTATE_CMD=deepstate-manticore - TASK=ARITHMETIC DEEPSTATE_CMD=deepstate-angr - TASK=ARITHMETIC DEEPSTATE_CMD=deepstate-manticore script: diff --git a/tests/logrun.py b/tests/logrun.py index b4bf8a9..b5b8265 100644 --- a/tests/logrun.py +++ b/tests/logrun.py @@ -12,13 +12,18 @@ def logrun(cmd, file, timeout): p = subprocess.Popen(cmd, stdout=outf, stderr=outf) start = time.time() oldContents = "" + lastOutput = time.time() while (p.poll() is None) and ((time.time() - start) < timeout): + if (time.time() - lastOutput) > 300: + sys.stderr.write("\n\n** FIVE MINUTE KEEPALIVE FROM TEST LOGGING **\n\n") + sys.stderr.flush() with open(file, 'r') as inf: contents = inf.read() if len(contents) > len(oldContents): sys.stderr.write(contents[len(oldContents):]) sys.stderr.flush() oldContents = contents + lastOutput = time.time() time.sleep(0.05) totalTime = time.time() - start sys.stderr.write("\n") diff --git a/tests/test_basic_functionality.py b/tests/test_basic_functionality.py index 9eeea84..f59ba96 100644 --- a/tests/test_basic_functionality.py +++ b/tests/test_basic_functionality.py @@ -108,6 +108,16 @@ class TestBasicFunctionality(TestCase): self.assertTrue("Failed: OneOfExample_ProduceSixtyOrHigher" in output) self.assertTrue("Passed: OneOfExample_ProduceSixtyOrHigher" in output) + if os.getenv("TASK") is None or os.getenv("TASK") == "OVERFLOW": + (r, output) = logrun.logrun([deepstate, "build/examples/IntegerOverflow"], + "deepstate.out", 1800) + self.assertEqual(r, 0) + + self.assertTrue("Failed: SignedInteger_AdditionOverflow" in output) + self.assertTrue("Passed: SignedInteger_AdditionOverflow" in output) + self.assertTrue("Failed: SignedInteger_MultiplicationOverflow" in output) + self.assertTrue("Passed: SignedInteger_MultiplicationOverflow" in output) + if os.getenv("TASK") is None or os.getenv("TASK") == "ARITHMETIC": (r, output) = logrun.logrun([deepstate, "build/examples/IntegerArithmetic", "--num_workers", "4"], "deepstate.out", 1800)