-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
28 lines (23 loc) · 977 Bytes
/
Copy pathtesting.py
File metadata and controls
28 lines (23 loc) · 977 Bytes
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
import os
import subprocess
def run_inference_test(filename, method):
"""Run the inference engine test on a specific file with the given method."""
try:
result = subprocess.run(['python', 'main.py', filename, method], capture_output=True, text=True, check=True)
print(result.stdout)
except subprocess.CalledProcessError as e:
print(f"Error running test for {filename}: {e.stderr}")
def main():
# Directory containing the text files
directory = 'test_files'
# Method to use for inference (FC, BC, or TT)
method = 'TT'
# Loop through files in the directory
for filename in os.listdir(directory):
if filename.endswith('.txt'):
filepath = os.path.join(directory, filename)
print(f"Running test for {filepath} using {method} method...")
run_inference_test(filepath, method)
print() # Add a blank line between test results
if __name__ == "__main__":
main()