Fail if simulator exits early.
authorRichard Xia <rxia@sifive.com>
Tue, 23 May 2017 20:38:08 +0000 (13:38 -0700)
committerRichard Xia <rxia@sifive.com>
Tue, 23 May 2017 20:38:08 +0000 (13:38 -0700)
debug/testlib.py

index b5bd992234cd2252a30d2018076d71614d1459a1..3d08e9b33e172388433950d74f5de40cbb27d2fb 100644 (file)
@@ -132,6 +132,12 @@ class VcsSim(object):
                 stdout=logfile, stderr=logfile)
         done = False
         while not done:
+            # Fail if VCS exits early
+            exit_code = self.process.poll()
+            if exit_code is not None:
+                raise RuntimeError('VCS simulator exited early with status %d'
+                                   % exit_code)
+
             line = listenfile.readline()
             if not line:
                 time.sleep(1)