summaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/misc/matrix
blob: 6a1b3bd1123c650fb9f47c176bf6586f46d529c9 (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/env python3
#
# Run a provided command over all possible subsets of important
# tor-rtcompat features.

import subprocess
import sys

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: list[list[str]] = [[]]

# 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)