mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
tests/avocado: excercise scripts/replay-dump.py in replay tests
This runs replay-dump.py after recording a trace, and fails the test if the script fails. replay-dump.py is modified to exit with non-zero if an error is encountered while parsing, to support this. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> gitlab with this change v5: Update timeout to 180s because x86 was just exceeding 120s in Message-Id: <20240813050638.446172-4-npiggin@gmail.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240813202329.1237572-12-alex.bennee@linaro.org>
This commit is contained in:
parent
01a385fb49
commit
4926b6e644
3 changed files with 26 additions and 3 deletions
|
@ -21,6 +21,7 @@
|
|||
import argparse
|
||||
import struct
|
||||
import os
|
||||
import sys
|
||||
from collections import namedtuple
|
||||
from os import path
|
||||
|
||||
|
@ -100,7 +101,7 @@ def call_decode(table, index, dumpfile):
|
|||
print("Could not decode index: %d" % (index))
|
||||
print("Entry is: %s" % (decoder))
|
||||
print("Decode Table is:\n%s" % (table))
|
||||
return False
|
||||
raise(Exception("unknown event"))
|
||||
else:
|
||||
return decoder.fn(decoder.eid, decoder.name, dumpfile)
|
||||
|
||||
|
@ -121,7 +122,7 @@ def print_event(eid, name, string=None, event_count=None):
|
|||
def decode_unimp(eid, name, _unused_dumpfile):
|
||||
"Unimplemented decoder, will trigger exit"
|
||||
print("%s not handled - will now stop" % (name))
|
||||
return False
|
||||
raise(Exception("unhandled event"))
|
||||
|
||||
def decode_plain(eid, name, _unused_dumpfile):
|
||||
"Plain events without additional data"
|
||||
|
@ -434,6 +435,7 @@ def decode_file(filename):
|
|||
dumpfile)
|
||||
except Exception as inst:
|
||||
print(f"error {inst}")
|
||||
sys.exit(1)
|
||||
|
||||
finally:
|
||||
print(f"Reached {dumpfile.tell()} of {dumpsize} bytes")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue