diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-08-08 11:24:22 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-08-09 08:01:15 +0200 |
| commit | d2756cb85f4b06280fb38eb32f6322ffbd0e17ca (patch) | |
| tree | e506ea61f70740b79446f2400d8f6da36a7d4365 /test/test_all.py | |
| parent | e6f2b1431e0364583385a44d03a78775d9578dd9 (diff) | |
| download | miasm-d2756cb85f4b06280fb38eb32f6322ffbd0e17ca.tar.gz miasm-d2756cb85f4b06280fb38eb32f6322ffbd0e17ca.zip | |
Example: add constant expression propagation
Diffstat (limited to 'test/test_all.py')
| -rwxr-xr-x | test/test_all.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/test_all.py b/test/test_all.py index 07542f6a..17193d9f 100755 --- a/test/test_all.py +++ b/test/test_all.py @@ -188,8 +188,9 @@ class SemanticTestAsm(RegressionTest): self.command_line = [self.shellcode_script, arch, input_filename, - output_filename, - self.container_dct.get(container, '')] + output_filename] + if container in self.container_dct: + self.command_line.append(self.container_dct[container]) self.products = [output_filename, "graph.dot"] @@ -304,6 +305,17 @@ testset += RegressionTest(["data_flow.py"], base_dir="analysis", for test_nb in xrange(1, 18)) for fname in fnames]) +for i in xrange(1, 21): + input_name = "cst_propag/x86_32_sc_%d" % i + bin_name = "samples/x86_32/%s.bin" % input_name + test_x86_32_cst = SemanticTestAsm("x86_32", None, [input_name]) + testset+= test_x86_32_cst + testset += RegressionTest(["../example/expression/constant_propagation.py", "-s", bin_name, "0"], + depends=[test_x86_32_cst], + products=["%s.propag.dot" % bin_name]) + + + ## Degraph class TestDepgraph(RegressionTest): """Dependency graph test""" @@ -565,6 +577,11 @@ testset += ExampleExpression(["access_c.py", Example.get_sample("human.bin")], testset += ExampleExpression(["expr_c.py"], tags=[TAGS["cparser"]]) + +testset += ExampleExpression(["constant_propagation.py", + Example.get_sample("simple_test.bin"), "-s", "0"], + products=["%s.propag.dot" % Example.get_sample("simple_test.bin")]) + for script in [["basic_op.py"], ["basic_simplification.py"], ["simplification_tools.py"], |