From: Daniel Benusovich Date: Sat, 23 Feb 2019 18:17:44 +0000 (-0800) Subject: Adding test utility class X-Git-Tag: div_pipeline~2383 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d2b5f673e92713856d6e27357be4112b92c0d52;p=soc.git Adding test utility class --- diff --git a/TestUtil/test_helper.py b/TestUtil/test_helper.py new file mode 100644 index 00000000..0d5329ca --- /dev/null +++ b/TestUtil/test_helper.py @@ -0,0 +1,11 @@ +# Verifies the given values via the requested operation +# Arguments: +# p (Prefix): Appended to the front of the assert statement +# e (Expected): The expected value +# o (Output): The output result +# op (Operation): (0 => ==), (1 => !=) +def check(p, o, e, op): + if(op == 0): + assert o == e, p + " Output " + str(o) + " Expected " + str(e) + else: + assert o != e, p + " Output " + str(o) + " Not Expecting " + str(e) \ No newline at end of file