matrix
1 #!/usr/bin/env python3 2 # 3 # Run a provided command over all possible subsets of important 4 # tor-rtcompat features. 5 6 import subprocess 7 import sys 8 9 if sys.argv[1:] == []: 10 print("You need to name a program to run with different features") 11 sys.exit(1) 12 13 FEATURES = ["tokio", "async-std", "native-tls", "rustls"] 14 15 COMBINATIONS: list[list[str]] = [[]] 16 17 # Generate all combinations of features. 18 for feature in FEATURES: 19 new_combinations = [c + [feature] for c in COMBINATIONS] 20 COMBINATIONS.extend(new_combinations) 21 22 for c in COMBINATIONS: 23 arg = "--features={}".format(",".join(c)) 24 commandline = sys.argv[1:] + [arg] 25 print(" ".join(commandline)) 26 subprocess.check_call(commandline)