diff --git a/bindings/python/tests/test_all.py b/bindings/python/tests/test_all.py index 35df10132a..9c413f7783 100755 --- a/bindings/python/tests/test_all.py +++ b/bindings/python/tests/test_all.py @@ -1,11 +1,20 @@ #!/usr/bin/env python3 import test_lite +import test_iter import test_skipdata import test_customized_mnem import test_compatibility_layer -test_lite.test_class() -test_skipdata.test_class() -test_customized_mnem.test() -test_compatibility_layer.test_compatibility() +errors = [] +errors.extend(test_lite.test_class()) +errors.extend(test_iter.test_class()) +errors.extend(test_skipdata.test_class()) +errors.extend(test_customized_mnem.test()) +errors.extend(test_compatibility_layer.test_compatibility()) + +if errors: + print("Some errors happened. Please check the output") + for error in errors: + print(error) + exit(1) diff --git a/bindings/python/tests/test_compatibility_layer.py b/bindings/python/tests/test_compatibility_layer.py index 464d2bb898..3dfadf8e43 100644 --- a/bindings/python/tests/test_compatibility_layer.py +++ b/bindings/python/tests/test_compatibility_layer.py @@ -22,6 +22,7 @@ # Test arm64 and sysz compatibility layer def test_compatibility(): + errors = [] for arch, mode, code, comment in all_tests: print("*" * 16) print("Platform: %s" % comment) @@ -39,6 +40,7 @@ def test_compatibility(): print() except CsError as e: print("ERROR: %s" % e) + errors.append(str(e)) # Test ARM64_ constants print("arm64.ARM64_CC_AL = %d" % capstone.arm64.ARM64_CC_AL) @@ -52,7 +54,10 @@ def test_compatibility(): print("systemz.SYSZ_INS_LG = %d" % capstone.systemz.SYSZ_INS_LG) print("systemz.SYSTEMZ_INS_LG = %d" % capstone.systemz.SYSTEMZ_INS_LG) assert capstone.systemz.SYSZ_INS_LG == capstone.systemz.SYSTEMZ_INS_LG + return errors if __name__ == "__main__": - test_compatibility() + if test_compatibility(): + print("Some errors happened. Please check the output") + exit(1) diff --git a/bindings/python/tests/test_customized_mnem.py b/bindings/python/tests/test_customized_mnem.py index 157e6d096d..5b64943fd1 100755 --- a/bindings/python/tests/test_customized_mnem.py +++ b/bindings/python/tests/test_customized_mnem.py @@ -18,6 +18,7 @@ def print_insn(md, code): def test(): + errors = [] try: md = Cs(CS_ARCH_X86, CS_MODE_32) @@ -33,7 +34,11 @@ def test(): print_insn(md, X86_CODE32) except CsError as e: print("ERROR: %s" % e) + errors.append(str(e)) + return errors if __name__ == '__main__': - test() + if test(): + print("Some errors happened. Please check the output") + exit(1) diff --git a/bindings/python/tests/test_iter.py b/bindings/python/tests/test_iter.py index 74ea2dfabe..fd83a70bc8 100755 --- a/bindings/python/tests/test_iter.py +++ b/bindings/python/tests/test_iter.py @@ -70,6 +70,7 @@ # ## Test class Cs def test_class(): + errors = [] for (arch, mode, code, comment, syntax) in all_tests: print('*' * 16) print("Platform: %s" % comment) @@ -89,6 +90,10 @@ def test_class(): print() except CsError as e: print("ERROR: %s" % e) + errors.append(str(e)) + return errors if __name__ == '__main__': - test_class() + if test_class(): + print("Some errors happened. Please check the output") + exit(1) diff --git a/bindings/python/tests/test_lite.py b/bindings/python/tests/test_lite.py index 31a6dfb450..979c9cf4bd 100755 --- a/bindings/python/tests/test_lite.py +++ b/bindings/python/tests/test_lite.py @@ -71,6 +71,7 @@ def test_cs_disasm_quick(): # ## Test class Cs def test_class(): + errors = [] for (arch, mode, code, comment, syntax) in all_tests: print('*' * 16) print("Platform: %s" % comment) @@ -90,9 +91,13 @@ def test_class(): print() except CsError as e: print("ERROR: %s" % e) + errors.append(str(e)) + return errors # test_cs_disasm_quick() # print "*" * 40 if __name__ == '__main__': - test_class() + if test_class(): + print("Some errors happened. Please check the output") + exit(1) diff --git a/bindings/python/tests/test_skipdata.py b/bindings/python/tests/test_skipdata.py index 0fd7d7fca1..8f2052b18a 100755 --- a/bindings/python/tests/test_skipdata.py +++ b/bindings/python/tests/test_skipdata.py @@ -23,6 +23,7 @@ def testcb(buffer, size, offset, userdata): # ## Test class Cs def test_class(): + errors = [] for (arch, mode, code, comment, syntax) in all_tests: print('*' * 16) print("Platform: %s" %comment) @@ -65,7 +66,11 @@ def test_class(): print except CsError as e: print("ERROR: %s" % e) + errors.append(str(e)) + return errors if __name__ == '__main__': - test_class() + if test_class(): + print("Some errors happened. Please check the output") + exit(1)