Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior changes in test suite generator and executor modules #16

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from os import makedirs, path
from time import time
from typing import List
from subprocess import CalledProcessError

from nimrod.tests.utils import get_config
from nimrod.core.merge_scenario_under_analysis import MergeScenarioUnderAnalysis
Expand Down Expand Up @@ -70,6 +71,9 @@ def _compile_test_suite(self, input_jar: str, test_suite_path: str, extra_class_
class_path = generate_classpath([input_jar, test_suite_path, compiled_classes_path, JUNIT, HAMCREST] + extra_class_path)

for java_file in self._get_test_suite_class_paths(test_suite_path):
self._java.exec_javac(java_file, test_suite_path, None, None,
'-classpath', class_path, '-d', compiled_classes_path)
try:
self._java.exec_javac(java_file, test_suite_path, None, None,
'-classpath', class_path, '-d', compiled_classes_path)
except CalledProcessError:
logging.error("Error while compiling %s", java_file)
return class_path
10 changes: 5 additions & 5 deletions nimrod/test_suites_execution/test_suite_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def _parse_test_results_from_output(self, output: str) -> Dict[str, TestCaseResu
test_run_count = 0
if tests_run:
test_run_count = int(tests_run.group('tests_run_count'))
for i in range(0, test_run_count):
test_case_name = 'test{number:0{width}d}'.format(width=len(str(test_run_count)), number=i)
if not results.get(test_case_name):
results[test_case_name] = TestCaseResult.PASS

if results:
for i in range(0, test_run_count):
test_case_name = 'test{number:0{width}d}'.format(width=len(str(test_run_count)), number=i)
if not results.get(test_case_name):
results[test_case_name] = TestCaseResult.PASS
return results

def execute_test_suite_with_coverage(self, test_suite: TestSuite, target_jar: str, test_cases: List[str]) -> str:
Expand Down
Loading