Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tools/test-my-pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def getpackages():

parser = argparse.ArgumentParser(description='Run this script from your branch with proposed Cppcheck patch to verify your patch against current main. It will compare output of testing bunch of opensource packages')
parser.add_argument('-j', default=1, type=int, help='Concurency execution threads')
parser.add_argument('-n', '--max-packages', default=256, type=int, help='Maximum number of packages to test')
package_group = parser.add_mutually_exclusive_group()
package_group.add_argument('-p', default=256, type=int, help='Count of packages to check')
package_group.add_argument('--packages', nargs='+', help='Check specific packages and then stop.')
package_group.add_argument('--packages-path', default=None, type=str, help='Check packages in path.')
parser.add_argument('-o', default='my_check_diff.log', help='Filename of result inside a working path dir')
Expand All @@ -146,6 +146,8 @@ def getpackages():
args.packages = getpackages()
random.shuffle(args.packages)

packages_to_process = min(args.max_packages, len(args.packages))

print('\n'.join(args.packages[:20]))

if not lib.check_requirements():
Expand Down Expand Up @@ -212,8 +214,11 @@ def getpackages():
crashes = []
timeouts = []

while packages_processed < args.p and args.packages:
while packages_processed < packages_to_process and args.packages:
package = args.packages.pop()
packages_processed += 1
print('Processing package {} of {}'.format(packages_processed, packages_to_process))


if package.startswith('ftp://') or package.startswith('https://'):
tgz = lib.download_package(work_path, package, None)
Expand Down Expand Up @@ -298,9 +303,6 @@ def getpackages():
format_float(time_your), format_float(time_your, time_main),
package_width=package_width, timing_width=timing_width))

packages_processed += 1
print(str(packages_processed) + ' of ' + str(args.p) + ' packages processed\n')

with open(result_file, 'a') as myfile:
myfile.write('\n\ncrashes\n')
myfile.write('\n'.join(crashes))
Expand Down
Loading