summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/misc/matrix
blob: 4031a24901cb59d38f0621cdb24e89185a57f806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/python
#
# Run a provided command over all possible subsets of important
# tor-rtcompat features.

import sys, subprocess

if sys.argv[1:] == []:
    print("You need to name a program to run with different features")
    sys.exit(1)

FEATURES = [ "tokio", "async-std", "native-tls", "rustls" ]

COMBINATIONS = [ [] ]

# Generate all combinations of features.
for feature in FEATURES:
    new_combinations = [ c + [ feature ] for c in COMBINATIONS ]
    COMBINATIONS.extend(new_combinations)

for c in COMBINATIONS:
    arg = "--features={}".format(",".join(c))
    commandline = sys.argv[1:] + [arg]
    print(" ".join(commandline))
    subprocess.check_call(commandline)