add runlen test

This commit is contained in:
Alex Groce 2018-12-31 14:20:15 -07:00
parent eb1133825a
commit 40eb4b0117
2 changed files with 20 additions and 0 deletions

View File

@ -23,6 +23,7 @@ env:
- TASK=ONEOF
- TASK=OVERFLOW
- TASK=PRIMES
- TASK=RUNLEN
- TASK=STREAMINGANDFORMATTING
- TASK=TAKEOVER
script:
@ -34,6 +35,7 @@ script:
- if [ $TASK = KLEE ]; then nosetests tests/test_klee.py ; fi
- if [ $TASK = LISTS ]; then nosetests tests/test_lists.py ; fi
- if [ $TASK = ONEOF ]; then nosetests tests/test_oneof.py ; fi
- if [ $TASK = RUNLEN ]; then nosetests tests/test_runlen.py ; fi
- if [ $TASK = OVERFLOW ]; then nosetests tests/test_overflow.py ; fi
- if [ $TASK = PRIMES ]; then nosetests tests/test_primes.py ; fi
- if [ $TASK = STREAMINGANDFORMATTING ]; then nosetests tests/test_streamingandformatting.py ; fi

18
tests/test_runlen.py Normal file
View File

@ -0,0 +1,18 @@
from __future__ import print_function
import deepstate_base
import logrun
class RunlenTest(deepstate_base.DeepStateTestCase):
def run_deepstate(self, deepstate):
(r, output) = logrun.logrun([deepstate, "build/examples/Runlen"],
"deepstate.out", 1800)
self.assertEqual(r, 0)
self.assertTrue("Passed: Runlength_EncodeDecode" in output)
foundCrashSave = False
for line in output.split("\n"):
if ("Saving input to" in line) and (".crash" in line):
foundCrashSave = True
self.assertTrue(foundCrashSave)