about summary refs log tree commit diff stats
path: root/test/analysis/dg_check.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2016-03-21 13:12:24 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2016-03-21 15:09:39 +0100
commitc7167b49e4147e337b925564bacdb34b34069c72 (patch)
tree5798beedfa52bb89dbd278e7585098537a011642 /test/analysis/dg_check.py
parent7ab305601b1f274967187bb8182ce47e94ee0dd8 (diff)
downloadmiasm-c7167b49e4147e337b925564bacdb34b34069c72.tar.gz
miasm-c7167b49e4147e337b925564bacdb34b34069c72.zip
Test/Depgraph: add DG emulation regression tests
Diffstat (limited to 'test/analysis/dg_check.py')
-rw-r--r--test/analysis/dg_check.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/analysis/dg_check.py b/test/analysis/dg_check.py
new file mode 100644
index 00000000..0d680b6f
--- /dev/null
+++ b/test/analysis/dg_check.py
@@ -0,0 +1,20 @@
+from pdb import pm
+import sys
+import subprocess
+import json
+
+
+expected_file = sys.argv[1]
+dg = subprocess.Popen(["python"] + sys.argv[2:], stdout=subprocess.PIPE)
+
+stdout, _ = dg.communicate()
+expected = json.load(open(expected_file))
+result = json.loads(stdout)
+
+
+expected.sort()
+result.sort()
+
+print expected
+print result
+assert expected == result