From 4bd1beb459873128dc57309b83d8ef8437261daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de> Date: Mon, 12 Apr 2021 15:02:27 +0200 Subject: [PATCH] [bin][findtests] make output file settable --- bin/testing/findtests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/testing/findtests.py b/bin/testing/findtests.py index c1f970addd..aa9bf51557 100755 --- a/bin/testing/findtests.py +++ b/bin/testing/findtests.py @@ -14,7 +14,7 @@ from subprocess import PIPE import os -# Whether the two lists a and b have a common member +# Check if the set a contains a member of list b def has_common_member(myset, mylist): return not myset.isdisjoint(mylist) @@ -82,6 +82,9 @@ if __name__ == '__main__': help='The source tree (default: `HEAD`)') parser.add_argument('-t', '--target', required=False, default='master', help='The tree to compare against (default: `master`)') + parser.add_argument('-f', '--outfile', required=False, + default='affectedtests.json', + help='The file in which to write the affected tests') args = vars(parser.parse_args()) # find the changes files @@ -110,5 +113,5 @@ if __name__ == '__main__': count += 1 print("Detected {} affected tests".format(count)) - with open('affectedtests.json', 'w') as jsonFile: + with open(args['outfile'], 'w') as jsonFile: json.dump(affectedTests, jsonFile) -- GitLab