Skip to content

Commit

Permalink
Start coding test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor-Lake committed Nov 20, 2024
1 parent 8f56062 commit 44d7d54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
8 changes: 5 additions & 3 deletions test_runner/file.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def read_file(name):

def read_files_in_dir(path):
try:
return [read_file(file) for file in glob.glob(f"{path}/*.hex", recursive=True)]
file = [read_file(file) for file in glob.glob(f"{path}/*.hex", recursive=True)]
file.append(path)
return file
except FileNotFoundError:
print(f"Error: The directory '{path}' was not found.")
return []
Expand All @@ -25,7 +27,7 @@ def read_files_in_dir(path):

# return a list of all the paths with a directory named 'memory' in the path
def list_find_paths(path):
return [
return {
os.path.dirname(file)
for file in glob.glob(f"{path}/**/memory/*.hex", recursive=True)
]
}
19 changes: 13 additions & 6 deletions test_runner/verificator.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@
# of the tests in that folder the XML files are saved in the test-reports directory with the name
# results_{test_path_name}_{timestamp}.xml

#test_extensão_tipo_timestamp.xml

import os
from processor_ci_communication.core.serial import ProcessorCIInterface
import test_runner.file as f
import file as f



class Verificator:
def __init__(self, path):
self.path = path
self.interface = ProcessorCIInterface()
self.interface.open()
#self.interface = ProcessorCIInterface()
#self.interface.open()


def run_tests(self):
paths = f.get_all_test_paths(self.path)
tests = []
paths = f.list_find_paths(self.path)
print(paths)
for path in paths:
tests.append(f.read_files_in_dir(path))
print(tests)


def main():
verifier = Verificator("C:/Users/Usuario/Documents/processor-ci-tests/test_runner")
verifier = Verificator("/eda/processor-ci-tests/test_runner/testing_testes")
verifier.run_tests()
return 0

Expand Down

0 comments on commit 44d7d54

Please sign in to comment.