Skip to content

Commit

Permalink
Configurando Liter
Browse files Browse the repository at this point in the history
  • Loading branch information
JN513 committed Nov 20, 2024
1 parent e5cc807 commit 8f56062
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Processor CI Tests

[![Pylint](https://github.com/LSC-Unicamp/processor-ci-tests/actions/workflows/pylint.yml/badge.svg)](https://github.com/LSC-Unicamp/processor-ci-tests/actions/workflows/pylint.yml)
9 changes: 4 additions & 5 deletions test_runner/file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import glob


def read_file(name):
if not os.path.isfile(name):
raise FileNotFoundError(f"Error: The file '{name}' was not found.")
Expand All @@ -10,19 +11,17 @@ def read_file(name):
data.append(int(line.replace("\n", ""), 16))
return data, len(data)


def read_files_in_dir(path):
try:
return [
read_file(file)
for file in glob.glob(f"{path}/*.hex", recursive=True)
]
return [read_file(file) for file in glob.glob(f"{path}/*.hex", recursive=True)]
except FileNotFoundError:
print(f"Error: The directory '{path}' was not found.")
return []
except Exception as e:
print(f"Error: {e}")
return []


# return a list of all the paths with a directory named 'memory' in the path
def list_find_paths(path):
Expand Down
10 changes: 6 additions & 4 deletions test_runner/verificator.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Description: Verificator for the processor-ci-tests
# Enter a path provided in this program and recursively all the tests .hex for each leaf directory create a .xml file with the results
# 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
# Enter a path provided in this program and recursively all the tests .hex for each leaf directory create a .xml file with the results
# 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

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


class Verificator:
def __init__(self, path):
self.path = path
Expand All @@ -17,11 +18,12 @@ def run_tests(self):
paths = f.get_all_test_paths(self.path)
print(paths)


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


if __name__ == "__main__":
main()
11 changes: 5 additions & 6 deletions tests/generate_memory.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import os
import sys

current_path = os.getcwd()
page_size = 16
PAGE_SIZE = 16
files = os.listdir(f"{current_path}/memory/")
references = os.listdir(f"{current_path}/reference/")
memory_file = "memory.hex"
reference_file = "reference.hex"
MEMORTY_FILE = "memory.hex"
REFERENCE_FILE = "reference.hex"


def generate_reference_file() -> None:
file = open(reference_file, "w")
file = open(REFERENCE_FILE, "w")

for i in references:
temp_file = open(f"{current_path}/reference/{i}", "r")
Expand All @@ -24,7 +23,7 @@ def generate_reference_file() -> None:


def generate_memory_file() -> None:
file = open(memory_file, "w")
file = open(MEMORTY_FILE, "w")

for i in files:
temp_file = open(f"{current_path}/memory/{i}", "r")
Expand Down

0 comments on commit 8f56062

Please sign in to comment.