From b757efa9d13ede65938049dcfc4f46a642ce2f44 Mon Sep 17 00:00:00 2001 From: ajax Date: Mon, 16 Jun 2014 19:00:55 +0200 Subject: Test: Add "python" jitter for few tests --- test/test_all.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/test_all.py') diff --git a/test/test_all.py b/test/test_all.py index 55511a84..7023afd1 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -81,12 +81,16 @@ all_tests = { ["sandbox_pe_x86_32.py", "--jitter", "python", "box_x86_32.bin"], ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32_enc.bin"], ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32_enc.bin"], + ["sandbox_pe_x86_32.py", "--jitter", "python", "box_x86_32_enc.bin"], ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32_mod.bin"], ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32_mod.bin"], + ["sandbox_pe_x86_32.py", "--jitter", "python", "box_x86_32_mod.bin"], ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32_mod_self.bin"], ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32_mod_self.bin"], + ["sandbox_pe_x86_32.py", "--jitter", + "python", "box_x86_32_mod_self.bin"], ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32_repmod.bin"], ["sandbox_pe_x86_32.py", "--jitter", -- cgit 1.4.1 From ca3d3ae4ebe17e010a14071d9a91d53ce6f0eb82 Mon Sep 17 00:00:00 2001 From: ajax Date: Mon, 16 Jun 2014 19:15:21 +0200 Subject: Jitter Python: Add the rest of tests (unpack_upx is very long) --- test/test_all.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/test_all.py') diff --git a/test/test_all.py b/test/test_all.py index 7023afd1..ca9383f0 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -70,6 +70,8 @@ all_tests = { "jitter": [ ["unpack_upx.py", "--jitter", "tcc", "box_upx.exe"], ["unpack_upx.py", "--jitter", "llvm", "box_upx.exe"], + # Take 5 mins on a Core i5 2.7Ghz + ["unpack_upx.py", "--jitter", "python", "box_upx.exe"], ["test_jit_x86_32.py", "--jitter", "tcc", "x86_32_sc.bin"], ["test_jit_x86_32.py", "--jitter", "llvm", "x86_32_sc.bin"], ["test_jit_x86_32.py", "--jitter", "python", "x86_32_sc.bin"], @@ -95,6 +97,8 @@ all_tests = { "tcc", "box_x86_32_repmod.bin"], ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32_repmod.bin"], + ["sandbox_pe_x86_32.py", "--jitter", + "python", "box_x86_32_repmod.bin"], ], "order": [ "assembler", -- cgit 1.4.1 From b4672a0881de3a62d6ea711603870db9a28f6cce Mon Sep 17 00:00:00 2001 From: ajax Date: Mon, 16 Jun 2014 19:25:57 +0200 Subject: Test: Yes, we can use a function to invoke all jitter each time --- test/test_all.py | 56 +++++++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) (limited to 'test/test_all.py') diff --git a/test/test_all.py b/test/test_all.py index ca9383f0..d822b244 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -5,6 +5,18 @@ import time import argparse import tempfile +# Test derivations +def all_jit(assembly_line): + """Add all available jitter options to assembly_line thanks to '--jitter' + option. + @assembly_line: list(str) + Return a list of assembly lines: list(list(str)). + """ + out = [] + for jitter in ["tcc", "llvm", "python"]: + out.append(assembly_line + ["--jitter", jitter]) + return out + # Available tests all_tests = { @@ -67,39 +79,17 @@ all_tests = { ["expression/solve_condition_stp.py", "expression/simple_test.bin"], ], - "jitter": [ - ["unpack_upx.py", "--jitter", "tcc", "box_upx.exe"], - ["unpack_upx.py", "--jitter", "llvm", "box_upx.exe"], - # Take 5 mins on a Core i5 2.7Ghz - ["unpack_upx.py", "--jitter", "python", "box_upx.exe"], - ["test_jit_x86_32.py", "--jitter", "tcc", "x86_32_sc.bin"], - ["test_jit_x86_32.py", "--jitter", "llvm", "x86_32_sc.bin"], - ["test_jit_x86_32.py", "--jitter", "python", "x86_32_sc.bin"], - ["test_jit_arm.py", "--jitter", "tcc","md5_arm", "A684"], - ["test_jit_arm.py", "--jitter", "llvm","md5_arm", "A684"], - ["test_jit_arm.py", "--jitter", "python","md5_arm", "A684"], - ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "python", "box_x86_32.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32_enc.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32_enc.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "python", "box_x86_32_enc.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "tcc", "box_x86_32_mod.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "llvm", "box_x86_32_mod.bin"], - ["sandbox_pe_x86_32.py", "--jitter", "python", "box_x86_32_mod.bin"], - ["sandbox_pe_x86_32.py", "--jitter", - "tcc", "box_x86_32_mod_self.bin"], - ["sandbox_pe_x86_32.py", "--jitter", - "llvm", "box_x86_32_mod_self.bin"], - ["sandbox_pe_x86_32.py", "--jitter", - "python", "box_x86_32_mod_self.bin"], - ["sandbox_pe_x86_32.py", "--jitter", - "tcc", "box_x86_32_repmod.bin"], - ["sandbox_pe_x86_32.py", "--jitter", - "llvm", "box_x86_32_repmod.bin"], - ["sandbox_pe_x86_32.py", "--jitter", - "python", "box_x86_32_repmod.bin"], - ], + "jitter": reduce(lambda x, y: x + y, + map(all_jit, [ + ["unpack_upx.py", "box_upx.exe"], # Take 5 mins on a Core i5 + ["test_jit_x86_32.py", "x86_32_sc.bin"], + ["test_jit_arm.py", "md5_arm", "A684"], + ["sandbox_pe_x86_32.py", "box_x86_32.bin"], + ["sandbox_pe_x86_32.py", "box_x86_32_enc.bin"], + ["sandbox_pe_x86_32.py", "box_x86_32_mod.bin"], + ["sandbox_pe_x86_32.py", "box_x86_32_repmod.bin"], + ["sandbox_pe_x86_32.py", "box_x86_32_mod_self.bin"], + ])), "order": [ "assembler", "expression", -- cgit 1.4.1