diff options
| author | Ajax <commial@gmail.com> | 2015-04-28 11:11:50 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-04-28 14:05:49 +0200 |
| commit | f0f846aa072c677b19cd52080d83223d97a55d22 (patch) | |
| tree | 61f99f0f432071d643b2f9e00c974c3dcf62ea21 | |
| parent | 73d3f770882d73f7c3814a4dc95cde1b2055fbda (diff) | |
| download | miasm-f0f846aa072c677b19cd52080d83223d97a55d22.tar.gz miasm-f0f846aa072c677b19cd52080d83223d97a55d22.zip | |
DepGraph: Avoid failing if z3 is not present
| -rw-r--r-- | miasm2/analysis/depgraph.py | 5 | ||||
| -rw-r--r-- | test/test_all.py | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/miasm2/analysis/depgraph.py b/miasm2/analysis/depgraph.py index f95e5240..69ff1204 100644 --- a/miasm2/analysis/depgraph.py +++ b/miasm2/analysis/depgraph.py @@ -2,7 +2,10 @@ import itertools from collections import namedtuple -import z3 +try: + import z3 +except ImportError: + pass import miasm2.expression.expression as m2_expr from miasm2.core.graph import DiGraph diff --git a/test/test_all.py b/test/test_all.py index c3367d43..df07aac5 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -321,15 +321,15 @@ class ExampleSymbolExec(Example): testset += ExampleSymbolExec(["single_instr.py"]) -for options, nb_sol in [([], 8), - (["-i", "--rename-args"], 12)]: +for options, nb_sol, tag in [([], 8, []), + (["-i", "--rename-args"], 12, [TAGS["z3"]])]: testset += ExampleSymbolExec(["depgraph.py", Example.get_sample("simple_test.bin"), "-m", "x86_32", "0x0", "0x8b", "eax"] + options, products=["sol_%d.dot" % nb - for nb in xrange(nb_sol)]) - + for nb in xrange(nb_sol)], + tags=tag) ## Jitter class ExampleJitter(Example): |