diff --git a/bin/runtest.py b/bin/runtest.py
index e7b04828c46cf467f0b92ed01cef378fd8343929..12594bfd454e8bc61d7dfda7c9af79b03f13809f 100644
--- a/bin/runtest.py
+++ b/bin/runtest.py
@@ -35,7 +35,7 @@ except OSError as e:
     print("OSError: Command not found. Most likely the executable specified doesn't exist.")
     sys.exit(1)
 if res:
-    sys.exit(1)
+    sys.exit(res)
 
 # run the comparison
 if args['script']: