about summary refs log tree commit diff stats
path: root/test/test_all.py
diff options
context:
space:
mode:
authorCamille Mougey <camille.mougey@cea.fr>2015-01-18 18:44:44 +0100
committerCamille Mougey <camille.mougey@cea.fr>2015-01-23 17:24:43 +0100
commit9206458e0f4b815e4af68f8978d96d14632a087f (patch)
tree49482f48f187f558493b82bee6fd904912b52f3f /test/test_all.py
parent663b49b712b4309d44e2ae77e37f26861c4906b7 (diff)
downloadmiasm-9206458e0f4b815e4af68f8978d96d14632a087f.tar.gz
miasm-9206458e0f4b815e4af68f8978d96d14632a087f.zip
Example: Move disasm's examples to a `disasm` directory
Diffstat (limited to 'test/test_all.py')
-rw-r--r--test/test_all.py29
1 files changed, 21 insertions, 8 deletions
diff --git a/test/test_all.py b/test/test_all.py
index 0bd6ccb3..65172a2d 100644
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -134,26 +134,38 @@ testset += test_armt
 testset += test_box_enc
 testset += test_msp430
 testset += test_mips32
-for script in [["disasm_single_instr.py"],
-               ["disasm_function.py"],
-               ["disasm_file.py", Example.get_sample("box_upx.exe"),
-                "0x410f90"],
+
+
+class ExampleDisassembler(ExampleDir):
+    """Disassembler examples specificities:
+    - script path begins with "disasm/"
+    """
+    example_dir = "disasm"
+
+
+for script in [["single_instr.py"],
+               ["function.py"],
+               ["file.py", Example.get_sample("box_upx.exe"), "0x410f90"],
                ]:
-    testset += Example(script)
+    testset += ExampleDisassembler(script)
+
 
 class ExampleDisasmFull(Example):
-    """TestDis specificities:
-    - script: disasm_full.py
+    """DisasmFull specificities:
+    - script: disasm/full.py
     - flags: -g -s
     - @products: graph_execflow.txt, graph_irflow.txt, lines.txt, out.txt
     """
 
     def __init__(self, *args, **kwargs):
         super(ExampleDisasmFull, self).__init__(*args, **kwargs)
-        self.command_line = ["disasm_full.py", "-g", "-s"] + self.command_line
+        self.command_line = [os.path.join(ExampleDisassembler.example_dir,
+                                          "full.py"),
+                             "-g", "-s"] + self.command_line
         self.products += ["graph_execflow.txt", "graph_irflow.txt", "lines.txt",
                           "out.txt"]
 
+
 testset += ExampleDisasmFull(["arml", "demo_arm_l.bin", "0"],
                              depends=[test_arm])
 testset += ExampleDisasmFull(["armb", "demo_arm_b.bin", "0"],
@@ -172,6 +184,7 @@ testset += ExampleDisasmFull(["mips32l", "mips32_sc_l.bin", "0"],
 testset += ExampleDisasmFull(["mips32b", "mips32_sc_b.bin", "0"],
                           depends=[test_mips32])
 
+
 ## Expression
 class ExampleExpression(ExampleDir):
     """Expression examples specificities: