about summary refs log tree commit diff stats
path: root/test/test_all.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2017-02-17 15:04:56 +0100
committerGitHub <noreply@github.com>2017-02-17 15:04:56 +0100
commit688d21da608c32da84e093316ab32a4fa7fc51c8 (patch)
treee1f70d61f6d323fce31a9d9b9ed3d9fb4bb3c8be /test/test_all.py
parentd30ea3788133fffc294602ee6cce88b407caaf4a (diff)
parentc3bef0610972451a5eef3accb7da4618794ddff9 (diff)
downloadmiasm-688d21da608c32da84e093316ab32a4fa7fc51c8.tar.gz
miasm-688d21da608c32da84e093316ab32a4fa7fc51c8.zip
Merge pull request #495 from serpilliere/objc_feature
Objc feature
Diffstat (limited to 'test/test_all.py')
-rwxr-xr-xtest/test_all.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_all.py b/test/test_all.py
index e405bcec..86d40bcb 100755
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -18,6 +18,7 @@ TAGS = {"regression": "REGRESSION", # Regression tests
         "tcc": "TCC", # TCC dependency is required
         "z3": "Z3", # Z3 dependecy is needed
         "qemu": "QEMU", # QEMU tests (several tests)
+        "cparser": "CPARSER", # pycparser is needed
         }
 
 # Regression tests
@@ -412,6 +413,8 @@ test_x86_32_if_reg = ExampleShellcode(['x86_32', 'x86_32_if_reg.S', "x86_32_if_r
 test_x86_32_seh = ExampleShellcode(["x86_32", "x86_32_seh.S", "x86_32_seh.bin",
                                     "--PE"])
 
+test_human = ExampleShellcode(["x86_64", "human.S", "human.bin"])
+
 testset += test_armb
 testset += test_arml
 testset += test_aarch64b
@@ -427,6 +430,8 @@ testset += test_x86_64
 testset += test_x86_32_if_reg
 testset += test_x86_32_seh
 
+testset += test_human
+
 class ExampleDisassembler(Example):
     """Disassembler examples specificities:
     - script path begins with "disasm/"
@@ -517,6 +522,14 @@ testset += ExampleExpression(["solve_condition_stp.py",
                               Example.get_sample("simple_test.bin")],
                              products=["graph_instr.dot", "out.dot"])
 
+testset += ExampleExpression(["access_c.py", Example.get_sample("human.bin")],
+                             depends=[test_human],
+                             products=["graph_irflow.dot"],
+                             tags=[TAGS["cparser"]])
+
+testset += ExampleExpression(["expr_c.py"],
+                             tags=[TAGS["cparser"]])
+
 for script in [["basic_op.py"],
                ["basic_simplification.py"],
                ["simplification_tools.py"],
@@ -739,6 +752,16 @@ By default, all tag are considered." % ", ".join(TAGS.keys()), default="")
             "Z3 and its python binding are necessary for TranslatorZ3."
         if TAGS["z3"] not in exclude_tags:
             exclude_tags.append(TAGS["z3"])
+
+    # Handle pycparser dependency
+    try:
+        import pycparser
+    except ImportError:
+        print "%(red)s[PYCPARSER]%(end)s " % cosmetics.colors + \
+            "pycparser are necessary for Objc."
+        if TAGS["cparser"] not in exclude_tags:
+            exclude_tags.append(TAGS["cparser"])
+
     test_ko = []
     test_ok = []