From 3e9519f18e040dce7491d26a0931e3d0458fb8f0 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 7 Mar 2019 13:16:55 -0300 Subject: [PATCH] Added '-shuffle' parameter --- generate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generate.py b/generate.py index 05e54b4..39a142e 100755 --- a/generate.py +++ b/generate.py @@ -4,6 +4,7 @@ import sys import util import struct +import random import argparse import itertools as it import collections as cl @@ -55,6 +56,7 @@ def iter_tests (defaults, tests, order): argparser = argparse.ArgumentParser(prog=os.path.basename(__file__)) argparser.add_argument("-clear", action="store_true") +argparser.add_argument("-shuffle", action="store_true") argparser.add_argument("-release-tasks", action="store_true") argparser.add_argument("-no-warnings", action="store_false", dest="warnings") @@ -113,6 +115,9 @@ def main (argv): if tuple(sorted(ts)) not in exists ] + if args.shuffle: + random.shuffle(tests, (lambda: 0.42)) + created = alist.write_locked(queue, *tests) tlate.seek(0, os.SEEK_END)