-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
executable file
·36 lines (28 loc) · 1.03 KB
/
test.py
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
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
import subprocess
import sys
# Available tests and their corresponding Python files
TESTS = {
"1": ("Test irradix/derradix conversion", "ta1.py"),
"2": ("Test no '101' sequence in irradix", "ta2.py"),
"3": ("Test packing sequences of random integers with encoding/decoding", "ta3.py"),
"4": ("Test irradix integer map and measure some properties", "ta4.py"),
}
def run_test(test_file):
# Runs the selected test file
subprocess.run([sys.executable, test_file])
def main():
print("Available Tests:")
for key, (description, _) in TESTS.items():
print(f"{key}: {description}")
choice = input("\nEnter the number of the test you want to run (or 'q' to quit): ").strip()
if choice in TESTS:
description, test_file = TESTS[choice]
print(f"\nRunning {description}...")
run_test(test_file)
elif choice.lower() == 'q':
print("Exiting...")
else:
print("Invalid choice. Please select a valid test number.")
if __name__ == "__main__":
main()