Initial import

This commit is contained in:
yan
2017-02-13 12:04:15 -05:00
commit badf1ab28e
196 changed files with 240345 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#/bin/bash
set -ex
UDIR=$HOME/unicorn
# Even if unicorn dir was not cached, travis seems to still mkdir it, so check
# if the repo is actually there
if [ ! -f "$UDIR/make.sh" ]; then
git clone https://github.com/unicorn-engine/unicorn.git $UDIR
pushd $UDIR
sudo -H UNICORN_ARCHS="arm x86" ./make.sh
popd
fi
pushd $UDIR
sudo -H UNICORN_ARCHS="arm x86" ./make.sh install
popd
pushd $UDIR/bindings/python
UNICORN_ARCHS="arm x86" pip install --verbose -e .
popd
+11
View File
@@ -0,0 +1,11 @@
#/bin/bash
set -ex
Z3_VERSION=z3-4.4.2.0d0d504d6273-x64-ubuntu-14.04
mkdir z3
pushd z3
wget https://s3.amazonaws.com/manticore-z3/${Z3_VERSION}.zip -O z3.zip
unzip z3.zip
sudo cp -v ${Z3_VERSION}/bin/z3 /usr/bin/z3
popd
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
coverage erase
coverage run -m unittest discover test/ 2>&1 >/dev/null | tee travis_tests.log
DID_OK=$(tail -n1 travis_tests.log)
RV=1
if [[ "${DID_OK}" == OK* ]]
then
echo "All functionality tests passed :)"
RV=0
else
echo "Some functionality tests failed :("
fi
measure_cov() {
local PYFILE=${1}
echo "Measuring coverage for ${PYFILE}"
local HAS_COV=$(coverage report --include ${PYFILE} | tail -n1 | grep -o 'No data to report')
if [ "${HAS_COV}" = "No data to report" ]
then
echo " FAIL: No coverage for ${PYFILE}"
RV=1
return
fi
local COV_AMT=$(coverage report --include=${PYFILE} | tail -n1 | sed "s/.* \([0-9]*\)%/\1/g")
if [ "${COV_AMT}" -gt "${2}" ]
then
echo " PASS: coverage for ${PYFILE} at ${COV_AMT}%"
else
echo " FAIL: coverage for ${PYFILE} at ${COV_AMT}%"
RV=1
fi
}
#coverage report
echo "Measuring code coverage..."
measure_cov "core/smtlib/*" 80
measure_cov "core/cpu/x86.py" 50
measure_cov "core/memory.py" 85
exit ${RV}