Check results for pass/fail on properties, split into angr and manticore tests

This commit is contained in:
Alex Groce
2018-07-12 22:01:58 -07:00
parent 0f3e560ea4
commit 882cda798c
2 changed files with 27 additions and 2 deletions

View File

@@ -5,11 +5,14 @@ python:
- "2.7"
install:
- sudo apt-get update
- sudo apt-get install build-essential gcc-multilib cmake python python-setuptools libffi-dev z3
- sudo apt-get install build-essential gcc-multilib cmake python python-setuptools libffi-dev
- mkdir build
- cd build
- cmake ..
- make
- python setup.py install
env:
- TASK=ANGR DEEPSTATE_CMD=deepstate-angr
- TASK=MANTICORE DEEPSTATE_CMD=deepstate-manticore
script:
- deepstate-manticore examples/IntegerArithmetic
- nosetests --verbose

View File

@@ -0,0 +1,22 @@
from __future__ import print_function
import os
import subprocess
import glob
from unittest import TestCase
class TestBasicFunctionality(TestCase):
def test_basic_functionality(self):
deepstate = os.getenv("DEEPSTATE_CMD")
with open("deepstate.out", 'w') as outf:
r = subprocess.call([deepstate, "examples/IntegerArithmetic"], stdout = outf, stderr = outf)
self.assertEqual(r, 0)
with open("deepstate.out", 'r') as outf:
result = outf.read()
self.assertTrue("Passed: Arithmetic_AdditionIsCommutative" in result)
self.assertTrue("Passed: Arithmetic_AdditionIsAssociative" in result)
self.assertTrue("Passed: Arithmetic_InvertibleMultiplication_CanFail" in result)
self.assertTrue("Failed: Arithmetic_InvertibleMultiplication_CanFail" in result)