diff options
| author | serpilliere <fabrice.desclaux@cea.fr> | 2016-04-25 22:12:45 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-04-26 11:05:41 +0200 |
| commit | 5dc6a1d5fef50253f98838db681f92d0071172f5 (patch) | |
| tree | 314f4a3ca5b94694db7d71ac6e1fe4a10e39bf40 | |
| parent | 65cf848438651b3bfe01243778af9e6d5b0470d6 (diff) | |
| download | miasm-5dc6a1d5fef50253f98838db681f92d0071172f5.tar.gz miasm-5dc6a1d5fef50253f98838db681f92d0071172f5.zip | |
Test: TCC conditional tests
| -rw-r--r-- | test/arch/aarch64/unit/asm_test.py | 4 | ||||
| -rw-r--r-- | test/arch/aarch64/unit/mn_ubfm.py | 4 | ||||
| -rw-r--r-- | test/arch/mips32/unit/asm_test.py | 4 | ||||
| -rw-r--r-- | test/arch/mips32/unit/mn_bcc.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/unit/asm_test.py | 8 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_daa.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_das.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_float.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_int.py | 8 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pcmpeq.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pextr.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pinsr.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pmaxu.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pminu.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pmovmskb.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pshufb.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_psrl_psll.py | 5 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_punpck.py | 7 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_pushpop.py | 10 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_stack.py | 4 | ||||
| -rw-r--r-- | test/arch/x86/unit/mn_strings.py | 4 | ||||
| -rw-r--r-- | test/test_all.py | 126 |
22 files changed, 147 insertions, 88 deletions
diff --git a/test/arch/aarch64/unit/asm_test.py b/test/arch/aarch64/unit/asm_test.py index 9e0d5ea8..a9e6cfc6 100644 --- a/test/arch/aarch64/unit/asm_test.py +++ b/test/arch/aarch64/unit/asm_test.py @@ -21,8 +21,8 @@ if filename and os.path.isfile(filename): reg_and_id = dict(mn_aarch64.regs.all_regs_ids_byname) class Asm_Test(object): - def __init__(self): - self.myjit = Machine("aarch64l").jitter() + def __init__(self, jitter): + self.myjit = Machine("aarch64l").jitter(jitter) self.myjit.init_stack() self.myjit.jit.log_regs = False diff --git a/test/arch/aarch64/unit/mn_ubfm.py b/test/arch/aarch64/unit/mn_ubfm.py index 938f13cf..6f1857fb 100644 --- a/test/arch/aarch64/unit/mn_ubfm.py +++ b/test/arch/aarch64/unit/mn_ubfm.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test from pdb import pm @@ -27,4 +29,4 @@ main: if __name__ == "__main__": - [test()() for test in [Test_UBFM1, Test_UBFM2 ]] + [test(*sys.argv[1:])() for test in [Test_UBFM1, Test_UBFM2 ]] diff --git a/test/arch/mips32/unit/asm_test.py b/test/arch/mips32/unit/asm_test.py index a00d0842..7272c15e 100644 --- a/test/arch/mips32/unit/asm_test.py +++ b/test/arch/mips32/unit/asm_test.py @@ -23,8 +23,8 @@ reg_and_id = dict(mn_mips32.regs.all_regs_ids_byname) class Asm_Test(object): - def __init__(self): - self.myjit = Machine("mips32l").jitter() + def __init__(self, jitter): + self.myjit = Machine("mips32l").jitter(jitter) self.myjit.init_stack() self.myjit.jit.log_regs = False diff --git a/test/arch/mips32/unit/mn_bcc.py b/test/arch/mips32/unit/mn_bcc.py index 729f3679..4818c171 100644 --- a/test/arch/mips32/unit/mn_bcc.py +++ b/test/arch/mips32/unit/mn_bcc.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test @@ -29,4 +31,4 @@ SKIP: if __name__ == "__main__": - [test()() for test in [Test_BCC]] + [test(*sys.argv[1:])() for test in [Test_BCC]] diff --git a/test/arch/x86/unit/asm_test.py b/test/arch/x86/unit/asm_test.py index 118a57b4..4e1d03b8 100644 --- a/test/arch/x86/unit/asm_test.py +++ b/test/arch/x86/unit/asm_test.py @@ -23,8 +23,8 @@ reg_and_id = dict(mn_x86.regs.all_regs_ids_byname) class Asm_Test(object): run_addr = 0x0 - def __init__(self): - self.myjit = Machine(self.arch_name).jitter() + def __init__(self, jitter_engine): + self.myjit = Machine(self.arch_name).jitter(jitter_engine) self.myjit.init_stack() self.myjit.jit.log_regs = False @@ -84,8 +84,8 @@ class Asm_Test_16(Asm_Test): arch_attrib = 16 ret_addr = 0x1337 - def __init__(self): - self.myjit = Machine(self.arch_name).jitter() + def __init__(self, jitter_engine): + self.myjit = Machine(self.arch_name).jitter(jitter_engine) self.myjit.stack_base = 0x1000 self.myjit.stack_size = 0x1000 self.myjit.init_stack() diff --git a/test/arch/x86/unit/mn_daa.py b/test/arch/x86/unit/mn_daa.py index 7aadf582..d07bf849 100644 --- a/test/arch/x86/unit/mn_daa.py +++ b/test/arch/x86/unit/mn_daa.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test_32 @@ -73,4 +75,4 @@ array_al_end: if __name__ == "__main__": - [test()() for test in [Test_DAA]] + [test(*sys.argv[1:])() for test in [Test_DAA]] diff --git a/test/arch/x86/unit/mn_das.py b/test/arch/x86/unit/mn_das.py index 0828cafe..2d8102d9 100644 --- a/test/arch/x86/unit/mn_das.py +++ b/test/arch/x86/unit/mn_das.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test_32 @@ -103,4 +105,4 @@ array_al_end: if __name__ == "__main__": - [test()() for test in [Test_DAS]] + [test(*sys.argv[1:])() for test in [Test_DAS]] diff --git a/test/arch/x86/unit/mn_float.py b/test/arch/x86/unit/mn_float.py index 81eb518b..d704de73 100644 --- a/test/arch/x86/unit/mn_float.py +++ b/test/arch/x86/unit/mn_float.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test_32 @@ -19,4 +21,4 @@ class Test_FADD(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_FADD]] + [test(*sys.argv[1:])() for test in [Test_FADD]] diff --git a/test/arch/x86/unit/mn_int.py b/test/arch/x86/unit/mn_int.py index 0f4a5717..9d964220 100644 --- a/test/arch/x86/unit/mn_int.py +++ b/test/arch/x86/unit/mn_int.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from miasm2.jitter.csts import EXCEPT_INT_XX from asm_test import Asm_Test_32 @@ -15,8 +17,8 @@ class Test_INT(Asm_Test_32): jitter.cpu.set_exception(0) return True - def __init__(self): - super(Test_INT, self).__init__() + def __init__(self, jitter): + super(Test_INT, self).__init__(jitter) self.int_num = 0 self.myjit.add_exception_handler(EXCEPT_INT_XX, self.set_int_num) @@ -28,4 +30,4 @@ class Test_INT(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_INT]] + [test(*sys.argv[1:])() for test in [Test_INT]] diff --git a/test/arch/x86/unit/mn_pcmpeq.py b/test/arch/x86/unit/mn_pcmpeq.py index 06815e76..5d0a59c6 100644 --- a/test/arch/x86/unit/mn_pcmpeq.py +++ b/test/arch/x86/unit/mn_pcmpeq.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PCMPEQB(Asm_Test_32): TXT = ''' main: @@ -61,4 +62,4 @@ class Test_PCMPEQD(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PCMPEQB, Test_PCMPEQW, Test_PCMPEQD]] + [test(*sys.argv[1:])() for test in [Test_PCMPEQB, Test_PCMPEQW, Test_PCMPEQD]] diff --git a/test/arch/x86/unit/mn_pextr.py b/test/arch/x86/unit/mn_pextr.py index 0469eed7..696f077b 100644 --- a/test/arch/x86/unit/mn_pextr.py +++ b/test/arch/x86/unit/mn_pextr.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PEXTRB(Asm_Test_32): TXT = ''' main: @@ -22,4 +23,4 @@ class Test_PEXTRB(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PEXTRB]] + [test(*sys.argv[1:])() for test in [Test_PEXTRB]] diff --git a/test/arch/x86/unit/mn_pinsr.py b/test/arch/x86/unit/mn_pinsr.py index a10cd286..74120e5c 100644 --- a/test/arch/x86/unit/mn_pinsr.py +++ b/test/arch/x86/unit/mn_pinsr.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PINSRB(Asm_Test_32): TXT = ''' main: @@ -22,4 +23,4 @@ class Test_PINSRB(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PINSRB]] + [test(*sys.argv[1:])() for test in [Test_PINSRB]] diff --git a/test/arch/x86/unit/mn_pmaxu.py b/test/arch/x86/unit/mn_pmaxu.py index 50cbff94..527b966f 100644 --- a/test/arch/x86/unit/mn_pmaxu.py +++ b/test/arch/x86/unit/mn_pmaxu.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PMAXU(Asm_Test_32): TXT = ''' main: @@ -22,4 +23,4 @@ class Test_PMAXU(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PMAXU]] + [test(*sys.argv[1:])() for test in [Test_PMAXU]] diff --git a/test/arch/x86/unit/mn_pminu.py b/test/arch/x86/unit/mn_pminu.py index 27c9ad1e..d667df4e 100644 --- a/test/arch/x86/unit/mn_pminu.py +++ b/test/arch/x86/unit/mn_pminu.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PMINU(Asm_Test_32): TXT = ''' main: @@ -22,4 +23,4 @@ class Test_PMINU(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PMINU]] + [test(*sys.argv[1:])() for test in [Test_PMINU]] diff --git a/test/arch/x86/unit/mn_pmovmskb.py b/test/arch/x86/unit/mn_pmovmskb.py index 796e977c..b7e7b897 100644 --- a/test/arch/x86/unit/mn_pmovmskb.py +++ b/test/arch/x86/unit/mn_pmovmskb.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PMOVMSKB(Asm_Test_32): TXT = ''' main: @@ -23,4 +24,4 @@ class Test_PMOVMSKB(Asm_Test_32): assert self.myjit.cpu.EAX == 0x00000015 if __name__ == "__main__": - [test()() for test in [Test_PMOVMSKB,]] + [test(*sys.argv[1:])() for test in [Test_PMOVMSKB,]] diff --git a/test/arch/x86/unit/mn_pshufb.py b/test/arch/x86/unit/mn_pshufb.py index 594b0870..5f4c7370 100644 --- a/test/arch/x86/unit/mn_pshufb.py +++ b/test/arch/x86/unit/mn_pshufb.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PSHUFB(Asm_Test_32): TXT = ''' main: @@ -22,4 +23,4 @@ class Test_PSHUFB(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PSHUFB]] + [test(*sys.argv[1:])() for test in [Test_PSHUFB]] diff --git a/test/arch/x86/unit/mn_psrl_psll.py b/test/arch/x86/unit/mn_psrl_psll.py index 79125612..44126b96 100644 --- a/test/arch/x86/unit/mn_psrl_psll.py +++ b/test/arch/x86/unit/mn_psrl_psll.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PSRL(Asm_Test_32): TXT = ''' main: @@ -52,4 +53,4 @@ class Test_PSLL(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_PSRL, Test_PSLL]] + [test(*sys.argv[1:])() for test in [Test_PSRL, Test_PSLL]] diff --git a/test/arch/x86/unit/mn_punpck.py b/test/arch/x86/unit/mn_punpck.py index 8b655aa0..f6a4772e 100644 --- a/test/arch/x86/unit/mn_punpck.py +++ b/test/arch/x86/unit/mn_punpck.py @@ -1,7 +1,8 @@ #! /usr/bin/env python -from asm_test import Asm_Test_32 import sys +from asm_test import Asm_Test_32 + class Test_PUNPCKHBW(Asm_Test_32): TXT = ''' main: @@ -120,5 +121,5 @@ class Test_PUNPCKLDQ(Asm_Test_32): assert self.myjit.cpu.MM1 == 0xEEFF020155667788 if __name__ == "__main__": - [test()() for test in [Test_PUNPCKHBW, Test_PUNPCKHWD, Test_PUNPCKHDQ, - Test_PUNPCKLBW, Test_PUNPCKLWD, Test_PUNPCKLDQ,]] + [test(*sys.argv[1:])() for test in [Test_PUNPCKHBW, Test_PUNPCKHWD, Test_PUNPCKHDQ, + Test_PUNPCKLBW, Test_PUNPCKLWD, Test_PUNPCKLDQ,]] diff --git a/test/arch/x86/unit/mn_pushpop.py b/test/arch/x86/unit/mn_pushpop.py index d230a088..1a3f5517 100644 --- a/test/arch/x86/unit/mn_pushpop.py +++ b/test/arch/x86/unit/mn_pushpop.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test_16, Asm_Test_32 from miasm2.core.utils import pck16, pck32 @@ -119,7 +121,7 @@ class Test_PUSHAD_16(Asm_Test_16): if __name__ == "__main__": - [test()() for test in [Test_PUSHA_16, Test_PUSHA_32, - Test_PUSHAD_16, Test_PUSHAD_32 - ] - ] + [test(*sys.argv[1:])() for test in [Test_PUSHA_16, Test_PUSHA_32, + Test_PUSHAD_16, Test_PUSHAD_32 + ] + ] diff --git a/test/arch/x86/unit/mn_stack.py b/test/arch/x86/unit/mn_stack.py index 6ae26d67..3bce3979 100644 --- a/test/arch/x86/unit/mn_stack.py +++ b/test/arch/x86/unit/mn_stack.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test_32 @@ -57,4 +59,4 @@ BAD: if __name__ == "__main__": - [test()() for test in [Test_PUSHPOP]] + [test(*sys.argv[1:])() for test in [Test_PUSHPOP]] diff --git a/test/arch/x86/unit/mn_strings.py b/test/arch/x86/unit/mn_strings.py index f8055665..5e7269f7 100644 --- a/test/arch/x86/unit/mn_strings.py +++ b/test/arch/x86/unit/mn_strings.py @@ -1,4 +1,6 @@ #! /usr/bin/env python +import sys + from asm_test import Asm_Test_32 class Test_SCAS(Asm_Test_32): @@ -45,4 +47,4 @@ class Test_MOVS(Asm_Test_32): if __name__ == "__main__": - [test()() for test in [Test_SCAS, Test_MOVS]] + [test(*sys.argv[1:])() for test in [Test_SCAS, Test_MOVS]] diff --git a/test/test_all.py b/test/test_all.py index 9fbabe42..35f081de 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -13,6 +13,7 @@ TAGS = {"regression": "REGRESSION", # Regression tests "example": "EXAMPLE", # Examples "long": "LONG", # Very time consumming tests "llvm": "LLVM", # LLVM dependency is required + "tcc": "TCC", # TCC dependency is required "z3": "Z3", # Z3 dependecy is needed "qemu": "QEMU", # QEMU tests (several tests) } @@ -34,14 +35,25 @@ class RegressionTest(Test): def get_sample(cls, sample_name): "Return the relative path of @sample_name" return os.path.join(cls.sample_dir, sample_name) - - ## Architecture testset += RegressionTest(["x86/arch.py"], base_dir="arch", products=["x86_speed_reg_test.bin", "regression_test16_ia32.bin", "regression_test32_ia32.bin", "regression_test64_ia32.bin"]) + + + +### ArchUnit regression tests +class ArchUnitTest(RegressionTest): + """Test against arch unit regression tests""" + + jitter_engines = ["tcc", "llvm", "gcc"] + + def __init__(self, script, jitter ,*args, **kwargs): + super(ArchUnitTest, self).__init__([script, jitter], *args, **kwargs) + + for script in ["x86/sem.py", "x86/unit/mn_strings.py", "x86/unit/mn_float.py", @@ -69,7 +81,9 @@ for script in ["x86/sem.py", "mips32/arch.py", "mips32/unit/mn_bcc.py", ]: - testset += RegressionTest([script], base_dir="arch") + for jitter in ArchUnitTest.jitter_engines: + tags = [TAGS[jitter]] if jitter in TAGS else [] + testset += ArchUnitTest(script, jitter, base_dir="arch", tags=tags) ### QEMU regression tests class QEMUTest(RegressionTest): @@ -79,6 +93,7 @@ class QEMUTest(RegressionTest): SCRIPT_NAME = "testqemu.py" SAMPLE_NAME = "test-i386" EXPECTED_PATH = "expected" + jitter_engines = ["tcc", "llvm", "python", "gcc"] def __init__(self, name, jitter, *args, **kwargs): super(QEMUTest, self).__init__([self.SCRIPT_NAME], *args, **kwargs) @@ -95,52 +110,53 @@ class QEMUTest(RegressionTest): # Test name -> supported jitter engines -QEMU_TESTS = { +QEMU_TESTS = [ # Operations - "btr": ("tcc", "python", "gcc"), - "bts": ("tcc", "python", "gcc"), - "bt": ("tcc", "python", "gcc"), - "shrd": ("tcc", "python", "gcc"), - "shld": ("tcc", "python", "gcc"), - "rcl": ("tcc", "python", "gcc"), - "rcr": ("tcc", "python", "gcc"), - "ror": ("tcc", "python", "gcc"), - "rol": ("tcc", "python", "gcc"), - "sar": ("tcc", "python", "gcc"), - "shr": ("tcc", "python", "gcc"), - "shl": ("tcc", "python", "gcc"), - "not": ("tcc", "python", "gcc"), - "neg": ("tcc", "python", "gcc"), - "dec": ("tcc", "python", "gcc"), - "inc": ("tcc", "python", "gcc"), - "sbb": ("tcc", "python", "gcc"), - "adc": ("tcc", "python", "gcc"), - "cmp": ("tcc", "python", "gcc"), - "or": ("tcc", "python", "gcc"), - "and": ("tcc", "python", "gcc"), - "xor": ("tcc", "python", "gcc"), - "sub": ("tcc", "python", "gcc"), - "add": ("tcc", "python", "gcc"), + "btr", + "bts", + "bt", + "shrd", + "shld", + "rcl", + "rcr", + "ror", + "rol", + "sar", + "shr", + "shl", + "not", + "neg", + "dec", + "inc", + "sbb", + "adc", + "cmp", + "or", + "and", + "xor", + "sub", + "add", # Specifics - "bsx": ("tcc", "python", "gcc"), - "mul": ("tcc", "python", "gcc"), - "jcc": ("tcc", "python", "gcc"), - "loop": ("tcc", "python", "gcc"), - "lea": ("tcc", "python", "gcc"), - "self_modifying_code": ("tcc", "python", "gcc"), - "conv": ("tcc", "python", "gcc"), - "bcd": ("tcc", "python", "gcc"), - "xchg": ("tcc", "python", "gcc"), - "string": ("tcc", "python", "gcc"), - "misc": ("tcc", "python", "gcc"), + "bsx", + "mul", + "jcc", + "loop", + "lea", + "self_modifying_code", + "conv", + "bcd", + "xchg", + "string", + "misc", # Unsupported # "floats", "segs", "code16", "exceptions", "single_step" -} +] -for test_name, jitters in QEMU_TESTS.iteritems(): - for jitter_engine in jitters: - testset += QEMUTest(test_name, jitter_engine) +for test_name in QEMU_TESTS: + for jitter in QEMUTest.jitter_engines: + tags = [TAGS[jitter]] if jitter in TAGS else [] + testset += QEMUTest(test_name, jitter, tags=tags) ## Semantic @@ -183,7 +199,7 @@ class SemanticTestExec(RegressionTest): input_filename, "-a", hex(address)] self.products = [] - + self.tags.append(TAGS["tcc"]) test_x86_64_mul_div = SemanticTestAsm("x86_64", "PE", ["mul_div"]) @@ -232,7 +248,7 @@ testset += RegressionTest(["smt2.py"], base_dir="ir/translators", ## OS_DEP for script in ["win_api_x86_32.py", ]: - testset += RegressionTest([script], base_dir="os_dep") + testset += RegressionTest([script], base_dir="os_dep", tags=[TAGS['tcc']]) ## Analysis testset += RegressionTest(["depgraph.py"], base_dir="analysis", @@ -305,7 +321,7 @@ for i, test_args in enumerate(test_args): ## Jitter for script in ["jitload.py", ]: - testset += RegressionTest([script], base_dir="jitter") + testset += RegressionTest([script], base_dir="jitter", tags=[TAGS["tcc"]]) # Examples @@ -542,6 +558,7 @@ for jitter in ExampleJitter.jitter_engines: # Take 5 min on a Core i5 tags = {"python": [TAGS["long"]], "llvm": [TAGS["llvm"]], + "tcc": [TAGS["tcc"]], } testset += ExampleJitter(["unpack_upx.py", Example.get_sample("box_upx.exe")] + @@ -567,7 +584,7 @@ for script, dep in [(["x86_32.py", Example.get_sample("x86_32_sc.bin")], []), [test_box[name]]) for name in test_box_names]: for jitter in ExampleJitter.jitter_engines: - tags = [TAGS["llvm"]] if jitter == "llvm" else [] + tags = [TAGS[jitter]] if jitter in TAGS else [] testset += ExampleJitter(script + ["--jitter", jitter], depends=dep, tags=tags) @@ -650,6 +667,13 @@ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") except ImportError: llvm = False + # Handle tcc modularity + tcc = True + try: + from miasm2.jitter import Jittcc + except ImportError: + tcc = False + # TODO XXX: fix llvm jitter (deactivated for the moment) llvm = False @@ -661,6 +685,14 @@ By default, no tag is omitted." % ", ".join(TAGS.keys()), default="") if TAGS["llvm"] not in exclude_tags: exclude_tags.append(TAGS["llvm"]) + if tcc is False: + print "%(red)s[TCC]%(end)s Python" % cosmetics.colors + \ + "'libtcc' module is required for tcc tests" + + # Remove tcc tests + if TAGS["tcc"] not in exclude_tags: + exclude_tags.append(TAGS["tcc"]) + # Handle Z3 dependency try: import z3 |