aboutsummaryrefslogtreecommitdiff
path: root/verif/tosa_verif_build_tests.py
diff options
context:
space:
mode:
authorMatthew Haddon <matthew.haddon@arm.com>2021-07-16 15:38:20 +0100
committerMatthew Haddon <matthew.haddon@arm.com>2021-09-08 12:17:59 +0100
commit74567097e161ce9cdb0f09d474da6d9d36aa7476 (patch)
treea210dbedfdc5f1fa588a31c49e2b7f63f4624daa /verif/tosa_verif_build_tests.py
parent4b2881a7c1cbb2a4b0b24cafcdef28af0f4975c1 (diff)
downloadreference_model-74567097e161ce9cdb0f09d474da6d9d36aa7476.tar.gz
Allow user to specify test type generated
* The option --test-type allows the user to select 'positive', 'negative', or 'both' types of tests produced by the test generator. * Reset RNG when looping through negative test generation (generation not implemented) Signed-off-by: Matthew Haddon <matthew.haddon@arm.com> Change-Id: I1bfcb3170e7380be0f98b36b3d4abc4779a05abe
Diffstat (limited to 'verif/tosa_verif_build_tests.py')
-rwxr-xr-xverif/tosa_verif_build_tests.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/verif/tosa_verif_build_tests.py b/verif/tosa_verif_build_tests.py
index 343d8d4..02d1934 100755
--- a/verif/tosa_verif_build_tests.py
+++ b/verif/tosa_verif_build_tests.py
@@ -201,6 +201,14 @@ def parseArgs():
help="Allow constant input tensors for concat operator",
)
+ parser.add_argument(
+ "--test-type",
+ dest="test_type",
+ choices=['positive', 'negative', 'both'],
+ default="positive",
+ type=str,
+ help="type of tests produced, postive, negative, or both",
+ )
args = parser.parse_args()
return args
@@ -221,15 +229,19 @@ def main():
shapeFilter=args.target_shapes,
rankFilter=args.target_ranks,
dtypeFilter=args.target_dtypes,
+ testType=args.test_type
)
)
print("{} matching tests".format(len(testList)))
+ results = []
for opName, testStr, dtype, shapeList, testArgs in testList:
if args.verbose:
print(testStr)
- ttg.serializeTest(opName, testStr, dtype, shapeList, testArgs)
- print("Done creating {} tests".format(len(testList)))
+ results.append(ttg.serializeTest(opName, testStr, dtype, shapeList, testArgs))
+
+ print(f"Done creating {len(results)} tests")
+
if __name__ == "__main__":