Skip to content

Commit

Permalink
Move run_tool_tests.py one level up (#143)
Browse files Browse the repository at this point in the history
Moved the tool to its parent directory so that it can be used to execute
system tests for all lobster tools in the future.
  • Loading branch information
phiwuu authored Dec 5, 2024
1 parent 1dc3de9 commit 6791c44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lint: style
python3 -m pylint --rcfile=pylint3.cfg \
--reports=no \
--ignore=assets.py \
lobster util tests-system/lobster-trlc/run_tool_tests.py
lobster util tests-system/run_tool_tests.py

style:
@python3 -m pycodestyle lobster \
Expand Down
3 changes: 1 addition & 2 deletions tests-system/lobster-trlc/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PYTHON = python

lobster-trlc-system-tests:
@echo "Running lobster-trlc system tests..."
@$(PYTHON) run_tool_tests.py
@$(PYTHON) ../run_tool_tests.py .
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ def _run_tests(directory: str, tool: str) -> int:
if not tool:
raise ValueError("No tool specified!")

counter = 0
for rbt_dir_entry in _get_directories(directory, REQUIREMENTS_BASED_TEST_PREFIX):
for test_case_dir_entry in _get_directories(rbt_dir_entry.path):
test_setup = TestSetup(test_case_dir_entry.path)
completed_process = _run_test(test_setup, tool)
_compare_results(test_setup, completed_process)
print(f"All system tests finished successfully for {tool}.")
counter += 1
print(f"{counter} system tests finished successfully for {tool}.")

# TODO: the current implementation is not consistent with respect to return codes.
# The tests use assertion statements to indicate failures, but here we use an
Expand All @@ -212,7 +214,9 @@ def _get_tool(test_dir: str) -> str:


if __name__ == "__main__":
test_directory = dirname(Path(__file__).resolve())
test_directory = Path(sys.argv[1]).resolve()
print(f"Starting system tests on folder '{test_directory}'")

sys.exit(
_run_tests(
test_directory,
Expand Down

0 comments on commit 6791c44

Please sign in to comment.