diff options
| -rw-r--r-- | .travis.yml | 21 | ||||
| -rw-r--r-- | miasm2/core/bin_stream_ida.py | 6 | ||||
| -rwxr-xr-x | test/test_all.py | 5 |
3 files changed, 20 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index 8253cb24..f5c55368 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,14 +11,17 @@ addons: env: global: CXX=g++-5 LLVM_CONFIG=llvm-config-6.0 matrix: - - MIASM_TEST_TAG=regression - - MIASM_TEST_TAG=example - - MIASM_TEST_TAG=long - - MIASM_TEST_TAG=llvm - - MIASM_TEST_TAG=gcc - - MIASM_TEST_TAG=z3 - - MIASM_TEST_TAG=qemu - - MIASM_TEST_TAG=cparser + - MIASM_TEST_EXTRA_ARG="-o regression -t long,python,llvm,gcc,z3,qemu,cparser" + - MIASM_TEST_EXTRA_ARG="-o example -t long,python,llvm,gcc,z3,qemu,cparser" + - MIASM_TEST_EXTRA_ARG="-o long" + - MIASM_TEST_EXTRA_ARG="-o qemu -t llvm,gcc" + - MIASM_TEST_EXTRA_ARG="-o qemu -t python,gcc" + - MIASM_TEST_EXTRA_ARG="-o qemu -t python,llvm" + - MIASM_TEST_EXTRA_ARG="-o llvm -t qemu,long" + - MIASM_TEST_EXTRA_ARG="-o gcc -t qemu,long" + - MIASM_TEST_EXTRA_ARG="-o python -t qemu,long" + - MIASM_TEST_EXTRA_ARG="-o z3" + - MIASM_TEST_EXTRA_ARG="-o cparser" before_script: - pip install -r optional_requirements.txt # codespell @@ -28,4 +31,4 @@ before_script: # install - python setup.py build build_ext - python setup.py install -script: cd test && python test_all.py -o=$MIASM_TEST_TAG && git ls-files -o --exclude-standard +script: cd test && python test_all.py $MIASM_TEST_EXTRA_ARG && git ls-files -o --exclude-standard diff --git a/miasm2/core/bin_stream_ida.py b/miasm2/core/bin_stream_ida.py index de7bc971..f63077bf 100644 --- a/miasm2/core/bin_stream_ida.py +++ b/miasm2/core/bin_stream_ida.py @@ -1,5 +1,6 @@ from idc import Byte, SegEnd from idautils import Segments +from idaapi import is_mapped from miasm2.core.bin_stream import bin_stream_str @@ -14,7 +15,10 @@ class bin_stream_ida(bin_stream_str): def _getbytes(self, start, l=1): o = "" for ad in xrange(l): - o += chr(Byte(ad + start - self.shift)) + offset = ad + start - self.shift + if not is_mapped(offset): + raise IOError("not enough bytes") + o += chr(Byte(offset)) return o def readbs(self, l=1): diff --git a/test/test_all.py b/test/test_all.py index 4b97ffba..f3bcc477 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -21,6 +21,7 @@ TAGS = {"regression": "REGRESSION", # Regression tests "long": "LONG", # Very time consumming tests "llvm": "LLVM", # LLVM dependency is required "gcc": "GCC", # GCC based tests + "python": "PYTHON", # Python jitted tests "z3": "Z3", # Z3 dependency is needed "qemu": "QEMU", # QEMU tests (several tests) "cparser": "CPARSER", # pycparser is needed @@ -109,7 +110,7 @@ for script in ["x86/sem.py", continue testset += ArchUnitTest(script, jitter, base_dir="arch", tags=tags) -testset += ArchUnitTest("x86/unit/access_xmm.py", "python", base_dir="arch") +testset += ArchUnitTest("x86/unit/access_xmm.py", "python", base_dir="arch", tags=[TAGS["python"]]) ### QEMU regression tests class QEMUTest(RegressionTest): @@ -750,7 +751,7 @@ class ExampleJitterNoPython(ExampleJitter): for jitter in ExampleJitter.jitter_engines: # Take 5 min on a Core i5 - tags = {"python": [TAGS["long"]], + tags = {"python": [TAGS["long"], TAGS["python"]], "llvm": [TAGS["llvm"]], "gcc": [TAGS["gcc"]], } |